Skip to content

Commit

Permalink
21.11 Release merge (#29)
Browse files Browse the repository at this point in the history
* Move the CoveredMask reset flag out of the if statement.

* Add user-defined chemistry tolerances.

* Add a Triple flame in Exec/Cases/TripleFlame

* While making new level from coarse, get 1 ghost cell right so that
AmrNewTime data have one ghost cell properly set.

* Add a simple 2D CH4/Air premixed bunsen case. Tested up to 5 levels.

* Add a 3Dversion of the premixed bunsen flame.

* Need to reset the covered cell mask after restart in case regrid is not called right after.

* Add option to restart an efield simulation from a non-efield one.

* When restarting from non-efield chk, initialize electro-neutral nE
field.

* Fix PlotFile to plot I_R(nE) with efield and write/read in phiV/nE in
chk.

* Machinery to restart from non-efield chk.

* Update Precond operator to implement the second approximation of Stilda.

* Make use of the absolute tolerance in MLGMRES.

* Add fillpatch functions for the non-linear state components.

* Enable Schur complement approximation 2.

* Define and ParmParse m_ef_schur_approx.

* Floor nE along with species if required.

* Fix typos in PeleLMBC.cpp

* Update PeleLMeX header for new fillpatch functions.

* Replace mechanism.h by mechanism.H

* Setup gravity.

* Use gravity in velocity forces.

* Replace .copy by .ParallelCopy.

* Add a lifting hot bubble case in RegTests.

* Default the pprocConvOrder.py to CoVo inputs.

* Enable CoVo in all directions.

* Default input.2d_CoVo to diagonal direction.

* Update pprocConvOrder.py with version checking the convergence order.

* Init convergence testing CI.

* Fix convergence CI (#6)

* Fix deps in convergence CI.

* Update pprocConvOrder.py.

* Fix Pele Physics (#7)

* Update make system to catch up with PP.

* Update sources for latest PP.

* Fix parsing of constant transport parameters.

* Switch AMReX-Hydro (#8)

* Add AMReX-Hydro to deps and GMake.

* Remove LMX Godunov folder from listed sources.

* Fix AMReX-Hydro makefile again and need MOL.

* Swtich to HydroUtils to predict velocity and use
create_umac_grown_constrained.

* Remove stranded Godunov include.

* Add m_advection_type. Only Godunov in LMeX.

* Switch to HydroUtils::ComputeFluxesOnBoxFromState for advection fluxes.

* Remove Godunov from LMeX sources.

* Rewritte the advective flux divergence to comply with AMReX-Hydro way.

* Update CI.

* Feature balance (#9)

* Add kin. energy derive function.

* Add kin.energy derive and ParmParse temporals input.

* Start setting-up run-time diagnostics.

* Update MLNorm0 to not account for fine-covered cells.

* Setup mass balance in runtime diagnostics.

* Add temporal keys to FlameSheet regtests

* Git ignore

* Add gnuplot script for mass balance.

* Fix runtime selection of reactor. (#10)

* Missing AMReX-Hydro home in convergence testing.

* Update Make.PeleLMeX

* Update reactor in Sources.

* Remove one call too many to deallocate of transport.

* Update FlameSheet GMake

* Add CVODE input keys.

* Udpate GMake in Periodic and HotBubble

* Fix typo on ReactorNull default:

* Make LMeX GPU-compatible (#11)

* Remove device from lineaChmeForcing.

* Can't init capture in host_device functions.

* Fix call to host function on device lambdas.

* Change OMP.

* Should be the same, but make sure.

* Don't init transport for incompressible flows.

* Missing Gpu Managed. Will be updated later.

* Minor clean up in PeriodicCases.

* Fix parm in FLameSheet too.

* Restore FlameSheet 3D.

* Remove unused.

* Add Sundials memory helper.

* Remove auto-TPL. Recompile all the source each time. Need fix.

* Restore make TPL in GH workflow for now.

* Fix velocity ghost cells for Nodal projection. Function (#12)

should only overwrite Inflow BCs.

* Implement closed chamber algorithm. (#13)

* Add auto-detection of closed chamber and unable overwrite.
Add PPquery of linear solves tolerances.

* Add GammmaInv kernel.

* Move MFSum in Utils and initialize uncovered volume computation.

* MAC projection function handles closed chamber corrections.

* Nodal projection functions handle -/+ of Sbar in RHS.

* Remove TODO comment.

* Pass dp0dt in diffusion forcing.

* Pass dp0dt in Advection forcing.

* Add pOld <-> pNew in advance function.

* Add adjustPandDivU in Eos file.

* Add accessor to divU levels vector

* Add declarations.

* Add ambient pressure to checkpoint file header.

* Uses pNew to get dPdt.

* Fix BL_PROF in UMAC

* Add an enclosed flame test to test closed chamber.

* Add a CI testing closed chamber.

* Enable EB in LMeX (#16)

* Add missing EB sources to Make.

* Add volFrac to plotfile.

* Add PeleLM EB source file.

* Add a static_cast accessor to ebfactory.

* Update AMReX-Hydro calls to pass ebfactory in.

* Missing include for volfrac tagging.

* Update diffusion operator for EB.

* EB compiles and initialize properly.

* Make sure divTau has right Factory.

* Fix getDiffusivity to not set covered face to 0,0 but huge val.

* _OPENMP -> AMREX_USE_OMP

* Remove plot/abort after init.

* First pass at updating DiffusionOp for EB. Mostly done.

* Fix divergence of advective flux function for EB.

* Minor tweak in PeleLMDiffusion. FluxRedist still need to be implemented.

* Re-organive advection to get divergnce and then redistribute when EB.
fillBoundary in between req. a temporary.

* redistribute_AofS function.

* Add redist schemes for adv/diff, ensure enough ghost cells and declarations.

* Add ParmParse to control nodal solve MG depth.

* Enforce EB-covered to 0 for nodal projection.

* Add fluxdivegenceRD to handle diffusive flux redistribution. Fix MFSum
to exclude EB-covered regions.

* Diffusive flux redistribution function.

* Tedious switch between div/divRD for diffusiob fluxes. Might want to simplify later.

* Accessor to RhoH tower.

* Declarations.

* Add 3D case for EnclosedFlame and a thermo-diffusive CH4/H2 PMF.

* Number of ghost cells in EBFactory should be 6 because of StateRedist

* EBFlag test inst. reaction rate.

* Set covered to 0.0 in plotfiles.

* EBFlag in getHGivenT in enthalpy flux.

* Do initial redisitribution and get a covered state.

* Add initial redistribution machinery and first version of covered state. Need to improve !

* Less confusing message since we now have EB.

* StateRedist -> NewStateRedist default and EB-covered declaration.

* Add EB_FlowPastCylinder case, 2D/3D.

* Set EB-covered chi_incr to zero.

* Add FlowPastCylinder CI.

* A series of minor tweaks: (#17)

- git hash subrepo to screen
 - TPROF region cleaned. Add /level chem VARS
 - print to screen nCells/extend of each level during regridding

* Add typical value machinery (#18)

* Setup multi-level min/max excluding for EB/fine covered cells
and use that for typical values.

* Add typical values to chk.

* Reset typval at the beginning of advance when needed.

* ParmParse typval options.

* Typical value declarations & call during the initialization.

* Enable Hypre interface to Nodal/MAC linear solves (#19)

* Add Hypre interface ParmParse hook.

* Pass the right hypre_namespace to MacProj.

* MG depth for MAC solve.

* Pass hypre_namespace to nodal solve.

* Add examples of Nodal/MAC hypre options for FlowPastCylinder case.

* update README

* Add a few EB test cases (#20)

* Add an enclosed vortex, failing linear solves.

* Add an input file using Hypre for the Nodal solver

* Add an EB_EnclosedFlame case too.

* Add an Hypre input for the EB_EnclosedFlame case.

* Fix TypVal bug.

* Add the UserDefined hook to EB geom.

* Add Challenge problem. Something's up, not generating the EB geom
properly at this point.

* Error BC array sizes.

* Add commented out debug statement.

* Remove DEBUG and USE_HYPRE default.

* Restore complete PistonBowl geom.

* A bit more velocity.

* Update sample input file for GMG/Hypre nodal solves.

* EB mask operations (#21)

* Fix EB-covered test while building advective update.

* Check eb-covered while assembling divu

* Set covered diffusion term.

* Check EB-covered on advective face state reconstruction.
Set covered adv. fluxes/term.

* Add 3d input version of the enclosed vortex.

* Forgotten ANREX_USE_EB ifdef.

* Remove LMeX chem tol, now directly handled by the reactor.
Add flag to skip instantaneous RR when using ReactorNull.

* Reactor ini outside OMP region, turn ON skipInstantRR flag.

* Small rearrange of TPROF region for instantRR.

* Skip instantRR if triggered. Update the logic in divU calculation.

* Add a gaseous methane laminar counterflow diffusion flame. (#23)

* Update efield portions of the Sources/Exec (#24)

* Change compiler variable for Efield.

* Bring ABecCec operator up to date with some changes in GPU handling.

* Update Efield cases GNUMakefile

* Update input to FlameSheetIons

* Update Efield compiler check through the sources.

* Modify pltfile to include HRR and re-arrange a bit to not include I_R (#25)

in ReactorNull, drop rhoYs from pltfile by default for ligher plt.

* Update includes of Projector source location and names. (#26)

* Update includes of Projector source location and names.

* Update set typical values too.

* Update to catch up with new PelePhysics PMF (#27)

* Change PMF sources location.

* Update init and bc calls to updated PMF.

* Update the Cases files.

* Update PremBunsen3D input file.

* Update PeriodicCases

* Update EnclosedFlame

* Update EB_FlowPastCylinder

* Update FlameSheet

* Update HotBubble

* Update EB_EnclosedFlame

* Projector now moved to Hydro namespace

* Update input of EnclosedFlame

* update GNUmakefiles for templated PelePhysics (#28)

Co-authored-by: Bruce Perry <[email protected]>

* Temporary test another branch of PP.

* Restore using PP development brqnch in CI.

Co-authored-by: Bruce Perry <[email protected]>
Co-authored-by: Bruce Perry <[email protected]>

Co-authored-by: nickwimer <[email protected]>
Co-authored-by: Bruce Perry <[email protected]>
Co-authored-by: Bruce Perry <[email protected]>
  • Loading branch information
4 people authored Nov 4, 2021
1 parent f154a23 commit f247355
Show file tree
Hide file tree
Showing 98 changed files with 8,080 additions and 598 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,35 @@ jobs:
working-directory: ./Exec/RegTests/EnclosedFlame/
run: |
./PeleLMeX2d.gnu.MPI.ex input.2d-regt amr.max_step=2 amr.plot_int=-1 amr.check_int=-1
# Build and Run the EB_FlowPastCylinder RegTest with GNU7.5 and MPI support
FPC2D_MPIRun:
name: [email protected] MPI Run [FPC2D]
runs-on: ubuntu-latest
env:
{CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code"}
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{github.token}}
- uses: actions/checkout@v2
- name: System Dependencies
run: .github/workflows/dependencies/dependencies.sh
- name: Repo Dependencies
run: Utils/CloneDeps.sh
- name: Build
env:
AMREX_HOME: ${GITHUB_WORKSPACE}/build/amrex
PELE_PHYSICS_HOME: ${GITHUB_WORKSPACE}/build/PelePhysics
PELELM_HOME: ${GITHUB_WORKSPACE}
AMREX_HYDRO_HOME: ${GITHUB_WORKSPACE}/build/AMReX-Hydro
working-directory: ./Exec/RegTests/EB_FlowPastCylinder/
run: |
make TPL COMP=gnu USE_MPI=TRUE
make -j 2 COMP=gnu USE_MPI=TRUE
- name: Run
working-directory: ./Exec/RegTests/EB_FlowPastCylinder/
run: |
./PeleLMeX2d.gnu.MPI.ex input.2d-regt amr.max_step=2 amr.plot_int=-1 amr.check_int=-1
./PeleLMeX2d.gnu.MPI.ex input.2d-regt_WallBump amr.max_step=2 amr.plot_int=-1 amr.check_int=-1
30 changes: 30 additions & 0 deletions Exec/Cases/CounterFlow/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
TOP = ../../../..
AMREX_HOME ?= ${TOP}/amrex
PELELMEX_HOME ?= ${TOP}/PeleLMeX
PELE_PHYSICS_HOME ?= ${TOP}/PelePhysics
AMREX_HYDRO_HOME ?= ${TOP}/AMReX-Hydro


# AMReX
DIM = 2
DEBUG = FALSE
PRECISION = DOUBLE
VERBOSE = FALSE
TINY_PROFILE = FALSE

# Compilation
COMP = gnu
USE_MPI = TRUE
USE_OMP = FALSE
USE_CUDA = FALSE
USE_HIP = FALSE

# PeleLMeX
USE_EFIELD = FALSE

# PelePhysics
Chemistry_Model = drm19
Eos_Model = Fuego
Transport_Model = Simple

include $(PELELMEX_HOME)/Utils/Make.PeleLMeX
582 changes: 582 additions & 0 deletions Exec/Cases/CounterFlow/drm_CH4Air_stoich.dat

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions Exec/Cases/CounterFlow/input.2d-regt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 0 0 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = -0.01 -0.01 0.0 # x_lo y_lo (z_lo)
geometry.prob_hi = 0.01 0.01 0.016 # x_hi y_hi (z_hi)

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


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 64 64 32 # 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 = 5 # 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.P_mean = 101325.0
prob.T_ox = 298.0
prob.T_fuel = 298.0
prob.massflow = 1.0
prob.jet_radius = 0.005
prob.inert_radius = 0.0075
prob.inert_velocity = 0.2
prob.pertmag = 0.000
prob.pmf_datafile = "drm_CH4Air_stoich.dat"
prob.do_ignition = 1
prob.ignition_SphT = 2200.0

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.rho = 1.17
peleLM.mu = 0.0
peleLM.use_wbar = 1
peleLM.sdc_iterMax = 2
peleLM.floor_species = 1
peleLM.deltaT_verbose = 0

#amr.restart = chk01500
#amr.regrid_on_restart = 1
amr.check_int = 100
amr.plot_int = 20
amr.max_step = 100
amr.dt_shrink = 0.01
amr.stop_time = 1.1
#amr.stop_time = 1.00
amr.cfl = 0.25
amr.derive_plot_vars = avg_pressure mag_vort mass_fractions

peleLM.chem_integrator = "ReactorCvode"
peleLM.use_typ_vals_chem = 1 # Use species/temp typical values in CVODE
ode.rtol = 1.0e-6 # Relative tolerance of the chemical solve
ode.atol = 1.0e-5 # 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.

nodal_proj.verbose = 0
mac_proj.verbose = 0
#diffusion.verbose = 2

peleLM.do_temporals = 1
peleLM.temporal_int = 2
peleLM.mass_balance = 1

#--------------------REFINEMENT CONTROL------------------------
amr.refinement_indicators = temp
amr.temp.max_level = 2
amr.temp.value_greater = 1500
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 = yH_Crse yH_Fine CH2O
#amr.yH_Crse.max_level = 1
#amr.yH_Crse.value_greater = 1.50e-4
#amr.yH_Crse.field_name = Y(H)
#
#amr.yH_Fine.max_level = 3
#amr.yH_Fine.value_greater = 2.00e-4
#amr.yH_Fine.field_name = Y(H)
#
#amr.CH2O.max_level = 4
#amr.CH2O.value_greater = 1.00e-3
#amr.CH2O.field_name = Y(CH2O)

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
201 changes: 201 additions & 0 deletions Exec/Cases/CounterFlow/pelelm_prob.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
#ifndef PELELM_PROB_H_
#define PELELM_PROB_H_

#include <AMReX_Geometry.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_SPACE.H>

#include <PeleLM_Index.H>
#include <pelelm_prob_parm.H>
#include <PMFData.H>
#include <PelePhysics.H>

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void pelelm_initdata(int i, int j, int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& vel,
amrex::Array4<amrex::Real> const& rho,
amrex::Array4<amrex::Real> const& rhoY,
amrex::Array4<amrex::Real> const& rhoH,
amrex::Array4<amrex::Real> const& temp,
amrex::Array4<amrex::Real> const& aux,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const * pmf_data)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i+0.5)*dx[0];,
const amrex::Real y = prob_lo[1] + (j+0.5)*dx[1];,
const amrex::Real z = prob_lo[2] + (k+0.5)*dx[2];);

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];,
const amrex::Real Ly = prob_hi[1] - prob_lo[1];,
const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

AMREX_D_TERM(const amrex::Real xc = prob_lo[0] + Lx/2.0;,
const amrex::Real yc = prob_lo[1] + Ly/2.0;,
const amrex::Real zc = prob_lo[2] + Lz/2.0);

constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;

auto eos = pele::physics::PhysicsType::eos();
amrex::GpuArray<amrex::Real, NUM_SPECIES + 4> pmf_vals = {0.0};
amrex::Real u[3] = {0.0};
amrex::Real molefrac[NUM_SPECIES] = {0.0};
amrex::Real massfrac[NUM_SPECIES] = {0.0};
amrex::Real y1, y2;
amrex::Real splitx = prob_lo[0] + 0.5 * Lx;

massfrac[N2_ID] = 0.767;
massfrac[O2_ID] = 0.233;

temp(i,j,k) = 298.0;

if (prob_parm.do_ignit) {
amrex::Real radiusSq = AMREX_D_TERM( (x-xc) * (x-xc),
+ (y-yc) * (y-yc),
+ (z-zc) * (z-zc));
amrex::Real radius = std::sqrt(radiusSq);
amrex::Real mixingWidth = 0.1*prob_parm.ignitSphereRad;
amrex::Real mixingFunction = 0.5 * ( 1.0 + std::tanh((prob_parm.ignitSphereRad - radius)/mixingWidth));
temp(i,j,k) = mixingFunction * prob_parm.ignitT + (1.0 - mixingFunction) * 298.0;
massfrac[CH4_ID] = 0.02;
massfrac[O2_ID] = 0.233 * (1.0 - massfrac[CH4_ID]);
massfrac[N2_ID] = 1.0 - massfrac[CH4_ID] - massfrac[O2_ID];
}

AMREX_D_TERM(vel(i,j,k,0) = 0.0;,
vel(i,j,k,1) = 0.1;,
vel(i,j,k,2) = 0.0);

amrex::Real P_cgs = prob_parm.P_mean * 10.0;

// Density
amrex::Real rho_cgs = 0.0;
eos.PYT2R(P_cgs, massfrac, temp(i,j,k), rho_cgs);
rho(i,j,k) = rho_cgs * 1.0e3;

// Enthalpy
amrex::Real h_cgs = 0.0;
eos.TY2H(temp(i,j,k), massfrac, h_cgs);
rhoH(i,j,k) = h_cgs * 1.0e-4 * rho(i,j,k);

// Species mass
for (int n = 0; n < NUM_SPECIES; n++) {
rhoY(i,j,k,n) = massfrac[n] * rho(i,j,k);
}
}

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real x[AMREX_SPACEDIM],
const int m_nAux,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const * /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];,
const amrex::Real Ly = prob_hi[1] - prob_lo[1];,
const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

amrex::Real splitx = prob_lo[0] + 0.5 * Lx;
amrex::Real splity = prob_lo[1] + 0.5 * Ly;

amrex::Real massfrac_ox[NUM_SPECIES] = {0.0};
amrex::Real massfrac_fuel[NUM_SPECIES] = {0.0};
amrex::Real massfrac_inert[NUM_SPECIES] = {0.0};
amrex::Real massfrac_mix[NUM_SPECIES] = {0.0};

massfrac_ox[N2_ID] = 0.767;
massfrac_ox[O2_ID] = 0.233;
massfrac_fuel[CH4_ID] = 1.0;
massfrac_inert[N2_ID] = 1.0;

auto eos = pele::physics::PhysicsType::eos();

for (int n = 0; n < NVAR; n++){
s_ext[n] = 0.0;
}

// Get zone
int zone = -1;
if ( x[0] < splitx ) {
zone = 1; // Oxidizer side jet
} else {
zone = 2; // Fuel side jet
}
amrex::Real radius = std::abs(x[1]-splity);
amrex::Real mixingWidth = 0.1*prob_parm.jetRadius;
amrex::Real mixingFunction = 0.5 * ( 1.0 + std::tanh((prob_parm.jetRadius - radius)/mixingWidth));

amrex::Real P_cgs = prob_parm.P_mean * 10.0;
amrex::Real rho_cgs, RhoH_temp;
amrex::Real rhoOx = -1.0;
{
eos.PYT2R(P_cgs, massfrac_ox, prob_parm.T_ox, rhoOx);
rhoOx *= 1.0e3;
}
amrex::Real rhoFuel = -1.0;
{
eos.PYT2R(P_cgs, massfrac_fuel, prob_parm.T_fuel, rhoFuel);
rhoFuel *= 1.0e3;
}
if ( zone == 1 ) {
s_ext[TEMP] = prob_parm.T_ox * mixingFunction +
298.0 * (1.0 - mixingFunction);
for (int n = 0; n < NUM_SPECIES; n++) {
massfrac_mix[n] = massfrac_ox[n] * mixingFunction +
massfrac_inert[n] * (1.0 - mixingFunction);
}
eos.PYT2R(P_cgs, massfrac_mix, s_ext[TEMP], rho_cgs);
s_ext[DENSITY] = rho_cgs * 1.0e3;

eos.TY2H(s_ext[TEMP], massfrac_mix, RhoH_temp);
s_ext[RHOH] = RhoH_temp * 1.0e-4 * s_ext[DENSITY];

for (int n = 0; n < NUM_SPECIES; n++) {
s_ext[FIRSTSPEC+n] = massfrac_mix[n] * s_ext[DENSITY];
}
} else if ( zone == 2 ) {
s_ext[TEMP] = prob_parm.T_fuel * mixingFunction +
298.0 * (1.0 - mixingFunction);
for (int n = 0; n < NUM_SPECIES; n++) {
massfrac_mix[n] = massfrac_fuel[n] * mixingFunction +
massfrac_inert[n] * (1.0 - mixingFunction);
}
eos.PYT2R(P_cgs, massfrac_mix, s_ext[TEMP], rho_cgs);
s_ext[DENSITY] = rho_cgs * 1.0e3;

eos.TY2H(s_ext[TEMP], massfrac_mix, RhoH_temp);
s_ext[RHOH] = RhoH_temp * 1.0e-4 * s_ext[DENSITY];

for (int n = 0; n < NUM_SPECIES; n++) {
s_ext[FIRSTSPEC+n] = massfrac_mix[n] * s_ext[DENSITY];
}
}

s_ext[VELY] = 0.0;
if ( zone == 1 ) {
amrex::Real vel = (prob_parm.mdot / rhoOx) * mixingFunction +
prob_parm.inertVel /* (1.0 + (radius/0.025))*/ * (1.0 - mixingFunction);
s_ext[VELX] = vel;
} else if ( zone == 2 ) {
amrex::Real vel = (prob_parm.mdot / rhoFuel) * mixingFunction +
prob_parm.inertVel /* (1.0 + (radius/0.025))*/ * (1.0 - mixingFunction);
s_ext[VELX] = -vel;
}
}
#endif
20 changes: 20 additions & 0 deletions Exec/Cases/CounterFlow/pelelm_prob.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <PeleLM.H>
#include <AMReX_ParmParse.H>

void PeleLM::readProbParm()
{
amrex::ParmParse pp("prob");

pp.query("P_mean", PeleLM::prob_parm->P_mean);
pp.query("T_oxidizer", PeleLM::prob_parm->T_ox);
pp.query("T_fuel", PeleLM::prob_parm->T_fuel);
pp.query("massflow", PeleLM::prob_parm->mdot);
pp.query("pertmag", PeleLM::prob_parm->pertmag);
pp.query("jet_radius", PeleLM::prob_parm->jetRadius);
pp.query("inert_radius", PeleLM::prob_parm->inertRadius);
pp.query("inert_velocity", PeleLM::prob_parm->inertVel);

pp.query("do_ignition", PeleLM::prob_parm->do_ignit);
pp.query("ignition_SphRad", PeleLM::prob_parm->ignitSphereRad);
pp.query("ignition_SphT", PeleLM::prob_parm->ignitT);
}
Loading

0 comments on commit f247355

Please sign in to comment.