@@ -5672,7 +5672,8 @@ void CEulerSolver::PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNum
56725672 su2double Velocity2_i = GeometryToolbox::SquaredNorm (nDim, Velocity_i);
56735673 su2double Energy_i = nodes->GetEnergy (iPoint);
56745674 su2double StaticEnergy_i = Energy_i - 0.5 *Velocity2_i;
5675- GetFluidModel ()->SetTDState_rhoe (AverageDensity[iMarker][iSpan], StaticEnergy_i);
5675+ GetFluidModel ()->SetInitialDensity (AverageDensity[iMarker][iSpan]);
5676+ GetFluidModel ()->SetInitialEnergy (StaticEnergy_i);
56765677 }
56775678
56785679 ComputeTurboVelocity (Velocity_i, turboNormal, turboVelocity, marker_flag, config->GetKind_TurboMachinery (iZone));
@@ -7910,6 +7911,11 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C
79107911 /* --- Subsonic outlet ---*/
79117912
79127913 else {
7914+ /* Set initial guesses for density and static energy in case of data-driven fluid model. */
7915+ if (config->GetKind_FluidModel () == DATADRIVEN_FLUID) {
7916+ GetFluidModel ()->SetInitialDensity (config->GetDensity_Init_DataDriven ());
7917+ GetFluidModel ()->SetInitialEnergy (config->GetEnergy_Init_DataDriven ());
7918+ }
79137919
79147920 GetFluidModel ()->SetTDState_PT (P_static, T_static);
79157921 SoS_outlet = GetFluidModel ()->GetSoundSpeed ();
@@ -8440,6 +8446,11 @@ void CEulerSolver::SetFreeStream_TurboSolution(CConfig *config) {
84408446
84418447 auto turboNormal = config->GetFreeStreamTurboNormal ();
84428448
8449+ /* Set initial guess for static energy in case of data-driven fluid model. */
8450+ if (config->GetKind_FluidModel () == DATADRIVEN_FLUID) {
8451+ GetFluidModel ()->SetInitialEnergy (config->GetEnergy_Init_DataDriven ());
8452+ }
8453+
84438454 GetFluidModel ()->SetTDState_Prho (Pressure_Inf, Density_Inf);
84448455 SoundSpeed = GetFluidModel ()->GetSoundSpeed ();
84458456
@@ -8925,6 +8936,11 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC
89258936 AverageTurboNormal = geometry->GetAverageTurboNormal (iMarker,iSpan);
89268937 nVert = geometry->GetnTotVertexSpan (iMarker,iSpan);
89278938
8939+ /* Set initial guess for static energy in case of data-driven fluid model. */
8940+ if (config->GetKind_FluidModel () == DATADRIVEN_FLUID) {
8941+ GetFluidModel ()->SetInitialEnergy (config->GetEnergy_Init_DataDriven ());
8942+ }
8943+
89288944 /* --- compute normal Mach number as a check for massflow average and mixedout average ---*/
89298945 GetFluidModel ()->SetTDState_Prho (TotalAreaPressure/TotalArea, TotalAreaDensity / TotalArea);
89308946 soundSpeed = GetFluidModel ()->GetSoundSpeed ();
@@ -9244,6 +9260,11 @@ void CEulerSolver::MixedOut_Average (CConfig *config, su2double val_init_pressur
92449260
92459261 pressure_mix = val_init_pressure;
92469262
9263+ /* Set initial guess for static energy in case of data-driven fluid model. */
9264+ if (config->GetKind_FluidModel () == DATADRIVEN_FLUID) {
9265+ GetFluidModel ()->SetInitialEnergy (config->GetEnergy_Init_DataDriven ());
9266+ }
9267+
92479268 /* --- Newton-Raphson's method with central difference formula ---*/
92489269
92499270 while ( iter <= maxiter ) {
0 commit comments