Skip to content

Commit

Permalink
Merge branch 'development' into explicit_MOST
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Mar 12, 2024
2 parents 5137d4e + 78370fd commit c5e461f
Show file tree
Hide file tree
Showing 17 changed files with 502 additions and 218 deletions.
1 change: 1 addition & 0 deletions Exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ else ()
add_subdirectory(DevTests/MetGrid)
add_subdirectory(DevTests/LandSurfaceModel)
add_subdirectory(DevTests/TemperatureSource)
add_subdirectory(DevTests/Bomex)
endif()
2 changes: 1 addition & 1 deletion Exec/DevTests/Bomex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(erf_exe_name erf_abl_with_temperature_source)
set(erf_exe_name erf_bomex)

add_executable(${erf_exe_name} "")
target_sources(${erf_exe_name}
Expand Down
7 changes: 6 additions & 1 deletion Exec/DevTests/Bomex/input_SAM
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ erf.plot_vars_1 = density rhotheta x_velocity y_velocity z_velocity pressure
# SOLVER CHOICE
erf.alpha_T = 0.0
erf.alpha_C = 1.0
erf.use_gravity = false
erf.use_gravity = true

erf.moisture_model = "SAM"

Expand All @@ -56,6 +56,7 @@ erf.init_sounding_ideal = true

erf.add_custom_rhotheta_forcing = true
erf.add_custom_moisture_forcing = true
erf.add_custom_w_subsidence = true
erf.custom_forcing_uses_primitive_vars = false

# Higher values of perturbations lead to instability
Expand All @@ -75,3 +76,7 @@ prob.source_cutoff_transition = 3000.0
prob.advection_moisture_rate = -1.2E-8
prob.moisture_source_cutoff = 300.0
prob.moisture_source_cutoff_transition = 500.0

prob.wbar_sub_max = -0.65
prob.wbar_cutoff_max = 1500.0
prob.wbar_cutoff_min = 2100.0
99 changes: 55 additions & 44 deletions Exec/DevTests/Bomex/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,54 @@
#include "prob_common.H"

struct ProbParm : ProbParmDefaults {
amrex::Real rho_0 = 0.0;
amrex::Real T_0 = 0.0;
amrex::Real A_0 = 1.0;
amrex::Real QKE_0 = 0.1;

amrex::Real U_0 = 0.0;
amrex::Real V_0 = 0.0;
amrex::Real W_0 = 0.0;

// random initial perturbations (legacy code)
amrex::Real U_0_Pert_Mag = 0.0;
amrex::Real V_0_Pert_Mag = 0.0;
amrex::Real W_0_Pert_Mag = 0.0;
amrex::Real T_0_Pert_Mag = 0.0; // perturbation to rho*Theta

// divergence-free initial perturbations
amrex::Real pert_deltaU = 0.0;
amrex::Real pert_deltaV = 0.0;
amrex::Real pert_periods_U = 5.0;
amrex::Real pert_periods_V = 5.0;
amrex::Real pert_ref_height = 100.0;

// rayleigh damping
amrex::Real dampcoef = 0.2; // inverse time scale [1/s]
amrex::Real zdamp = 500.0; // damping depth [m] from model top

//==============================================
// USER-DEFINED INPUTS
// source terms
amrex::Real advection_heating_rate = 0.0;
amrex::Real restart_time = 9e9;
amrex::Real cutoff = 500.0;
amrex::Real cutoff_transition = 50.0;

amrex::Real advection_moisture_rate = 0.0;
amrex::Real moisture_cutoff = 500.0;
amrex::Real moisture_cutoff_transition = 50.0;
//==============================================

// helper vars
amrex::Real aval;
amrex::Real bval;
amrex::Real ufac;
amrex::Real vfac;
amrex::Real rho_0 = 0.0;
amrex::Real T_0 = 0.0;
amrex::Real A_0 = 1.0;
amrex::Real QKE_0 = 0.1;

amrex::Real U_0 = 0.0;
amrex::Real V_0 = 0.0;
amrex::Real W_0 = 0.0;

// random initial perturbations (legacy code)
amrex::Real U_0_Pert_Mag = 0.0;
amrex::Real V_0_Pert_Mag = 0.0;
amrex::Real W_0_Pert_Mag = 0.0;
amrex::Real T_0_Pert_Mag = 0.0; // perturbation to rho*Theta

// divergence-free initial perturbations
amrex::Real pert_deltaU = 0.0;
amrex::Real pert_deltaV = 0.0;
amrex::Real pert_periods_U = 5.0;
amrex::Real pert_periods_V = 5.0;
amrex::Real pert_ref_height = 100.0;

// rayleigh damping
amrex::Real dampcoef = 0.2; // inverse time scale [1/s]
amrex::Real zdamp = 500.0; // damping depth [m] from model top

//==============================================
// USER-DEFINED INPUTS
// source terms
amrex::Real advection_heating_rate = 0.0;
amrex::Real restart_time = 9e9;
amrex::Real cutoff = 500.0;
amrex::Real cutoff_transition = 50.0;

amrex::Real advection_moisture_rate = 0.0;
amrex::Real moisture_cutoff = 500.0;
amrex::Real moisture_cutoff_transition = 50.0;

amrex::Real wbar_sub_max = -0.65;
amrex::Real wbar_cutoff_max = 1500.0;
amrex::Real wbar_cutoff_min = 2100.0;
//==============================================

// helper vars
amrex::Real aval;
amrex::Real bval;
amrex::Real ufac;
amrex::Real vfac;
}; // namespace ProbParm

class Problem : public ProblemBase
Expand Down Expand Up @@ -95,6 +99,13 @@ public:
const amrex::Geometry& geom,
std::unique_ptr<amrex::MultiFab>& z_phys_cc) override;

void update_w_subsidence (
const amrex::Real& /*time*/,
amrex::Vector<amrex::Real>& wbar,
amrex::Gpu::DeviceVector<amrex::Real>& d_wbar,
const amrex::Geometry& geom,
std::unique_ptr<amrex::MultiFab>& z_phys_cc) override;

protected:
std::string name () override { return "BOMEX"; }

Expand Down
Loading

0 comments on commit c5e461f

Please sign in to comment.