Skip to content

Commit 1025b8b

Browse files
Cristopher-MoralesbigfootedpcarruscagTobiKattmann
authored
Composition-dependent viscosity and thermal conductivity models for incompresible flows (#1690)
* 13-04-2022 adding FUID_MIXTURE * update thursday 14-04-2022 * 21-04-2022 CFluiscalar based on IncIdealGas * 21-04-2022 adding viscosity and thermal conductivity * 22-04-2022 compiles and run for more than one species, but still not converge * mixing density working 26-04-22 * 29-04-2022 cleaning up and compiling * 29-04-22 * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/include/CConfig.hpp Co-authored-by: Pedro Gomes <[email protected]> * 10-05-2022 fix comments * 10-05-2022 removingSchmidth files * 10-05-2022 checking density model * Update Common/include/CConfig.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/include/option_structure.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CDiffusivityModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/src/solvers/CIncNSSolver.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/src/solvers/CIncNSSolver.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/src/variables/CIncNSVariable.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/src/variables/CIncNSVariable.cpp Co-authored-by: Pedro Gomes <[email protected]> * 13-05-2022 cleaning * 13-05-2022 Cleaning * Update SU2_CFD/include/fluid/CDiffusivityModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CDiffusivityModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/src/fluid/CFluidScalar.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: Pedro Gomes <[email protected]> * 23-05-22 removing include not needed * Update SU2_CFD/src/fluid/CFluidScalar.cpp Co-authored-by: Pedro Gomes <[email protected]> * 24-05-2022 adding parallel_regression test * removing comment * Update SU2_CFD/src/fluid/CFluidScalar.cpp Co-authored-by: Nijso <[email protected]> * Update Common/src/CConfig.cpp Co-authored-by: Nijso <[email protected]> * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/include/CConfig.hpp Co-authored-by: TobiKattmann <[email protected]> * Update Common/include/CConfig.hpp Co-authored-by: TobiKattmann <[email protected]> * Update Common/include/CConfig.hpp Co-authored-by: TobiKattmann <[email protected]> * Update Common/include/option_structure.hpp Co-authored-by: TobiKattmann <[email protected]> * cleaning Csolverfactory * Update Common/src/CConfig.cpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/src/solvers/CIncEulerSolver.cpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/src/solvers/CIncEulerSolver.cpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/include/fluid/CFluidModel.hpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/src/solvers/CIncEulerSolver.cpp Co-authored-by: TobiKattmann <[email protected]> * Update SU2_CFD/src/fluid/CFluidScalar.cpp Co-authored-by: TobiKattmann <[email protected]> * cleaning CfluidScalar .hpp and .cpp * fixing clang-format * fixing test case parallel_regression * test case fixed * clang-formatfluidmodel and fluidscalar * clang-format fluidmodel and scalar * adding viscosity models * adding heat capacities * Revert "adding heat capacities" This reverts commit 5096e38. * adding thermal conductivity models * cleaning up * adding test case * cleaning * adding test case * adding new test case * fixing parallel_regression test file * fixing paralllel regression test * fixing species_mixingmodel test case * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update SU2_CFD/include/fluid/CFluidScalar.hpp Co-authored-by: Pedro Gomes <[email protected]> * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * Update TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel.cfg Co-authored-by: Pedro Gomes <[email protected]> * adding option Wilke and Davidson Viscosity, adding suggestions * fixing SetDefaultIfEmpty function * fixing issues * changing vector by arrays in WILKE and Davidson models * fixing test case species2_primitiveVenturi_mixingmodel.cfg * fixing test case species2_primitiveVenturi_mixingmodel.cfg * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * reverting changes and adding default values * Update Common/src/CConfig.cpp Co-authored-by: Pedro Gomes <[email protected]> * adding condition * minor modifications test case * virtual function * fixing regression test mixing models * Revert "fixing regression test mixing models" This reverts commit eb75820. * fixing test case mixingmodel_viscosity * fixing Kt * cleanup * fixes * reduce virtual functions * fixing residuals minxingmodel test case * removing file CDiffusivityModel.hpp * test reason for changes * restore Sutherland 1/t change and update regressions * fixing possible error with Thermal_Conductivity_Ref * Revert "fixing possible error with Thermal_Conductivity_Ref" This reverts commit 6e5c4c2. Co-authored-by: Nijso <[email protected]> Co-authored-by: Pedro Gomes <[email protected]> Co-authored-by: TobiKattmann <[email protected]> Co-authored-by: Pedro Gomes <[email protected]>
1 parent 0490bdb commit 1025b8b

27 files changed

+736
-558
lines changed

Common/include/CConfig.hpp

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ class CConfig {
481481
INC_DENSITYMODEL Kind_DensityModel; /*!< \brief Kind of the density model for incompressible flows. */
482482
CHT_COUPLING Kind_CHT_Coupling; /*!< \brief Kind of coupling method used at CHT interfaces. */
483483
VISCOSITYMODEL Kind_ViscosityModel; /*!< \brief Kind of the Viscosity Model*/
484+
MIXINGVISCOSITYMODEL Kind_MixingViscosityModel; /*!< \brief Kind of the mixing Viscosity Model*/
484485
CONDUCTIVITYMODEL Kind_ConductivityModel; /*!< \brief Kind of the Thermal Conductivity Model */
485486
CONDUCTIVITYMODEL_TURB Kind_ConductivityModel_Turb; /*!< \brief Kind of the Turbulent Thermal Conductivity Model */
486487
DIFFUSIVITYMODEL Kind_Diffusivity_Model; /*!< \brief Kind of the mass diffusivity Model */
@@ -822,16 +823,18 @@ class CConfig {
822823
Pressure_Critical, /*!< \brief Critical Pressure for real fluid model. */
823824
Density_Critical, /*!< \brief Critical Density for real fluid model. */
824825
Acentric_Factor, /*!< \brief Acentric Factor for real fluid model. */
825-
Mu_Constant, /*!< \brief Constant viscosity for ConstantViscosity model. */
826-
Mu_ConstantND, /*!< \brief Non-dimensional constant viscosity for ConstantViscosity model. */
827-
Thermal_Conductivity_Constant, /*!< \brief Constant thermal conductivity for ConstantConductivity model. */
828-
Thermal_Conductivity_ConstantND, /*!< \brief Non-dimensional constant thermal conductivity for ConstantConductivity model. */
829-
Mu_Ref, /*!< \brief Reference viscosity for Sutherland model. */
830-
Mu_RefND, /*!< \brief Non-dimensional reference viscosity for Sutherland model. */
831-
Mu_Temperature_Ref, /*!< \brief Reference temperature for Sutherland model. */
832-
Mu_Temperature_RefND, /*!< \brief Non-dimensional reference temperature for Sutherland model. */
833-
Mu_S, /*!< \brief Reference S for Sutherland model. */
834-
Mu_SND; /*!< \brief Non-dimensional reference S for Sutherland model. */
826+
*Mu_Constant, /*!< \brief Constant viscosity for ConstantViscosity model. */
827+
*Thermal_Conductivity_Constant, /*!< \brief Constant thermal conductivity for ConstantConductivity model. */
828+
*Mu_Ref, /*!< \brief Reference viscosity for Sutherland model. */
829+
*Mu_Temperature_Ref, /*!< \brief Reference temperature for Sutherland model. */
830+
*Mu_S; /*!< \brief Reference S for Sutherland model. */
831+
unsigned short nMu_Constant, /*!< \brief Number of species constant viscosities. */
832+
nMu_Ref, /*!< \brief Number of species reference constants for Sutherland model. */
833+
nMu_Temperature_Ref, /*!< \brief Number of species reference temperature for Sutherland model. */
834+
nMu_S, /*!< \brief Number of species reference S for Sutherland model. */
835+
nThermal_Conductivity_Constant,/*!< \brief Number of species constant thermal conductivity. */
836+
nPrandtl_Lam, /*!< \brief Number of species laminar Prandtl number. */
837+
nPrandtl_Turb; /*!< \brief Number of species turbulent Prandtl number. */
835838
su2double Diffusivity_Constant; /*!< \brief Constant mass diffusivity for scalar transport. */
836839
su2double Diffusivity_ConstantND; /*!< \brief Non-dim. constant mass diffusivity for scalar transport. */
837840
su2double Schmidt_Number_Laminar; /*!< \brief Laminar Schmidt number for mass diffusion. */
@@ -861,8 +864,8 @@ class CConfig {
861864
wallModel_B, /*!< \brief constant B for turbulence wall modeling */
862865
wallModel_RelFac, /*!< \brief relaxation factor for the Newton method used in the wall model */
863866
wallModel_MinYplus; /*!< \brief minimum Y+ value, below which the wall model is not used anymore */
864-
su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number for the gas. */
865-
Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */
867+
su2double *Prandtl_Lam, /*!< \brief Laminar Prandtl number for the gas. */
868+
*Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */
866869
Length_Ref, /*!< \brief Reference length for non-dimensionalization. */
867870
Pressure_Ref, /*!< \brief Reference pressure for non-dimensionalization. */
868871
Temperature_Ref, /*!< \brief Reference temperature for non-dimensionalization.*/
@@ -1705,13 +1708,13 @@ class CConfig {
17051708
* \brief Get the value of the laminar Prandtl number.
17061709
* \return Laminar Prandtl number.
17071710
*/
1708-
su2double GetPrandtl_Lam(void) const { return Prandtl_Lam; }
1711+
su2double GetPrandtl_Lam(unsigned short val_index = 0) const { return Prandtl_Lam[val_index]; }
17091712

17101713
/*!
17111714
* \brief Get the value of the turbulent Prandtl number.
17121715
* \return Turbulent Prandtl number.
17131716
*/
1714-
su2double GetPrandtl_Turb(void) const { return Prandtl_Turb; }
1717+
su2double GetPrandtl_Turb(unsigned short val_index = 0) const { return Prandtl_Turb[val_index]; }
17151718

17161719
/*!
17171720
* \brief Get the value of the von Karman constant kappa for turbulence wall modeling.
@@ -3810,6 +3813,12 @@ class CConfig {
38103813
*/
38113814
VISCOSITYMODEL GetKind_ViscosityModel() const { return Kind_ViscosityModel; }
38123815

3816+
/*!
3817+
* \brief Get the value of the mixing model for viscosity.
3818+
* \return Mixing Viscosity model.
3819+
*/
3820+
MIXINGVISCOSITYMODEL GetKind_MixingViscosityModel() const { return Kind_MixingViscosityModel; }
3821+
38133822
/*!
38143823
* \brief Get the value of the thermal conductivity model.
38153824
* \return Conductivity model.
@@ -3826,25 +3835,29 @@ class CConfig {
38263835
* \brief Get the value of the constant viscosity.
38273836
* \return Constant viscosity.
38283837
*/
3829-
su2double GetMu_Constant(void) const { return Mu_Constant; }
3838+
su2double GetMu_Constant(unsigned short val_index = 0) const { return Mu_Constant[val_index]; }
38303839

38313840
/*!
38323841
* \brief Get the value of the non-dimensional constant viscosity.
38333842
* \return Non-dimensional constant viscosity.
38343843
*/
3835-
su2double GetMu_ConstantND(void) const { return Mu_ConstantND; }
3844+
su2double GetMu_ConstantND(unsigned short val_index = 0) const { return Mu_Constant[val_index] / Viscosity_Ref; }
38363845

38373846
/*!
38383847
* \brief Get the value of the thermal conductivity.
38393848
* \return Thermal conductivity.
38403849
*/
3841-
su2double GetThermal_Conductivity_Constant(void) const { return Thermal_Conductivity_Constant; }
3850+
su2double GetThermal_Conductivity_Constant(unsigned short val_index = 0) const {
3851+
return Thermal_Conductivity_Constant[val_index];
3852+
}
38423853

38433854
/*!
38443855
* \brief Get the value of the non-dimensional thermal conductivity.
38453856
* \return Non-dimensional thermal conductivity.
38463857
*/
3847-
su2double GetThermal_Conductivity_ConstantND(void) const { return Thermal_Conductivity_ConstantND; }
3858+
su2double GetThermal_Conductivity_ConstantND(unsigned short val_index = 0) const {
3859+
return Thermal_Conductivity_Constant[val_index] / Thermal_Conductivity_Ref;
3860+
}
38483861

38493862
/*!
38503863
* \brief Get the value of the constant mass diffusivity for scalar transport.
@@ -3874,37 +3887,39 @@ class CConfig {
38743887
* \brief Get the value of the reference viscosity for Sutherland model.
38753888
* \return The reference viscosity.
38763889
*/
3877-
su2double GetMu_Ref(void) const { return Mu_Ref; }
3890+
su2double GetMu_Ref(unsigned short val_index = 0) const { return Mu_Ref[val_index]; }
38783891

38793892
/*!
38803893
* \brief Get the value of the non-dimensional reference viscosity for Sutherland model.
38813894
* \return The non-dimensional reference viscosity.
38823895
*/
3883-
su2double GetMu_RefND(void) const { return Mu_RefND; }
3896+
su2double GetMu_RefND(unsigned short val_index = 0) const { return Mu_Ref[val_index] / Viscosity_Ref; }
38843897

38853898
/*!
38863899
* \brief Get the value of the reference temperature for Sutherland model.
38873900
* \return The reference temperature.
38883901
*/
3889-
su2double GetMu_Temperature_Ref(void) const { return Mu_Temperature_Ref; }
3902+
su2double GetMu_Temperature_Ref(unsigned short val_index = 0) const { return Mu_Temperature_Ref[val_index]; }
38903903

38913904
/*!
38923905
* \brief Get the value of the non-dimensional reference temperature for Sutherland model.
38933906
* \return The non-dimensional reference temperature.
38943907
*/
3895-
su2double GetMu_Temperature_RefND(void) const { return Mu_Temperature_RefND; }
3908+
su2double GetMu_Temperature_RefND(unsigned short val_index = 0) const {
3909+
return Mu_Temperature_Ref[val_index] / Temperature_Ref;
3910+
}
38963911

38973912
/*!
38983913
* \brief Get the value of the reference S for Sutherland model.
38993914
* \return The reference S.
39003915
*/
3901-
su2double GetMu_S(void) const { return Mu_S; }
3916+
su2double GetMu_S(unsigned short val_index = 0) const { return Mu_S[val_index]; }
39023917

39033918
/*!
39043919
* \brief Get the value of the non-dimensional reference S for Sutherland model.
39053920
* \return The non-dimensional reference S.
39063921
*/
3907-
su2double GetMu_SND(void) const { return Mu_SND; }
3922+
su2double GetMu_SND(unsigned short val_index = 0) const { return Mu_S[val_index] / Temperature_Ref; }
39083923

39093924
/*!
39103925
* \brief Get the number of coefficients in the temperature polynomial models.
@@ -3966,31 +3981,6 @@ class CConfig {
39663981
*/
39673982
const su2double* GetKt_PolyCoeffND(void) const { return KtPolyCoefficientsND.data(); }
39683983

3969-
/*!
3970-
* \brief Set the value of the non-dimensional constant viscosity.
3971-
*/
3972-
void SetMu_ConstantND(su2double mu_const) { Mu_ConstantND = mu_const; }
3973-
3974-
/*!
3975-
* \brief Set the value of the non-dimensional thermal conductivity.
3976-
*/
3977-
void SetThermal_Conductivity_ConstantND(su2double therm_cond_const) { Thermal_Conductivity_ConstantND = therm_cond_const; }
3978-
3979-
/*!
3980-
* \brief Set the value of the non-dimensional reference viscosity for Sutherland model.
3981-
*/
3982-
void SetMu_RefND(su2double mu_ref) { Mu_RefND = mu_ref; }
3983-
3984-
/*!
3985-
* \brief Set the value of the non-dimensional reference temperature for Sutherland model.
3986-
*/
3987-
void SetMu_Temperature_RefND(su2double mu_Tref) { Mu_Temperature_RefND = mu_Tref; }
3988-
3989-
/*!
3990-
* \brief Set the value of the non-dimensional S for Sutherland model.
3991-
*/
3992-
void SetMu_SND(su2double mu_s) { Mu_SND = mu_s; }
3993-
39943984
/*!
39953985
* \brief Set the temperature polynomial coefficient for specific heat Cp.
39963986
* \param[in] val_coeff - Temperature polynomial coefficient for specific heat Cp.

Common/include/option_structure.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,18 @@ static const MapType<std::string, VISCOSITYMODEL> ViscosityModel_Map = {
677677
MakePair("POLYNOMIAL_VISCOSITY", VISCOSITYMODEL::POLYNOMIAL)
678678
};
679679

680+
/*!
681+
* \brief Types of Mixing viscosity model
682+
*/
683+
enum class MIXINGVISCOSITYMODEL {
684+
WILKE, /*!< \brief Wilke mixing viscosity model. */
685+
DAVIDSON, /*!< \brief Davidson mixing viscosity model. */
686+
};
687+
static const MapType<std::string, MIXINGVISCOSITYMODEL> MixingViscosityModel_Map = {
688+
MakePair("WILKE", MIXINGVISCOSITYMODEL::WILKE)
689+
MakePair("DAVIDSON", MIXINGVISCOSITYMODEL::DAVIDSON)
690+
};
691+
680692
/*!
681693
* \brief Types of thermal conductivity model
682694
*/

0 commit comments

Comments
 (0)