Skip to content
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

Fix shared wall-inlet corner node for compressible #2266

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
83e080c
fix corner node
bigfooted Apr 16, 2024
8624e0d
fix corner node temp and dens
bigfooted Apr 16, 2024
f4f8a2b
fix warning for temperature maybe used uninitialized
bigfooted Apr 16, 2024
4844ba9
move comment
bigfooted Apr 16, 2024
48cedf9
Merge branch 'develop' into fix_cornernode_comp
bigfooted Apr 18, 2024
0cb2f38
fix bounded scalar for compressible
bigfooted Apr 20, 2024
819b46c
fix bounded scalar for compressible
bigfooted Apr 20, 2024
c085155
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Apr 21, 2024
f693a01
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Apr 22, 2024
c472e98
Merge branch 'develop' into fix_cornernode_comp
bigfooted May 1, 2024
ad3b211
Merge branch 'develop' into fix_cornernode_comp
bigfooted May 13, 2024
f0248c1
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales May 14, 2024
120641d
Merge branch 'develop' into fix_cornernode_comp
bigfooted May 14, 2024
bcea781
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales May 16, 2024
93d4ffb
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales May 18, 2024
a0128be
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Jun 11, 2024
c30581e
Merge branch 'develop' into fix_cornernode_comp
bigfooted Jul 1, 2024
6c6e760
Merge branch 'develop' into fix_cornernode_comp
bigfooted Jul 16, 2024
02e0573
Merge branch 'develop' into fix_cornernode_comp
bigfooted Jul 24, 2024
7a5104d
update regression tests
bigfooted Aug 10, 2024
d179a4e
remove comments on compressible bounded scalar
bigfooted Aug 10, 2024
f4b9c55
merge develop
bigfooted Aug 10, 2024
1757060
update regression
bigfooted Aug 10, 2024
0d5fe9b
Merge branch 'develop' into fix_cornernode_comp
bigfooted Aug 10, 2024
0faa67e
update regression profile
bigfooted Aug 10, 2024
a070ab3
Merge branch 'develop' into fix_cornernode_comp
bigfooted Aug 22, 2024
48077f0
Update SU2_CFD/src/solvers/CEulerSolver.cpp
bigfooted Aug 27, 2024
4b13197
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Aug 29, 2024
f81246c
Merge branch 'develop' into fix_cornernode_comp
bigfooted Sep 15, 2024
bb45348
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Sep 21, 2024
56e1ce5
Merge branch 'develop' into fix_cornernode_comp
Cristopher-Morales Sep 23, 2024
9b1c0a5
Merge branch 'develop' into fix_cornernode_comp
bigfooted Sep 25, 2024
8c2ddea
Merge branch 'develop' into fix_cornernode_comp
bigfooted Oct 4, 2024
6ab0c5e
add message, add P and rho
bigfooted Oct 4, 2024
05acbd0
Merge branch 'fix_cornernode_comp' of https://github.com/su2code/su2 …
bigfooted Oct 4, 2024
b8a970a
update
bigfooted Oct 4, 2024
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
4 changes: 2 additions & 2 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5589,16 +5589,16 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
/*--- Define some variables for flamelet model. ---*/
if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) {
/*--- The controlling variables are progress variable, total enthalpy, and optionally mixture fraction ---*/
//n_control_vars = nSpecies - n_user_scalars;
if (n_control_vars != (nSpecies - n_user_scalars))
SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", CURRENT_FUNCTION);
SU2_MPI::Error("Number of initial species incompatible with number of controlling variables and user scalars.", CURRENT_FUNCTION);
/*--- We can have additional user defined transported scalars ---*/
n_scalars = n_control_vars + n_user_scalars;
}

if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE && GetBounded_Scalar()) {
SU2_MPI::Error("BOUNDED_SCALAR discretization can only be used for incompressible problems.", CURRENT_FUNCTION);
}

}

