- 
                Notifications
    
You must be signed in to change notification settings  - Fork 903
 
Preconditioning for multicomponent flows #2426
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
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: Nijso <[email protected]>
Co-authored-by: Nijso <[email protected]>
| const su2double Ref_Temperature; /*!< \brief Reference temperature. */ | ||
| const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */ | ||
| const su2double Prandtl_Number; /*!< \brief Prandlt number.*/ | ||
| const su2double Schmidt_Turb_Number; /*!< \brief Prandlt number.*/ | 
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.
Wrong doc
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.
Hi!
Thanks for your comment,
I have added the right documentation,
please let me know any additional comment/suggestion about it.
Thanks in advance!!
| viscous, /*!< \brief Viscous incompressible flows. */ | ||
| energy; /*!< \brief computation with the energy equation. */ | ||
| energy, /*!< \brief computation with the energy equation. */ | ||
| multicomponent; /*!< \brief multicomponent incompressible flows. */ | 
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.
Not needed anymore?
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.
Hi!
thanks for you comment,
I added that boolean multicomponent because for axisymmetric flows, there is an additional term that comes from the enthalpy diffusion which is only needed for multicomponent flows (term in blue)
I thought that It should only be computed and added when it is needed because when the FLUID_MODEL is different than FLUID_MIXTURE, the species mass fractions become passive scalars, so the term in blue becomes zero.
Please let me know what you think about it.
Thank you so much in advance!!!
| su2double Mean_Thermal_Conductivity; /*!< \brief Mean value of the effective thermal conductivity. */ | ||
| su2double Mean_Heat_Capacity; /*!< \brief Mean value of the heat capacity. */ | 
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.
Can we avoid intermediate su2doubles as class members?
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.
Hi!
Thanks for the comment!
I have removed this line because with the previous pull request about conductivity for compressible flows #2420, the mean heat capacity is now a member of the CAvgGrad_Base in the flow_diffussion.hpp, so there was no need to re-declare it in the CAvgGradInc_Flow.
Please let me know any additional comment about it.
Thanks in advance!!
| * \param[in,out] primitive - Primitive variables. | ||
| * \param[in] scalar - scalar 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.
order doesn't match function signature
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.
HI!
Thanks for the comment!
I switched the order of them according to the function.
Please let me know if that was needed to address this comment.
Thanks in advance!!!
| void CFluidFlamelet::SetTDState_h(su2double val_enthalpy, const su2double* val_scalars) { | ||
| SetTDState_T(val_enthalpy, 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 looks comment-worthy, why can you pass enthalpy as temperature?
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.
Hi!
thanks for the comment!!,
when the SPECIES_FLAMELET solver is used, one of the scalar equation is for total enthalpy, specifically the one with index 1.
As you can see from the picture in SetTDState_T added by Nijso and Evert, if I am not mistaken, the temperature (which is the current variable that is being solved in SU2) is a passive value, it is not used in that function because with the val_scalars (which are the variables used in the manifold for the Flamelet generated Manifold (FGM) approach) the temperature and any other thermochemical property are retrieved from the lookup table as you can see from lines 131.
So, as you might remember, in a previous developer meeting I mentioned that if we solve for the enthalpy in the preconditioning, we can eventually move the enthalpy equation solved in the SPECIES FLAMELET solver to the INC_EULER_SOLVER. This is not done in the current pull request because then the pull request will become even much larger as it is.
Please let me know if I should add a comment above these two functions explaining why enthalpy and temperature are passive values when the SPECIES_FLAMELET solver is used.
In a future pull request, we plan to move the enthalpy equation to the INC_EULER_SOLVER, so the SPECIES_FLAMELET solver can be reduced and used only for solving the additional transport equations needed for the FGM approach.
Thank you so much in advance!!!
| 
               | 
          ||
| /*! | ||
| * \brief Get enthalpy diffusivity terms. | ||
| */ | 
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.
document the arguments, what size is the array expected to have, etc.
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.
Hi!
Thank you so much for your comment,
I have added a documentation of arguments and the size of the array expected by this function.
Please let me know what you think about it.
Thanks!
        
          
                SU2_CFD/src/solvers/CIncNSSolver.cpp
              
                Outdated
          
        
      | su2double EnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; | ||
| su2double GradEnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; | ||
| FluidModel->SetTDState_T(nodes->GetPrimitive(iPoint)[prim_idx.Temperature()], Species_i); | ||
| FluidModel->SetEddyViscosity(nodes->GetPrimitive(iPoint)[prim_idx.EddyViscosity()]); | ||
| FluidModel->GetEnthalpyDiffusivity(EnthalpyDiffusion_i); | ||
| if (implicit) FluidModel->GetGradEnthalpyDiffusivity(GradEnthalpyDiffusion_i); | ||
| 
               | 
          ||
| /*--- Repeat the above computations for jPoint. ---*/ | ||
| 
               | 
          ||
| su2double EnthalpyDiffusion_j[MAXNVAR_SPECIES]{0.0}; | ||
| su2double GradEnthalpyDiffusion_j[MAXNVAR_SPECIES]{0.0}; | ||
| FluidModel->SetTDState_T(nodes->GetPrimitive(jPoint)[prim_idx.Temperature()], Species_j); | ||
| FluidModel->SetEddyViscosity(nodes->GetPrimitive(jPoint)[prim_idx.EddyViscosity()]); | ||
| FluidModel->GetEnthalpyDiffusivity(EnthalpyDiffusion_j); | ||
| if (implicit) FluidModel->GetGradEnthalpyDiffusivity(GradEnthalpyDiffusion_j); | 
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.
use a lambda to avoid the copy paste
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.
Hi!
Thank you so much for your comment,
I have added the lambda function for this part.
Please let me know what you think about it.
Thanks!
Co-authored-by: Pedro Gomes <[email protected]>
Co-authored-by: Pedro Gomes <[email protected]>
Co-authored-by: Pedro Gomes <[email protected]>
| 
           Hi @Cristopher-Morales , do the pywrapper testcases work correctly or is there still some issue?  | 
    
          
 Hi @bigfooted, Thanks for your comment!! the test case pywrapper_zimont does not work correctly, the other one regarding custom source buoyancy works fine. Thank you so much in advance!!!  | 
    
Proposed Changes
This pull request aims to extend the preconditioning for incompressible multicomponent flows, specifically when FLUID_MIXTURE model is used and energy equation is solved. Changes introduced in this pull request aim to solve directly for the sensible enthalpy instead of temperature. Specifically, the energy equation that is going to be solved for multicomponent flows is given as follows:
and the sensible enthalpy is:

Currently$C_{p}$  does not depend on temperature for FLUID_MIXTURE, but it depends on the mixture composition. So the sensible enthalpy simplifies to $C_{p}*(T-T_{0})$ . For problems where $C_{p}$  strongly depends on the temperature, Cantera library will be coupled to SU2. After this pull request is completed, a pull request with a fluid model using Cantera will be done where an energy equation for the total enthalpy will be solved.
A PDF document containing further details about this pull request is available at the following link:
preconditioning_general_approach.pdf
Related Work
Currently fluid mixture does not work correctly when the energy equation is on, this is mainly due to the fact that the energy equation that must be solved for multicomponent flows is the one mentioned above for the sensible enthalpy and not the energy equation for a perfect gas that is currently solved in SU2.
PR Checklist
pre-commit run --allto format old commits.