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

Add a stiffer scalar advection version, convecting a Gaussian in a pe… #50

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 65 additions & 0 deletions Exec/RegTests/PeriodicCases/input.2d_CoTanHSAMR
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = 0.0 0.0 0.0 # x_lo y_lo (z_lo)
geometry.prob_hi = 1.0 1.0 1.0 # x_hi y_hi (z_hi)

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# Interior, Inflow, Outflow, Symmetry,
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm
peleLM.lo_bc = Interior Interior
peleLM.hi_bc = Interior Interior


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 64 64 64 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 1 # maximum level number allowed
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 # how often to regrid
amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid
amr.blocking_factor = 16 # block factor in grid generation (min box size)
amr.max_grid_size = 64 # max box size


#--------------------------- Problem -------------------------------
prob.T_mean = 298.0
prob.P_mean = 101325.0
prob.type = ConvectedTanH
prob.meanFlowMag = 50.0
prob.meanFlowDir = 1
prob.tanh_rad = 0.2
prob.tanh_x0 = 0.5
prob.tanh_y0 = 0.5
prob.tanh_ampl = 0.1
prob.tanh_type = Spec

#------------ INPUTS TO CONSTANT TRANSPORT -----------------
transport.const_viscosity = 0.0
transport.const_bulk_viscosity = 0.0
transport.const_conductivity = 0.0
transport.const_diffusivity = 0.0

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.rho = 1.17
peleLM.mu = 0.0

amr.plot_int = 10000
amr.max_step = 50000
amr.dt_shrink = 0.1
amr.stop_time = 0.02
amr.cfl = 0.5
amr.derive_plot_vars = avg_pressure

#--------------------REFINEMENT CONTROL------------------------
amr.refinement_indicators = yo2
amr.yo2.max_level = 1
amr.yo2.value_greater = 0.24
amr.yo2.field_name = Y(O2)

amrex.fpe_trap_invalid = 1
amrex.fpe_trap_zero = 1
amrex.fpe_trap_overflow = 1
64 changes: 64 additions & 0 deletions Exec/RegTests/PeriodicCases/input.2d_CoTanHTAMR
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = 0.0 0.0 0.0 # x_lo y_lo (z_lo)
geometry.prob_hi = 1.0 1.0 1.0 # x_hi y_hi (z_hi)

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# Interior, Inflow, Outflow, Symmetry,
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm
peleLM.lo_bc = Interior Interior
peleLM.hi_bc = Interior Interior


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 64 64 64 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 0 # maximum level number allowed
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 # how often to regrid
amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid
amr.blocking_factor = 16 # block factor in grid generation (min box size)
amr.max_grid_size = 64 # max box size

#--------------------------- Problem -------------------------------
prob.T_mean = 298.0
prob.P_mean = 101325.0
prob.type = ConvectedTanH
prob.meanFlowMag = 50.0
prob.meanFlowDir = 3
prob.tanh_rad = 0.2
prob.tanh_x0 = 0.5
prob.tanh_y0 = 0.5
prob.tanh_ampl = 0.1
prob.tanh_type = Temp

#------------ INPUTS TO CONSTANT TRANSPORT -----------------
transport.const_viscosity = 0.0
transport.const_bulk_viscosity = 0.0
transport.const_conductivity = 0.0
transport.const_diffusivity = 0.0

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.rho = 1.17
peleLM.mu = 0.0

amr.plot_int = 10000
amr.max_step = 50000
amr.dt_shrink = 0.1
amr.stop_time = 0.06
amr.cfl = 0.7
amr.derive_plot_vars = avg_pressure