void CConfig::SetMarkers(SU2_COMPONENT val_software) {
Expand Down
71 changes: 67 additions & 4 deletions SU2_CFD/src/solvers/CEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6879,10 +6879,11 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
CConfig *config, unsigned short val_marker) {
unsigned short iDim;
unsigned long iVertex, iPoint;
su2double P_Total, T_Total, Velocity[MAXNDIM], Velocity2, H_Total, Temperature, Riemann,
su2double P_Total, T_Total, Velocity[MAXNDIM], Velocity2, H_Total, Riemann,
Pressure, Density, Energy, Flow_Dir[MAXNDIM], Mach2, SoundSpeed2, SoundSpeed_Total2, Vel_Mag,
alpha, aa, bb, cc, dd, Area, UnitNormal[MAXNDIM], Normal[MAXNDIM];
su2double *V_inlet, *V_domain;
su2double Temperature;

const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
const su2double Two_Gamma_M1 = 2.0 / Gamma_Minus_One;
Expand Down Expand Up @@ -6920,7 +6921,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,

V_domain = nodes->GetPrimitive(iPoint);

/*--- Build the fictitious intlet state based on characteristics ---*/
/*--- Build the fictitious inlet state based on characteristics ---*/


/*--- Subsonic inflow: there is one outgoing characteristic (u-c),
Expand Down Expand Up @@ -7095,8 +7096,8 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
if (tkeNeeded) Energy += GetTke_Inf();

/*--- Primitive variables, using the derived quantities ---*/

V_inlet[0] = Pressure / ( Gas_Constant * Density);
Temperature = Pressure / ( Gas_Constant * Density);
bigfooted marked this conversation as resolved.
Show resolved Hide resolved
V_inlet[0] = Temperature;
for (iDim = 0; iDim < nDim; iDim++)
V_inlet[iDim+1] = Vel_Mag*Flow_Dir[iDim];
V_inlet[nDim+1] = Pressure;
Expand All @@ -7110,6 +7111,68 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
break;
}

/*--- Check if the inlet node is shared with a viscous wall. ---*/

if (geometry->nodes->GetViscousBoundary(iPoint)) {

switch (Kind_Inlet) {

/*--- Total properties have been specified at the inlet. ---*/

case INLET_TYPE::TOTAL_CONDITIONS: {

/*--- Impose the wall velocity from the interior wall node. ---*/

Velocity2 = 0.0;
for (iDim = 0; iDim < nDim; iDim++) {
V_inlet[iDim+1] = nodes->GetVelocity(iPoint,iDim);
Velocity2 += V_inlet[iDim+1] * V_inlet[iDim+1];
}

/*--- Match the pressure, density and energy at the wall. ---*/

Pressure = nodes->GetPressure(iPoint);
Density = Pressure / (Gas_Constant * Temperature);
Energy = Pressure / (Density*Gamma_Minus_One) + 0.5 * Velocity2;

if (tkeNeeded) Energy += GetTke_Inf();

V_inlet[nDim+1] = Pressure;
V_inlet[nDim+2] = Density;
V_inlet[nDim+3] = Energy + Pressure / Density;
break;
}

case INLET_TYPE::MASS_FLOW: {

/*--- Impose the wall velocity from the interior wall node. ---*/

Velocity2 = 0.0;
for (iDim = 0; iDim < nDim; iDim++) {
V_inlet[iDim+1] = nodes->GetVelocity(iPoint,iDim);
Velocity2 += V_inlet[iDim+1] * V_inlet[iDim+1];
}

Pressure = nodes->GetPressure(iPoint);
Density = nodes->GetDensity(iPoint);
Temperature = Pressure / ( Gas_Constant * Density);
Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2;
if (tkeNeeded) Energy += GetTke_Inf();

V_inlet[0] = Temperature;
V_inlet[nDim+1] = Pressure;
V_inlet[nDim+2] = Density;
V_inlet[nDim+3] = Energy + Pressure / Density;

break;
}

default:
SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION);
break;

}
}
/*--- Set various quantities in the solver class ---*/

conv_numerics->SetPrimitive(V_domain, V_inlet);
Expand Down
4 changes: 2 additions & 2 deletions TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def main():
poiseuille_profile.cfg_dir = "navierstokes/poiseuille"
poiseuille_profile.cfg_file = "profile_poiseuille.cfg"
poiseuille_profile.test_iter = 10
poiseuille_profile.test_vals = [-12.485957, -7.612048, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.485957, -7.612048, -0.000000, 2.085796]
poiseuille_profile.test_vals = [-12.485991, -7.613038, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.494717, -7.711274, -0.000000, 2.085796]
test_list.append(poiseuille_profile)

