Skip to content

Commit

Permalink
Submods Efields and Ionized flame case updates (#110)
Browse files Browse the repository at this point in the history
* Update FlameSheetIons GNUmake for chemical mechanism.

* Update init and bcnormal functions.

* Add new PMF file.

* Add an input with reverse polarity.

* Update submodules.
  • Loading branch information
esclapez authored Jul 26, 2022
1 parent ee45a90 commit cb3a033
Show file tree
Hide file tree
Showing 9 changed files with 939 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Exec/Efield/FlameSheetIons/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ USE_HIP = FALSE
USE_EFIELD = TRUE

# PelePhysics
Chemistry_Model = CH4Ion_GRI
Chemistry_Model = methaneIons_diRenzo
Eos_Model = Fuego
Transport_Model = Simple

Expand Down
20 changes: 10 additions & 10 deletions Exec/Efield/FlameSheetIons/input.2d-regt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ amr.max_grid_size = 128 # max box size
prob.P_mean = 101325.0
prob.standoff = -.01
prob.pertmag = 0.0001
pmf.datafile = "pmf_CH4Air_1p0.dat"
pmf.datafile = "pmf_DiRenzoSkCH4Air_1p0.dat"
pmf.do_cellAverage = 0
prob.PhiV_y_hi = 1000.0

Expand All @@ -38,11 +38,11 @@ peleLM.rho = 1.17
peleLM.mu = 0.0
peleLM.use_wbar = 1
peleLM.sdc_iterMax = 2
eleLM.floor_species = 0
peleLM.floor_species = 0
peleLM.num_init_iter = 2
peleLM.advection_scheme = "Godunov_BDS"

#amr.restart = chk00070
#amr.restart = chk00020
amr.check_int = 20
amr.plot_int = 10
amr.max_step = 20
Expand All @@ -63,20 +63,20 @@ ef.phiV_lo_bc = Interior Dirichlet
ef.phiV_hi_bc = Interior Dirichlet
ef.phiV_polarity_lo = Neutral Cathode
ef.phiV_polarity_hi = Neutral Anode
ef.GMRES_rel_tol = 1.0e-6
ef.GMRES_rel_tol = 1.0e-5
ef.GMRES_abs_tol = 1.0e-13
ef.JFNK_lambda = 5.0e-7
ef.JFNK_lambda = 1.0e-7
ef.JFNK_diffType = 1
ef.PC_approx = 2
#ef.PC_damping = 0.95
#ef.PC_damping = 0.75
ef.advection_scheme_order = 1
ef.precond.diff_verbose = 2
ef.precond.diff_verbose = 0
ef.precond.Stilda_verbose = 0
ef.precond.fixedIter = 3
ef.precond.fixedIter = 4
#ef.precond.max_coarsening_level_diff = 3
gmres.krylovBasis_size = 20
gmres.krylovBasis_size = 30
gmres.verbose = 0
gmres.max_restart = 3
gmres.max_restart = 2

#--------------------REFINEMENT CONTROL------------------------
#amr.refinement_indicators = temp
Expand Down
99 changes: 99 additions & 0 deletions Exec/Efield/FlameSheetIons/input.2d-regt_flipped
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 0 # 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 = 0.008 0.016 0.016 # x_hi y_hi (z_hi)

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


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 64 128 32 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 2 # 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 4 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 = 128 # max box size


#--------------------------- Problem -------------------------------
prob.P_mean = 101325.0
prob.standoff = -.01
prob.pertmag = 0.0001
pmf.datafile = "pmf_DiRenzoSkCH4Air_1p0.dat"
pmf.do_cellAverage = 0
prob.PhiV_y_hi = -1000.0

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 2
peleLM.incompressible = 0
peleLM.rho = 1.17
peleLM.mu = 0.0
peleLM.use_wbar = 1
peleLM.sdc_iterMax = 2
peleLM.floor_species = 0
peleLM.num_init_iter = 2
peleLM.advection_scheme = "Godunov_BDS"

#amr.restart = chk00020
amr.check_int = 20
amr.plot_int = 10
amr.max_step = 20
amr.dt_shrink = 0.1
amr.stop_time = 0.001
amr.cfl = 0.95
amr.derive_plot_vars = avg_pressure mag_vort mass_fractions chargedistrib efieldx efieldy LorentzFx LorentzFy

peleLM.chem_integrator = "ReactorCvode"
peleLM.use_typ_vals_chem = 1 # Use species/temp typical values in CVODE
ode.rtol = 1.0e-7 # Relative tolerance of the chemical solve
ode.atol = 1.0e-6 # Absolute tolerance factor applied on typical values
cvode.solve_type = denseAJ_direct # CVODE Linear solve type (for Newton direction)
cvode.max_order = 4 # CVODE max BDF order.

#--------------------REFINEMENT CONTROL------------------------
ef.phiV_lo_bc = Interior Dirichlet
ef.phiV_hi_bc = Interior Dirichlet
ef.phiV_polarity_lo = Neutral Anode
ef.phiV_polarity_hi = Neutral Cathode
ef.GMRES_rel_tol = 1.0e-5
ef.GMRES_abs_tol = 1.0e-13
ef.JFNK_lambda = 1.0e-7
ef.JFNK_diffType = 1
ef.PC_approx = 2
#ef.PC_damping = 0.75
ef.advection_scheme_order = 1
ef.precond.diff_verbose = 0
ef.precond.Stilda_verbose = 0
ef.precond.fixedIter = 4
#ef.precond.max_coarsening_level_diff = 3
gmres.krylovBasis_size = 30
gmres.verbose = 0
gmres.max_restart = 2

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

#amr.refinement_indicators = magVort
#amr.magVort.max_level = 1
#amr.magVort.value_greater = 500.0
#amr.magVort.field_name = mag_vort

amr.refinement_indicators = yE
amr.yE.max_level = 3
amr.yE.value_greater = 1.0e17
amr.yE.field_name = nE

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
21 changes: 12 additions & 9 deletions Exec/Efield/FlameSheetIons/pelelm_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,20 @@ void pelelm_initdata(int i, int j, int k,
0.982 * std::sin(2 * Pi * 5 * (x - 0.014234) / Lx));
}

