Composition-dependent density model for variable density incompressible flow by Cristopher-Morales · Pull Request #1620 · su2code/SU2 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
8a21ffc
13-04-2022 adding FUID_MIXTURE
Apr 13, 2022
114d616
update thursday 14-04-2022
Apr 14, 2022
7b07934
21-04-2022 CFluiscalar based on IncIdealGas
Apr 21, 2022
5c42c60
21-04-2022 adding viscosity and thermal conductivity
Apr 21, 2022
cf9e8f5
22-04-2022 compiles and run for more than one species, but still not …
Apr 22, 2022
8ad117d
mixing density working 26-04-22
Apr 26, 2022
9fb5a44
29-04-2022 cleaning up and compiling
Apr 29, 2022
c970543
29-04-22
Apr 29, 2022
e8d75bc
Merge branch 'develop' into feature_mixturedensity
bigfooted Apr 30, 2022
5932361
Update Common/src/CConfig.cpp
Cristopher-Morales May 10, 2022
5bd4b96
Update Common/include/CConfig.hpp
Cristopher-Morales May 10, 2022
8e8a71d
10-05-2022 fix comments
May 10, 2022
095c649
Merge branch 'feature_mixturedensity' of https://github.com/su2code/S…
May 10, 2022
750fe43
Merge branch 'develop' into feature_mixturedensity
May 10, 2022
69ba724
10-05-2022 removingSchmidth files
May 10, 2022
f49c522
10-05-2022 checking density model
May 10, 2022
cc1b1bd
Update Common/include/CConfig.hpp
Cristopher-Morales May 13, 2022
b44f2a1
Update Common/include/option_structure.hpp
Cristopher-Morales May 13, 2022
37ee38b
Update Common/src/CConfig.cpp
Cristopher-Morales May 13, 2022
9b77e36
Update Common/src/CConfig.cpp
Cristopher-Morales May 13, 2022
9b776bb
Update SU2_CFD/include/fluid/CDiffusivityModel.hpp
Cristopher-Morales May 13, 2022
494aa70
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
Cristopher-Morales May 13, 2022
9975371
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
Cristopher-Morales May 13, 2022
f168611
Update SU2_CFD/src/variables/CIncNSVariable.cpp
Cristopher-Morales May 13, 2022
67a8f29
Update SU2_CFD/src/variables/CIncNSVariable.cpp
Cristopher-Morales May 13, 2022
ee67187
13-05-2022 cleaning
May 13, 2022
ce36ac6
13-05-2022 Cleaning
May 13, 2022
779069d
Update SU2_CFD/include/fluid/CDiffusivityModel.hpp
Cristopher-Morales May 19, 2022
790293f
Update SU2_CFD/include/fluid/CDiffusivityModel.hpp
Cristopher-Morales May 19, 2022
b6969ab
Update SU2_CFD/include/fluid/CFluidScalar.hpp
Cristopher-Morales May 19, 2022
bbf8d9c
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 19, 2022
0ee2f69
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 19, 2022
e29304c
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 19, 2022
91044a7
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 19, 2022
231aff8
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales May 19, 2022
bc89e4b
Update SU2_CFD/include/fluid/CFluidScalar.hpp
Cristopher-Morales May 19, 2022
38796a8
Update SU2_CFD/include/fluid/CFluidScalar.hpp
Cristopher-Morales May 19, 2022
af85f27
Update SU2_CFD/include/fluid/CFluidScalar.hpp
Cristopher-Morales May 19, 2022
7be74f1
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 19, 2022
aaac72a
23-05-22 removing include not needed
May 23, 2022
87fd098
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales May 23, 2022
056374c
24-05-2022 adding parallel_regression test
May 24, 2022
8e7aef6
removing comment
May 24, 2022
5012abd
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales May 24, 2022
441071d
merge with develop
May 24, 2022
961f2f1
removing unnecesary variables
May 24, 2022
0bf3bab
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales May 25, 2022
fb71656
Update Common/src/CConfig.cpp
Cristopher-Morales May 25, 2022
e475757
Update Common/src/CConfig.cpp
Cristopher-Morales May 28, 2022
f34209c
Update Common/include/CConfig.hpp
Cristopher-Morales May 28, 2022
a3e369a
Update Common/include/CConfig.hpp
Cristopher-Morales May 28, 2022
0661b4c
Update Common/include/CConfig.hpp
Cristopher-Morales May 28, 2022
70be9d0
Update Common/include/option_structure.hpp
Cristopher-Morales May 28, 2022
b5f5d5d
cleaning Csolverfactory
May 30, 2022
5f1be93
cleaning solver
May 30, 2022
389cb0a
Update Common/src/CConfig.cpp
Cristopher-Morales May 30, 2022
fca4b85
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 30, 2022
871fcb7
Update SU2_CFD/src/solvers/CIncEulerSolver.cpp
Cristopher-Morales May 30, 2022
0d9690e
Update SU2_CFD/src/solvers/CIncEulerSolver.cpp
Cristopher-Morales May 30, 2022
2565f85
Update SU2_CFD/include/fluid/CFluidModel.hpp
Cristopher-Morales May 30, 2022
d3d8844
Update SU2_CFD/src/solvers/CIncEulerSolver.cpp
Cristopher-Morales May 30, 2022
9dbc223
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales May 30, 2022
60ed912
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales May 30, 2022
99a207b
cleaning CfluidScalar .hpp and .cpp
May 30, 2022
4f4ba9b
fixing clang-format
May 30, 2022
1809c3c
fixing test case parallel_regression
May 31, 2022
f024fcb
test case fixed
May 31, 2022
5573caf
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales Jun 1, 2022
95ba0b8
clang-formatfluidmodel and fluidscalar
Jun 1, 2022
f940292
clang-format fluidmodel and scalar
Jun 1, 2022
5258f42
removing bools wilke and davidson
Jun 1, 2022
a2f682e
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales Jun 7, 2022
98c61f0
adding explanaction test and config_template.cfg files
Jun 7, 2022
9dd6ea1
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales Jun 8, 2022
2b048b1
removing CDiffusivityModel.hpp file
Jun 9, 2022
83ab514
Update SU2_CFD/include/fluid/CFluidScalar.hpp
Cristopher-Morales Jun 10, 2022
5281887
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales Jun 10, 2022
7344cba
Update Common/include/CConfig.hpp
Cristopher-Morales Jun 10, 2022
4776aec
Update Common/include/CConfig.hpp
Cristopher-Morales Jun 10, 2022
0e404e3
clang-format
Jun 13, 2022
d593eb3
Update TestCases/parallel_regression.py
Cristopher-Morales Jun 16, 2022
3a73f6d
Update TestCases/species_transport/venturi_primitive_3species/species…
Cristopher-Morales Jun 16, 2022
2c0d6c1
Merge branch 'develop' into feature_mixturedensity
Cristopher-Morales Jun 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Common/include/CConfig.hpp
4 changes: 3 additions & 1 deletion Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ enum ENUM_FLUIDMODEL {
INC_IDEAL_GAS = 5, /*!< \brief Incompressible ideal gas model. */
INC_IDEAL_GAS_POLY = 6, /*!< \brief Inc. ideal gas, polynomial gas model. */
MUTATIONPP = 7, /*!< \brief Mutation++ gas model for nonequilibrium flow. */
SU2_NONEQ = 8 /*!< \brief User defined gas model for nonequilibrium flow. */
SU2_NONEQ = 8, /*!< \brief User defined gas model for nonequilibrium flow. */
FLUID_MIXTURE = 9, /*!< \brief Species mixture model. */
};
static const MapType<std::string, ENUM_FLUIDMODEL> FluidModel_Map = {
MakePair("STANDARD_AIR", STANDARD_AIR)
Expand All @@ -579,6 +580,7 @@ static const MapType<std::string, ENUM_FLUIDMODEL> FluidModel_Map = {
MakePair("INC_IDEAL_GAS_POLY", INC_IDEAL_GAS_POLY)
MakePair("MUTATIONPP", MUTATIONPP)
MakePair("SU2_NONEQ", SU2_NONEQ)
MakePair("FLUID_MIXTURE", FLUID_MIXTURE)
};

/*!
Expand Down
41 changes: 35 additions & 6 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,15 +1050,14 @@ void CConfig::SetPointersNull(void) {

Time_Ref = 1.0;

Delta_UnstTime = 0.0;
Delta_UnstTime = 0.0;
Delta_UnstTimeND = 0.0;
Total_UnstTime = 0.0;
Total_UnstTime = 0.0;
Total_UnstTimeND = 0.0;

Kind_TimeNumScheme = EULER_IMPLICIT;

Gas_Composition = nullptr;

}
Comment thread
TobiKattmann marked this conversation as resolved.

void CConfig::SetConfig_Options() {
Expand Down Expand Up @@ -1168,7 +1167,7 @@ void CConfig::SetConfig_Options() {
/*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/
addDoubleOption("THERMAL_EXPANSION_COEFF", Thermal_Expansion_Coeff, 0.00347);
/*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) default) \ingroup Config*/
addDoubleOption("MOLECULAR_WEIGHT", Molecular_Weight, 28.96);
addDoubleListOption("MOLECULAR_WEIGHT", nMolecular_Weight, Molecular_Weight);

///* DESCRIPTION: Specify if Mutation++ library is used */
/*--- Reading gas model as string or integer depending on TC library used. ---*/
Expand Down Expand Up @@ -3308,6 +3307,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
bool ideal_gas = ((Kind_FluidModel == STANDARD_AIR) ||
(Kind_FluidModel == IDEAL_GAS) ||
(Kind_FluidModel == INC_IDEAL_GAS) ||
(Kind_FluidModel == FLUID_MIXTURE) ||
(Kind_FluidModel == INC_IDEAL_GAS_POLY) ||
(Kind_FluidModel == CONSTANT_DENSITY));
bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) ||
Expand Down Expand Up @@ -3741,6 +3741,35 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
}
}