# 2D Rotational Periodic
Expand Down
8 changes: 4 additions & 4 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def main():
flatplate_udobj.cfg_dir = "user_defined_functions"
flatplate_udobj.cfg_file = "lam_flatplate.cfg"
flatplate_udobj.test_iter = 20
flatplate_udobj.test_vals = [-6.664134, -1.190073, -0.954366, 0.000641, -0.000633, 0.000548, -0.001181, 596.940000, 300.020000, 296.920000, 22.201000, 0.525750, 37.278000, 2.347900]
flatplate_udobj.test_vals = [-6.663514, -1.189436, -0.954938, 0.000644, -0.000635, 0.000549, -0.001183, 596.930000, 300.010000, 296.920000, 22.187000, 0.527090, 37.284000, 2.354200]
test_list.append(flatplate_udobj)

# Laminar cylinder (steady)
Expand Down Expand Up @@ -344,8 +344,8 @@ def main():
poiseuille_profile.cfg_dir = "navierstokes/poiseuille"
poiseuille_profile.cfg_file = "profile_poiseuille.cfg"
poiseuille_profile.test_iter = 10
poiseuille_profile.test_vals = [-12.483967, -7.577331, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.483967, -7.577331, -0.000000, 2.085796]
poiseuille_profile.test_vals = [-12.483988, -7.577838, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.492864, -7.671632, -0.000000, 2.085796]
test_list.append(poiseuille_profile)

##########################
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def main():
flatplate_unsteady.cfg_dir = "navierstokes/flatplate"
flatplate_unsteady.cfg_file = "lam_flatplate_unst.cfg"
flatplate_unsteady.test_iter = 3
flatplate_unsteady.test_vals = [0.000008, -8.876477, -8.249920, -6.294138, -5.468911, -3.398657, 0.002075, -0.324341]
flatplate_unsteady.test_vals = [-8.876870, -8.250064, -6.293918, -5.469416, -3.398952, 0.002075, -0.324126]
flatplate_unsteady.unsteady = True
test_list.append(flatplate_unsteady)

Expand Down
2 changes: 1 addition & 1 deletion TestCases/parallel_regression_AD.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def main():
pywrapper_wavy_wall_steady.cfg_dir = "py_wrapper/wavy_wall"
pywrapper_wavy_wall_steady.cfg_file = "run_steady.py"
pywrapper_wavy_wall_steady.test_iter = 100
pywrapper_wavy_wall_steady.test_vals = [-1.360044, 2.580709, -2.892473]
pywrapper_wavy_wall_steady.test_vals = [-1.359409, 2.580816, -2.892697]
pywrapper_wavy_wall_steady.command = TestCase.Command("mpirun -n 2", "python", "run_steady.py")
pywrapper_wavy_wall_steady.timeout = 1600
pywrapper_wavy_wall_steady.tol = 0.00001
Expand Down
6 changes: 3 additions & 3 deletions TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def main():
poiseuille_profile.cfg_dir = "navierstokes/poiseuille"
poiseuille_profile.cfg_file = "profile_poiseuille.cfg"
poiseuille_profile.test_iter = 10
poiseuille_profile.test_vals = [-12.485974, -7.612341, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.485974, -7.612341, -0.000000, 2.085796]
poiseuille_profile.test_vals = [-12.485982, -7.613005, -0.000000, 2.085796]
poiseuille_profile.test_vals_aarch64 = [-12.494684, -7.711379, -0.000000, 2.085796] #last 4 columns
test_list.append(poiseuille_profile)

##########################
Expand Down Expand Up @@ -1614,7 +1614,7 @@ def main():
pywrapper_custom_inlet.cfg_dir = "py_wrapper/custom_inlet"
pywrapper_custom_inlet.cfg_file = "lam_flatplate.cfg"
pywrapper_custom_inlet.test_iter = 20
pywrapper_custom_inlet.test_vals = [-4.120494, -1.540195, -3.566114, 1.342509, -0.748827, 0.161349, -0.013214, 0.516000, -0.529220]
pywrapper_custom_inlet.test_vals = [-4.120437, -1.540129, -3.563086, 1.342567, -0.748783, 0.161976, -0.012959, 0.516320, -0.529280]
pywrapper_custom_inlet.command = TestCase.Command(exec = "python", param = "run.py")
pywrapper_custom_inlet.timeout = 1600
pywrapper_custom_inlet.tol = 0.0001
Expand Down