Skip to content

Commit

Permalink
Fix physbc constructor with multilevel.
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi committed Jul 20, 2023
1 parent d4edcbd commit 7fe8cdf
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 18 deletions.
12 changes: 0 additions & 12 deletions Exec/RegTests/WitchOfAgnesi/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ erf.use_coriolis = false
erf.use_rayleigh_damping = false
erf.les_type = "None"

# MULTILEVEL
amr.max_level = 0
amr.ref_ratio_vect = 2 2 1

erf.refinement_indicators = box1
erf.box1.max_level = 1
erf.box1.in_box_lo = 2. 0.25
erf.box1.in_box_hi = 8. 0.75

# TERRRAIN GRID TYPE
erf.use_terrain = true
erf.terrain_smoothing = 0
Expand All @@ -69,9 +60,6 @@ erf.rho0_trans = 1.0 # [kg/m^3], used to convert input diffusivities
erf.dynamicViscosity = 0.0 # [kg/(m-s)] ==> nu = 75.0 m^2/s
erf.alpha_T = 0.0 # [m^2/s]

#erf.abl_driver_type = "PressureGradient"
#erf.abl_pressure_grad = -0.2 0. 0.

# PROBLEM PARAMETERS (optional)
prob.T_0 = 300.0
prob.U_0 = 0.0
Expand Down
70 changes: 70 additions & 0 deletions Exec/RegTests/WitchOfAgnesi/inputs_static_twolevel
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 1

amrex.fpe_trap_invalid = 1

fabarray.mfiter_tile_size = 1024 1024 1024

# PROBLEM SIZE & GEOMETRY
geometry.prob_lo = 0. 0. 0.
geometry.prob_hi = 10. 0.4 5.

amr.n_cell = 200 8 100

geometry.is_periodic = 1 1 0

zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

# TIME STEP CONTROL
erf.no_substepping = 1
erf.fixed_dt = 1E-5

# DIAGNOSTICS & VERBOSITY
erf.sum_interval = 1 # timesteps between computing mass
erf.v = 1 # verbosity in ERF.cpp
amr.v = 1 # verbosity in Amr.cpp

# REFINEMENT / REGRIDDING
amr.max_level = 1
amr.ref_ratio_vect = 3 3 1
erf.refinement_indicators = box1
erf.box1.max_level = 1
erf.box1.in_box_lo = 4. 0.
erf.box1.in_box_hi = 6. 0.4
erf.coupling_type = "OneWay"
erf.cf_width = 0
erf.cf_set_width = 0

# CHECKPOINT FILES
erf.check_file = chk # root name of checkpoint file
erf.check_int = -57600 # number of timesteps between checkpoints

# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 1 # number of timesteps between plotfiles
erf.plot_vars_1 = density x_velocity y_velocity z_velocity pressure theta pres_hse dens_hse pert_pres pert_dens z_phys detJ dpdx dpdy pres_hse_x pres_hse_y

# SOLVER CHOICE
erf.use_gravity = true
erf.use_coriolis = false
erf.use_rayleigh_damping = false
erf.les_type = "None"

# TERRRAIN GRID TYPE
erf.use_terrain = true
erf.terrain_smoothing = 0

# Diffusion coefficient from Straka, K = 75 m^2/s
erf.molec_diff_type = "Constant"
erf.rho0_trans = 1.0 # [kg/m^3], used to convert input diffusivities
erf.dynamicViscosity = 1.0 # [kg/(m-s)] ==> nu = 75.0 m^2/s
erf.alpha_T = 0.0 # [m^2/s]

erf.abl_driver_type = "PressureGradient"
erf.abl_pressure_grad = -0.2 0. 0.

# PROBLEM PARAMETERS (optional)
prob.T_0 = 300.0
prob.U_0 = 0.0
prob.rho_0 = 1.16
10 changes: 5 additions & 5 deletions Source/BoundaryConditions/ERF_PhysBCFunct.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public:
m_terrain_type(terrain_type),
m_bc_extdir_vals(bc_extdir_vals),
m_bc_neumann_vals(bc_neumann_vals),
m_z_phys_nd(z_phys_nd),
m_detJ_cc(detJ_cc)
{}
m_z_phys_nd(z_phys_nd.get()),
m_detJ_cc(detJ_cc.get())
{}

~ERFPhysBCFunct () {}

Expand Down Expand Up @@ -110,8 +110,8 @@ private:
int m_terrain_type;
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR> m_bc_extdir_vals;
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR> m_bc_neumann_vals;
std::unique_ptr<amrex::MultiFab>& m_z_phys_nd;
std::unique_ptr<amrex::MultiFab>& m_detJ_cc;
amrex::MultiFab* m_z_phys_nd;
amrex::MultiFab* m_detJ_cc;
};

#endif
1 change: 0 additions & 1 deletion Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,6 @@ ERF::ReadParameters ()
AMREX_ALWAYS_ASSERT(cf_width >= 0);
AMREX_ALWAYS_ASSERT(cf_set_width >= 0);
AMREX_ALWAYS_ASSERT(cf_width >= cf_set_width);
amrex::Print() << "READ CF params: " << cf_width << ' ' << cf_set_width << "\n";
}

#ifdef ERF_USE_MULTIBLOCK
Expand Down

0 comments on commit 7fe8cdf

Please sign in to comment.