/*--- Set default values for various fluid properties. ---*/

const su2double Molecular_Weight_Default = 28.96;

if (Molecular_Weight == nullptr) {
Molecular_Weight = new su2double[1];
Molecular_Weight[0] = Molecular_Weight_Default;
nMolecular_Weight = 1;
}

/*--- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/

if (Kind_FluidModel == FLUID_MIXTURE) {
/*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar
equations solved + 1. nMolecular_Weight is used because it is required for the fluid mixing models. --- */
if (nMolecular_Weight != nSpecies_Init + 1) {
SU2_MPI::Error(
"The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT\n"
"to be equal to the number of entries of SCALAR_INIT + 1",
CURRENT_FUNCTION);
}
/*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be
VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density and
it will remain constant through the complete domain. --- */
if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) {
SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", CURRENT_FUNCTION);
}
}

/*--- Overrule the default values for viscosity if the US measurement system is used. ---*/

if (SystemMeasurements == US) {
Expand Down Expand Up @@ -4725,7 +4754,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
}

if (Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) {
if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY) {
if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY && Kind_FluidModel != FLUID_MIXTURE) {
SU2_MPI::Error("Variable density incompressible solver limited to ideal gases.\n Check the fluid model options (use INC_IDEAL_GAS, INC_IDEAL_GAS_POLY).", CURRENT_FUNCTION);
}
}
Expand All @@ -4738,7 +4767,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i

