Skip to content

Commit

Permalink
Enforce solvability AFTER multiplying rho0 for anelastic (Exawind#1513)
Browse files Browse the repository at this point in the history
  • Loading branch information
mukul1992 authored Mar 3, 2025
1 parent 41253bc commit 2606327
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
10 changes: 6 additions & 4 deletions amr-wind/projection/incflo_apply_nodal_projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,8 @@ void incflo::ApplyProjection(

// Need to apply custom Neumann funcs for inflow-outflow BC
// after setting the inflow vels above
// and then enforce solvability by matching outflow to inflow.
if (!proj_for_small_dt and !incremental and velocity.has_inout_bndry()) {
velocity.apply_bc_funcs(amr_wind::FieldState::New);

amr_wind::nodal_projection::enforce_inout_solvability(
velocity, m_repo.mesh().Geom(), m_repo.num_active_levels());
}

if (is_anelastic) {
Expand All @@ -338,6 +334,12 @@ void incflo::ApplyProjection(
}
}

// enforce solvability by matching outflow to inflow
if (!proj_for_small_dt and !incremental and velocity.has_inout_bndry()) {
amr_wind::nodal_projection::enforce_inout_solvability(
velocity, m_repo.mesh().Geom(), m_repo.num_active_levels());
}

amr_wind::MLMGOptions options("nodal_proj");

if (variable_density || mesh_mapping) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ ABL.bndry_file = "../abl_bndry_output_native/bndry_files"
ABL.bndry_io_mode = 1
ABL.bndry_var_names = velocity temperature
ABL.bndry_output_format = native

# Anelastic
ABL.anelastic = 1
ICNS.reconstruct_true_pressure = true
io.outputs = reference_density reference_pressure reference_temperature
incflo.constant_density = false

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
Expand All @@ -64,22 +71,24 @@ geometry.prob_hi = 1000. 1000. 1000. # Hi corner coordinates
geometry.is_periodic = 0 0 0 # Periodicity x y z (0/1)
# Boundary conditions
xlo.type = "mass_inflow_outflow"
xlo.density = 1.0
xlo.density_type = "zero_gradient"
xlo.temperature = 0.0

xhi.type = "mass_inflow_outflow"
xhi.density = 1.0
xhi.density_type = "zero_gradient"
xhi.temperature = 0.0

ylo.type = "mass_inflow_outflow"
ylo.density = 1.0
ylo.density_type = "zero_gradient"
ylo.temperature = 0.0

yhi.type = "mass_inflow_outflow"
yhi.density = 1.0
yhi.density_type = "zero_gradient"
yhi.temperature = 0.0

zlo.type = "wall_model"
zlo.density_type = "zero_gradient"

zhi.type = "slip_wall"
zhi.temperature_type = "fixed_gradient"
zhi.temperature = 0.0
Expand Down

0 comments on commit 2606327

Please sign in to comment.