#--------------------REFINEMENT CONTROL------------------------
amr.refinement_indicators = temp
amr.temp.max_level = 2
amr.temp.value_greater = 305
amr.temp.field_name = temp

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
50 changes: 50 additions & 0 deletions Exec/RegTests/PeriodicCases/pelelm_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,56 @@ void pelelm_initdata(int i, int j, int k,
} else {
amrex::Abort("Unknown gauss_type: should be either Temp or Spec");
}
} else if ( prob_parm.probType == 3 ) { // CoTanH

switch(prob_parm.meanFlowDir) {
case 1 :
AMREX_D_TERM(vel(i,j,k,0) = prob_parm.meanFlowMag;,
vel(i,j,k,1) = 0.0;,
vel(i,j,k,2) = 0.0);
break;
case -1 :
AMREX_D_TERM(vel(i,j,k,0) = -prob_parm.meanFlowMag;,
vel(i,j,k,1) = 0.0;,
vel(i,j,k,2) = 0.0);
break;
case 2 :
AMREX_D_TERM(vel(i,j,k,0) = 0.0;,
vel(i,j,k,1) = prob_parm.meanFlowMag;,
vel(i,j,k,2) = 0.0);
break;
case -2 :
AMREX_D_TERM(vel(i,j,k,0) = 0.0;,
vel(i,j,k,1) = -prob_parm.meanFlowMag;,
vel(i,j,k,2) = 0.0);
break;
case 3 :
AMREX_D_TERM(vel(i,j,k,0) = prob_parm.meanFlowMag;,
vel(i,j,k,1) = prob_parm.meanFlowMag;,
vel(i,j,k,2) = 0.0);
break;
case -3 :
AMREX_D_TERM(vel(i,j,k,0) = -prob_parm.meanFlowMag;,
vel(i,j,k,1) = -prob_parm.meanFlowMag;,
vel(i,j,k,2) = 0.0);
break;
}

if (is_incompressible) return;

temp(i,j,k) = prob_parm.T_mean;
const amrex::Real deltax = x - prob_parm.xgauss;
const amrex::Real deltay = y - prob_parm.ygauss;
const amrex::Real rad = std::sqrt(deltax*deltax + deltay*deltay);
const amrex::Real eta = 0.5*(1.0 - std::tanh(2.0*(rad-prob_parm.rgauss)/(0.05*prob_parm.rgauss)));
if ( prob_parm.gauss_type == 0 ) { // Spec
massfrac[sp1_ID] += massfrac[sp1_ID] * prob_parm.ampgauss * eta;
massfrac[sp2_ID] = 1.0 - massfrac[sp1_ID];
} else if ( prob_parm.gauss_type == 1 ) { // Temp
temp(i,j,k) = prob_parm.T_mean * ( 1.0 + prob_parm.ampgauss * eta );
} else {
amrex::Abort("Unknown tanh_type: should be either Temp or Spec");
}
} else if ( prob_parm.probType == 2 ) { // DiffGau

AMREX_D_TERM(vel(i,j,k,0) = 0.0;,
Expand Down
18 changes: 18 additions & 0 deletions Exec/RegTests/PeriodicCases/pelelm_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ void PeleLM::readProbParm()
}
pp.query("meanFlowDir", PeleLM::prob_parm->meanFlowDir);
pp.query("meanFlowMag", PeleLM::prob_parm->meanFlowMag);
} else if ( type == "ConvectedTanH" ) {
PeleLM::prob_parm->probType = 3;
pp.query("tanh_rad", PeleLM::prob_parm->rgauss);
pp.query("tanh_x0", PeleLM::prob_parm->xgauss);
pp.query("tanh_y0", PeleLM::prob_parm->ygauss);
pp.query("tanh_ampl", PeleLM::prob_parm->ampgauss);
std::string gtype;
pp.query("tanh_type", gtype);
if ( gtype == "Spec" ) {
PeleLM::prob_parm->gauss_type = 0;
} else if ( gtype == "Temp" ) {
PeleLM::prob_parm->gauss_type = 1;
} else {
amrex::Print() << " Unknown prob.tanh_type ! Should be Spec or Temp \n";
amrex::Abort();
}
pp.query("meanFlowDir", PeleLM::prob_parm->meanFlowDir);
pp.query("meanFlowMag", PeleLM::prob_parm->meanFlowMag);
} else if ( type == "DiffusedGaussian" ) {
PeleLM::prob_parm->probType = 2;
pp.query("gaussian_time", PeleLM::prob_parm->gaussTime);
Expand Down