Addition of multiple features required for SA-DDES turbulence model#428
Conversation
|
Thank you for your PR, here are some useful tips:
|
1c56610 to
7f60dfd
Compare
0594fae to
629d643
Compare
2628a6c to
7126416
Compare
| { | ||
|
|
||
| template<typename ValueType> | ||
| class SourceUTerm : public dsl::OperatorMixin<VolumeField<ValueType>> |
There was a problem hiding this comment.
SourceUTerm seems from the name to be specialized on the velocity field
Is there no implemenation of SourceTerm?
There was a problem hiding this comment.
U here does not stand for velocity U, but for the different source types:
Sp - proportional part: term is multiplied with transport variable
Su - unconditional part: term is independant of tranport variable
in NeoN we currently only have Sp type sources.
9c8850a to
76194dd
Compare
greole
left a comment
There was a problem hiding this comment.
LGTM! But make sure the CI passes before merging and please add curly braces for the for loops.
| @@ -1,7 +1,8 @@ | |||
| # Version 0.3.0 (unreleased) | |||
| # Version 0.3.0 (unreleased) 428 | |||
There was a problem hiding this comment.
| # Version 0.3.0 (unreleased) 428 | |
| # Version 0.3.0 (unreleased) |
| auto hostSource = source.copyToHost(); | ||
| auto hostSourceView = hostSource.view(); | ||
| for (auto ii = 0; ii < hostSource.size(); ++ii) | ||
| { | ||
| REQUIRE(hostSourceView[ii] - 5 * one<TestType>() == TestType(0.0)); | ||
| } |
There was a problem hiding this comment.
This can be handled with the new REQUIRE_THAT(exp, IsEqualTo(source));
| for (int k = 0; k < 6; ++k) | ||
| data_[k] = 0.0; |
There was a problem hiding this comment.
I dont know why claude is too lazy here to add curly braces. Without curly braces, it is very easy to break.
| for (int k = 0; k < 6; ++k) | |
| data_[k] = 0.0; | |
| for (int k = 0; k < 6; ++k) { | |
| data_[k] = 0.0; | |
| } |
| for (int k = 0; k < 6; ++k) | ||
| if (data_[k] != rhs.data_[k]) return false; |
There was a problem hiding this comment.
same here and all other for loops, please add curly braces for loop bodies even for a single line case.
| ); | ||
| } | ||
|
|
||
| /** @brief T + T^T - (2/3)*tr(T)*I — matches OpenFOAM devTwoSymm, used for viscous stress */ |
There was a problem hiding this comment.
| /** @brief T + T^T - (2/3)*tr(T)*I — matches OpenFOAM devTwoSymm, used for viscous stress */ | |
| /** @brief T + T^T - (2/3)*tr(T)*I — used for viscous stress */ |
There was a problem hiding this comment.
I am unsure about this, i dont think it is the greatest design, but i can live with it for now. Maybe we can use std::variant<VolumeField<scalar>, VolumeField<Vec3>> to make it a bit more DRY and have just one std::unordered_map. (But maybe it is also too painfull to use)? @HenningScheufler what do you think?
8204ba9 to
f3a5c24
Compare
…arbitrary fields into correctBoundaryConditions()
14f4f08 to
2ecc2b5
Compare
Addition of multiple features required for SA-DDES turbulence model
Implementation of turbulence model
This PR implements features required to run the SpalartAllmarasDDES turbulence model which is implemented in NeoFOAM PR 233 It consists of the following components:
Generally required for turbulence models
Sutype overload of source operatorsource(the available implementation before was only aSptype source term that multiplies by the transport variable) to be able to add source terms that do not linearly depend on the turbulence transport variable