Skip to content

Commit

Permalink
Implemented density calculation according to ideal gas law in flamele…
Browse files Browse the repository at this point in the history
…t fluid model
  • Loading branch information
EvertBunschoten committed Jan 3, 2023
1 parent ddea89e commit 19e2699
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
29 changes: 15 additions & 14 deletions SU2_CFD/src/fluid/CFluidFlamelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ void CFluidFlamelet::SetTDState_T(su2double val_temperature, const su2double* va
/*--- add all quantities and their address to the look up vectors ---*/
look_up_table->LookUp_ProgEnth(varnames_TD, val_vars_TD, val_prog, val_enth, name_prog, name_enth);

/*--- compute density according to ideal gas law ---*/
Density = Pressure * (molar_weight / 1000.0) / (UNIVERSAL_GAS_CONSTANT * Temperature);

/*--- compute Cv from Cp and molar weight of the mixture (ideal gas) ---*/
Cv = Cp - UNIVERSAL_GAS_CONSTANT / molar_weight;
}
Expand Down Expand Up @@ -220,24 +223,22 @@ void CFluidFlamelet::PreprocessLookUp() {
/*--- Set lookup names and variables for all relevant lookup processes in the fluid model ---*/

/*--- Thermodynamic state variables ---*/
varnames_TD.resize(7);
val_vars_TD.resize(7);
varnames_TD.resize(6);
val_vars_TD.resize(6);

/*--- The string in varnames_TD is the actual string as it appears in the LUT file ---*/
varnames_TD[0] = "Temperature";
val_vars_TD[0] = &Temperature;
varnames_TD[1] = "Density";
val_vars_TD[1] = &Density;
varnames_TD[2] = "Cp";
val_vars_TD[2] = &Cp;
varnames_TD[3] = "ViscosityDyn";
val_vars_TD[3] = Μ
varnames_TD[4] = "Conductivity";
val_vars_TD[4] = &Kt;
varnames_TD[5] = "DiffusionCoefficient";
val_vars_TD[5] = &mass_diffusivity;
varnames_TD[6] = "MolarWeightMix";
val_vars_TD[6] = &molar_weight;
varnames_TD[1] = "Cp";
val_vars_TD[1] = &Cp;
varnames_TD[2] = "ViscosityDyn";
val_vars_TD[2] = Μ
varnames_TD[3] = "Conductivity";
val_vars_TD[3] = &Kt;
varnames_TD[4] = "DiffusionCoefficient";
val_vars_TD[4] = &mass_diffusivity;
varnames_TD[5] = "MolarWeightMix";
val_vars_TD[5] = &molar_weight;

/*--- Source term variables ---*/
varnames_Sources.resize(n_table_sources);
Expand Down
5 changes: 2 additions & 3 deletions SU2_CFD/src/solvers/CIncEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,10 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i

case FLUID_FLAMELET:

config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0));
Pressure_Thermodynamic = Density_FreeStream * Temperature_FreeStream * config->GetGas_Constant();
Pressure_Thermodynamic = config->GetPressure_Thermodynamic();
auxFluidModel = new CFluidFlamelet(config, Pressure_Thermodynamic);
auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init());
config->SetPressure_Thermodynamic(Pressure_Thermodynamic);
config->SetGas_Constant(Pressure_Thermodynamic / (Temperature_FreeStream * auxFluidModel->GetDensity()));

/*--- flamelet fluid model does not need to be redefined after nondimensionalization ---*/
redefine_fluid_model = false;
Expand Down
6 changes: 3 additions & 3 deletions TestCases/flamelet/laminar_premixed_flame/config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ MARKER_ANALYZE_AVERAGE = AREA
NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES
CFL_NUMBER =50.0
CFL_ADAPT= NO
ITER=30000
OUTPUT_WRT_FREQ= 500
ITER=2000
OUTPUT_WRT_FREQ= 200
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
%
LINEAR_SOLVER= FGMRES
Expand Down Expand Up @@ -125,7 +125,7 @@ OUTPUT_FILES = (RESTART,PARAVIEW)
TABULAR_FORMAT = CSV
CONV_FILENAME= history
RESTART_FILENAME= restart.dat
VOLUME_FILENAME= flow
VOLUME_FILENAME= flow_old
WRT_PERFORMANCE = YES
SCREEN_WRT_FREQ_INNER = 1
SCREEN_WRT_FREQ_OUTER = 1

0 comments on commit 19e2699

Please sign in to comment.