if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) {
if (Kind_ViscosityModel == VISCOSITYMODEL::SUTHERLAND) {
if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY)) {
if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY) && (Kind_FluidModel != FLUID_MIXTURE)) {
SU2_MPI::Error("Sutherland's law only valid for ideal gases in incompressible flows.\n Must use VISCOSITY_MODEL=CONSTANT_VISCOSITY and set viscosity with\n MU_CONSTANT, or use DENSITY_MODEL= VARIABLE with FLUID_MODEL= INC_IDEAL_GAS or INC_IDEAL_GAS_POLY for VISCOSITY_MODEL=SUTHERLAND.\n NOTE: FREESTREAM_VISCOSITY is no longer used for incompressible flows!", CURRENT_FUNCTION);
}
}
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/fluid/CConstantDensity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CConstantDensity final : public CFluidModel {
* \brief Set the Dimensionless State using Temperature.
* \param[in] t - Temperature value at the point.
*/
void SetTDState_T(su2double t) override {
void SetTDState_T(su2double t, const su2double *val_scalars = nullptr) override {
/* Density is constant and thermodynamic pressure is
not required for incompressible, constant density flows,
but the energy equation can still be computed as a
Expand Down
23 changes: 19 additions & 4 deletions SU2_CFD/include/fluid/CFluidModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,26 @@ class CFluidModel {
*/
su2double GetCv() const { return Cv; }

/*!
* \brief Compute and return fluid mean molecular weight in kg/mol.
*/
template <class Vector_t>
static su2double ComputeMeanMolecularWeight(const Vector_t& molar_masses, const su2double* val_scalars) {
su2double OneOverMeanMolecularWeight = 0.0;
su2double val_scalars_sum = 0.0;

for (size_t i_scalar = 0; i_scalar < molar_masses.size() - 1; i_scalar++) {
OneOverMeanMolecularWeight += val_scalars[i_scalar] / (molar_masses[i_scalar] / 1000);
val_scalars_sum += val_scalars[i_scalar];
}
OneOverMeanMolecularWeight += (1 - val_scalars_sum) / (molar_masses[molar_masses.size() - 1] / 1000);
return 1 / OneOverMeanMolecularWeight;
}
Comment thread
Cristopher-Morales marked this conversation as resolved.
Comment thread
TobiKattmann marked this conversation as resolved.

/*!
* \brief Get fluid dynamic viscosity.
*/
su2double GetLaminarViscosity() {
inline su2double GetLaminarViscosity() {
LaminarViscosity->SetViscosity(Temperature, Density);
Mu = LaminarViscosity->GetViscosity();
LaminarViscosity->SetDerViscosity(Temperature, Density);
Expand All @@ -135,7 +151,7 @@ class CFluidModel {
* \brief Get fluid thermal conductivity.
*/

su2double GetThermalConductivity() {
inline su2double GetThermalConductivity() {
ThermalConductivity->SetConductivity(Temperature, Density, Mu, Mu_Turb, Cp);
Kt = ThermalConductivity->GetConductivity();
ThermalConductivity->SetDerConductivity(Temperature, Density, dmudrho_T, dmudT_rho, Cp);
Expand Down Expand Up @@ -291,11 +307,10 @@ class CFluidModel {
* \brief Virtual member.
* \param[in] T - Temperature value at the point.
*/
virtual void SetTDState_T(su2double val_Temperature) {}
virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) {}

/*!
* \brief Set fluid eddy viscosity provided by a turbulence model needed for computing effective thermal conductivity.
*/
void SetEddyViscosity(su2double val_Mu_Turb) { Mu_Turb = val_Mu_Turb; }

};
59 changes: 59 additions & 0 deletions SU2_CFD/include/fluid/CFluidScalar.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*!
* \file CFluidScalar.hpp
* \brief Defines the multicomponent incompressible Ideal Gas model for mixtures.
* \author T. Economon, Mark Heimgartner, Cristopher Morales Ubal
* \version 7.3.1 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once
#include <memory>
#include <vector>

#include "CFluidModel.hpp"

/*!
* \class CFluidScalar
* \brief Child class for defining an incompressible ideal gas model.
* \author: T. Economon
*/
class CFluidScalar final : public CFluidModel {
private:
unsigned short n_species_mixture; /*!< \brief Number of species in mixture. */
su2double Gas_Constant; /*!< \brief Specific gas constant. */
su2double Gamma; /*!< \brief Ratio of specific heats of the gas. */
su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */

std::vector<su2double> molarMasses; /*!< \brief Molar masses of all species. */

public:
/*!
* \brief Constructor of the class.
*/
CFluidScalar(su2double val_Cp, su2double val_gas_constant, su2double val_operating_pressure, CConfig* config);

/*!
* \brief Set the Dimensionless State using Temperature.
* \param[in] t - Temperature value at the point.
*/
void SetTDState_T(su2double val_temperature, const su2double* val_scalars) override;
};
2 changes: 1 addition & 1 deletion SU2_CFD/include/fluid/CIncIdealGas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CIncIdealGas final : public CFluidModel {
* \brief Set the Dimensionless State using Temperature.
* \param[in] t - Temperature value at the point.
*/
void SetTDState_T(su2double t) override {
void SetTDState_T(su2double t, const su2double *val_scalars = nullptr) override {
/*--- The EoS only depends upon temperature. ---*/
Temperature = t;
Density = Pressure / (Temperature * Gas_Constant);
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CIncIdealGasPolynomial final : public CFluidModel {
* \brief Set the Dimensionless State using Temperature.
* \param[in] t - Temperature value at the point.
*/
void SetTDState_T(su2double t) override {
void SetTDState_T(su2double t, const su2double *val_scalars = nullptr) override {
/* The EoS only depends upon temperature. */
Temperature = t;
Density = Pressure / (Temperature * Gas_Constant);
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/variables/CIncNSVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class CIncNSVariable final : public CIncEulerVariable {
/*!
* \brief Set all the primitive variables for incompressible flows
*/
bool SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel) override;
bool SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel, const su2double *scalar = nullptr);
using CVariable::SetPrimVar;

/*!
Expand Down
1 change: 1 addition & 0 deletions SU2_CFD/obj/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ endif
libSU2Core_sources = ../src/definition_structure.cpp \
../src/fluid/CFluidModel.cpp \
../src/fluid/CIdealGas.cpp \
../src/fluid/CFluidScalar.cpp \
../src/fluid/CPengRobinson.cpp \
../src/fluid/CVanDerWaalsGas.cpp \
../src/fluid/CNEMOGas.cpp \
Expand Down
6 changes: 4 additions & 2 deletions SU2_CFD/src/fluid/CFluidModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/fluid/CFluidModel.hpp"

#include <utility>

#include "../../include/fluid/CFluidModel.hpp"
#include "../../include/fluid/CConstantConductivity.hpp"
#include "../../include/fluid/CConstantConductivityRANS.hpp"
#include "../../include/fluid/CConstantPrandtl.hpp"
Expand Down Expand Up @@ -61,7 +62,8 @@ void CFluidModel::SetThermalConductivityModel(const CConfig* config) {
ThermalConductivity = unique_ptr<CConstantConductivityRANS>(
new CConstantConductivityRANS(config->GetThermal_Conductivity_ConstantND(), config->GetPrandtl_Turb()));
} else {
ThermalConductivity = unique_ptr<CConstantConductivity>(new CConstantConductivity(config->GetThermal_Conductivity_ConstantND()));
ThermalConductivity =
unique_ptr<CConstantConductivity>(new CConstantConductivity(config->GetThermal_Conductivity_ConstantND()));
}
break;
case CONDUCTIVITYMODEL::CONSTANT_PRANDTL:
Expand Down
60 changes: 60 additions & 0 deletions SU2_CFD/src/fluid/CFluidScalar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*!
* \file CFluidScalar.hpp
* \brief Defines the multicomponent incompressible Ideal Gas model for mixtures.
* \author T. Economon, Mark Heimgartner, Cristopher Morales Ubal
* \version 7.3.1 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/fluid/CFluidScalar.hpp"

#include <math.h>

#include <cmath>
#include <iostream>
#include <numeric>
#include <vector>

CFluidScalar::CFluidScalar(su2double val_Cp, su2double val_gas_constant, const su2double value_pressure_operating,
CConfig* config)
: CFluidModel() {
n_species_mixture = config->GetnSpecies() + 1;

molarMasses.resize(n_species_mixture);

for (int iVar = 0; iVar < n_species_mixture; iVar++) {
molarMasses[iVar] = config->GetMolecular_Weight(iVar);
}

Pressure_Thermodynamic = value_pressure_operating;
Gas_Constant = val_gas_constant;
Gamma = 1.0;
Cp = val_Cp;
Cv = Cp;
SetLaminarViscosityModel(config);
SetThermalConductivityModel(config);
}

void CFluidScalar::SetTDState_T(su2double val_temperature, const su2double* val_scalars) {
const su2double MeanMolecularWeight = ComputeMeanMolecularWeight(molarMasses, val_scalars);
Density = Pressure_Thermodynamic / ((val_temperature * UNIVERSAL_GAS_CONSTANT / MeanMolecularWeight));
}
1 change: 1 addition & 0 deletions SU2_CFD/src/meson.build
Loading