y1 = (y - prob_parm.standoff - 0.5*dx[1] + pert);
y2 = (y - prob_parm.standoff + 0.5*dx[1] + pert);
y1 = (y - prob_parm.standoff - 0.5*dx[1] + pert)*100.0;
y2 = (y - prob_parm.standoff + 0.5*dx[1] + pert)*100.0;

y1 += 0.5*dx[1];
pele::physics::PMF::pmf(pmf_data,y1, y1, pmf_vals);

state(i,j,k,TEMP) = pmf_vals[0];;

for (int n = 0; n < NUM_SPECIES; n++){
massfrac[n] = pmf_vals[3 + n];
molefrac[n] = pmf_vals[3 + n];
}

eos.X2Y(molefrac,massfrac);

amrex::Real mw[NUM_SPECIES] = {0.0};
eos.molecular_weight(mw);
amrex::Real zk[NUM_SPECIES] = {0.0};
Expand Down Expand Up @@ -110,7 +112,7 @@ void pelelm_initdata(int i, int j, int k,


AMREX_D_TERM(state(i,j,k,VELX) = 0.0;,
state(i,j,k,VELY) = pmf_vals[1];,
state(i,j,k,VELY) = pmf_vals[1] * 0.01;,
state(i,j,k,VELZ) = 0.0);

amrex::Real P_cgs = prob_parm.P_mean * 10.0;
Expand Down Expand Up @@ -158,19 +160,20 @@ bcnormal(
pele::physics::PMF::pmf(pmf_data,prob_lo[idir], prob_lo[idir], pmf_vals);

AMREX_D_TERM(s_ext[VELX] = 0.0;,
s_ext[VELY] = pmf_vals[1];,
s_ext[VELY] = pmf_vals[1]*0.01;,
s_ext[VELZ] = 0.0);

s_ext[TEMP] = pmf_vals[0];
for (int n = 0; n < NUM_SPECIES; n++){
massfrac[n] = pmf_vals[3 + n];
molefrac[n] = pmf_vals[3 + n];
}

massfrac[N2_ID] += massfrac[E_ID] + massfrac[H3Op_ID] + massfrac[HCOp_ID] + massfrac[C2H3Op_ID];
eos.X2Y(molefrac,massfrac);

massfrac[N2_ID] += massfrac[E_ID] + massfrac[H3Op_ID] + massfrac[CHOp_ID];
massfrac[E_ID] = 0.0;
massfrac[H3Op_ID] = 0.0;
massfrac[HCOp_ID] = 0.0;
massfrac[C2H3Op_ID] = 0.0;
massfrac[CHOp_ID] = 0.0;

amrex::Real rho_cgs, P_cgs, RhoH_temp;
P_cgs = prob_parm.P_mean * 10.0;
Expand Down
Loading

0 comments on commit cb3a033

Please sign in to comment.