-
Notifications
You must be signed in to change notification settings - Fork 917
[WIP] Composition dependent fluid properties for multicomponent flow #1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…NSTANT_CONDUCTIVITY
…t calls mixing laws function every iteration.
|
@mheimgartner first of all congrats to this openend PR For the builds in the tests, compiler warnings are treated like errors. I.e. the code compiles and works on your side but the test-builds won't if certain warnings are present (like unused variables). To look in the |
|
Hi @mheimgartner, thanks for the PR. I think this is a good use of the fluidmodel classes. There seems to be a lot of potential to generalize some aspects of Mixture_Fluid_Model and CNEMOGas. Im not sure what the best plan to approach this may be, but I think its something worth discussing. |
@WallyMaier I think there might be some overlap in fluid properties like mixing models as well, but I do not know what information you have available in a library like mutation++. I assume that it has general fluid property calculations and mixing rules available that could be used (wilke rule, kinetic models, etc)? |
@bigfooted Thats correct! Both the CNEMOGas fluid models (SU2TCLib and CMutation++) have thermodynamic properties and transport properties. I imagine there would be a smart way to reduce overlap, though Im not sure what the best approach would be. |
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments below to keep in mind when you continue the implementation.
| unique_ptr<CViscosityModel> LaminarViscosityPointers[100]; | ||
| unique_ptr<CConductivityModel> ThermalConductivityPointers[100]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either std::vector or std::array. If you go for a fixed size define it as a constexpr member variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I hardcoded this because I don't know how to set the size corresponding to the number of species in the mixture.
Right now, I changed it to e.g.:
std::vector<std::unique_ptr> LaminarViscosityPointers;
and kept void CFluidScalar::SetLaminarViscosityModel(const CConfig* config) {} in CFluidScalar.cpp the same. Is this the correct way?
|
|
||
| #include "CFluidModel.hpp" | ||
|
|
||
| class CFluidScalar : public CFluidModel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing override and or final specifiers in this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Pedro for all your comments, really appreciate the help! Question regarding the CFluidScalar class which I made final, is it better to use override or final for its members, e.g.:
void SetLaminarViscosityModel(const CConfig* config) override;
vs
void SetLaminarViscosityModel(const CConfig* config) final;
If a member function is declared without virtual and with final, it means that it already overrides a virtual function in base class, so I figure it might be preferred to use final ? Also, do I need to state final after every function member in CFluidScalar?
SU2_CFD/src/fluid/CFluidScalar.cpp
Outdated
| wilkeNumerator.clear(); | ||
| su2double viscosityMixture = 0.0; | ||
|
|
||
| massToMoleFractions(val_scalars); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, too many hidden things happening, make the method const and the interface as explicit as possible.
x,y go in, z comes out.
It should not be necessary to read massToMoleFractions to understand wilkeViscosity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I only moved massToMoleFractions to SetTDState_T. I did not make the method const because laminarViscosity is altered by wilkeViscosity. I placed laminarViscosity within the function because the laminarViscosity value may change at every grid point, e.g. when using Sutherland law in case of non-isothermal flow. Is there a better approach to do this?
TestCases/incomp_rans/multicomponentflow_variablefluidproperties/c6_cms_venturi_conference.cfg
Show resolved
Hide resolved
…icomp Conflicts: Common/include/CConfig.hpp Common/src/CConfig.cpp SU2_CFD/src/drivers/CDriver.cpp SU2_CFD/src/fluid/CFluidFlamelet.cpp SU2_CFD/src/numerics/CLookUpTable.cpp SU2_CFD/src/output/CFlowOutput.cpp SU2_CFD/src/output/output_structure_legacy.cpp SU2_CFD/src/solvers/CDiscAdjSolver.cpp SU2_CFD/src/solvers/CFlameletSolver.cpp SU2_CFD/src/solvers/CIncEulerSolver.cpp SU2_CFD/src/solvers/CPassiveScalarSolver.cpp SU2_CFD/src/solvers/CScalarSolver.cpp
…icomp Conflicts: .github/workflows/regression.yml
|
I hope to have fixed all regression testcases over at feature_flamelet so please merge and see whether we can get some ✔️'s here as well |
| Residual[iVar] += yinv*Volume*(Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; | ||
| else | ||
| Residual[iVar] += yinv*Volume*Density_i*(Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; | ||
| Residual[iVar] += yinv*Volume*(Density_i*Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This little bugfix in the axissymmetric source term let the corresponding reg test fail (which was to be expected). reg test-vals need to be adapted
1. Consistent number of species vals defined per option. This setup will see quite a bit more use with the multicomponent flow in #1332. 2. Boundness in [0,1] where applicable
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions. |
Proposed Changes
Hi all,
This draft PR contains all work on composition dependent fluid properties for multicomponent flow.
What I did so far:
• Implemented new CFluidScalar class (which inherits from CFluidModel) and can be accessed via a new fluid model: MIXTURE_FLUID_MODEL.
• Verified the current implementation by comparing with Fluent.
• Added regression test case for two component incomp_rans flow with variable fluid properties.
Future work:
• Fix variable specific heat capacity and convergence issues in case of axisymmetric flow.
• Add possibility to have more than a single transported scalar (i.e. mixture containing more than two components).
• Remove flamelet implementation from feature_multicomp in order to have this work self-contained. Note: Currently this is a PR into feature_flamelet to make the diff easier
In case there are comments, ideas, foreseeable stepping stones from experience please let me know.
Related Work
#1223 by @danielmayer @bigfooted which feature_multicomp currently branches from.
#1330 by @TobiKattmann which cuts the scalar transport necessary for this work out to merge it separately into develop
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.