|
Ignis
|
#include <ignis.h>
Public Member Functions | |
| void | setIC (const std::string icType, const std::string fname="") |
| void | storeState () |
| void | setFluxesUnity () |
| void | setFluxes () |
| void | setGrid (double _L) |
| void | writeFileHdf5 (const std::string gname, const std::string timeType) |
| void | writeFile (const std::string fname) |
| void | solveSS () |
| void | setChi (const double _chi0) |
| void | solveUnsteady (const double nTauRun, const int nsteps, const bool doWriteTime=true, const double Tmin=0, const double Tmax=0) |
| int | Func (const double *vars, double *F) |
| int | rhsf (const double *vars, double *dvarsdt) |
| int | rhsf_flamelet (const double *vars, double *dvarsdt) |
| void | setQrad (std::vector< double > &Q) |
| void | setTprof (const std::vector< double > &_Tprof_h, const std::vector< double > &_Tprof_T) |
| void | setDerivative2 (const double vL, const double vR, const std::vector< double > &v, std::vector< double > &d2vdx2) |
| void | setDerivative (const double vL, const double vR, const std::vector< double > &v, std::vector< double > &dvdx) |
| size_t | I (size_t i, size_t k) |
| size_t | Ia (size_t i, size_t k) |
| ignis (const bool _isPremixed, const bool _doEnergyEqn, const bool _isFlamelet, const bool _doSoot, const size_t _ngrd, const double _L, const double _P, std::shared_ptr< Cantera::Solution > csol, std::string _radType, const std::vector< double > &_yLbc, const std::vector< double > &_yRbc, const double _TLbc, const double _TRbc, std::shared_ptr< soot::sootModel > _SM, std::shared_ptr< soot::state > _SMstate) | |
Public Attributes | |
| size_t | ngrd |
| number of interior grid points | |
| size_t | nsp |
| number of gas species | |
| size_t | nsoot |
| number of soot variables | |
| size_t | nvar |
| number of transported variables at each grid point | |
| size_t | nvarA |
| nvar * ngrd | |
| double | P |
| system pressure, uniform (Pa) | |
| std::vector< std::vector< double > > | y |
| mass fractions: y[igrid][isp] | |
| std::vector< double > | T |
| temperature (K) | |
| std::vector< std::vector< double > > | sootvars |
| soot moments or sections; sootvars[igrid][isoot] | |
| double | Pstore |
| stored system pressure (for initializing from stored state) | |
| std::vector< std::vector< double > > | ystore |
| stored mass fractions | |
| std::vector< double > | Tstore |
| stored temperature | |
| std::vector< std::vector< double > > | sootstore |
| stored soot variables | |
| std::vector< double > | yLbc |
| std::vector< double > | yRbc |
| y boundary values: left and right (as needed) | |
| double | TLbc |
| double | TRbc |
| T boundary values: left and right (as needed) | |
| double | hLbc |
| double | hRbc |
| h boundary values: left and right (as needed) | |
| double | cpLbc |
| double | cpRbc |
| cp boundary values: left and right (as needed) | |
| std::vector< double > | hspLbc |
| species enthalpies on left boundary | |
| std::vector< double > | hspRbc |
| species enthalpies on right boundary | |
| double | L |
| domain size (m) | |
| std::vector< double > | x |
| grid position values (m) | |
| std::vector< double > | dx |
| grid spacing (m), nonuniform is fine | |
| std::vector< double > | fl |
| fractions for interpolation | |
| std::vector< double > | fr |
| fractions for interpolation | |
| double | Tscale |
| scaling value for temperature (for solvers) | |
| double | hscale |
| scaling value for enthalpy (for solvers) | |
| std::vector< double > | sootScales |
| scaling value for soot variables (for solvers) | |
| std::vector< double > | vars0 |
| for homotopy approaches | |
| std::vector< double > | F0 |
| for homotopy approaches | |
| double | s |
| homotopy variable | |
| std::shared_ptr< Cantera::ThermoPhase > | gas |
| Cantera thermo object. | |
| std::shared_ptr< Cantera::Kinetics > | kin |
| Cantera kinetics object. | |
| std::shared_ptr< Cantera::Transport > | trn |
| Cantera transport object. | |
| std::shared_ptr< streams > | strm |
| streams object (mixture fraction, etc.) | |
| std::shared_ptr< rad > | radProps |
| radiation object | |
| std::string | radType |
| radiation model name | |
| bool | doRadiation |
| radiation flag | |
| std::vector< double > | kabs_sur |
| kabs for surroundings | |
| std::vector< double > | awts_sur |
| awts for surroundings | |
| bool | doLe1 = false |
| true if doing unity Lewis numbers (default false) | |
| double | Ttarget |
| for unsteady cases, run until this max T instead of for a given time | |
| double | dT |
| delta T increment for unsteady cases | |
| int | isave |
| file counter for save during unsteady cases | |
| std::vector< std::vector< double > > | flux_y |
| species fluxes: [I(igrid, ksp)] I(igrid,ksp) maps 2D onto 1D | |
| std::vector< std::vector< double > > | flux_soot |
| species fluxes: [I(igrid, ksoot)] | |
| std::vector< double > | flux_h |
| species fluxes: [igrid] | |
| bool | isFlamelet = false |
| true for laminar flamelet (mixture fraction coordinate) | |
| std::vector< double > | chi |
| dissipation rate profile | |
| double | chi0 |
| bool | isPremixed = false |
| true of the case is a premixed flame, (only left boundary condition, constant mass flux through domain) | |
| double | mflux = 0.0 |
| premixed flame mass flux (kg/m2*s) | |
| bool | doEnergyEqn = true |
| for premixed flames: can solve energy equation or set T profile | |
| std::shared_ptr< linearInterp > | LI |
| interpolator for specified temperature profiles | |
| std::vector< double > | Tprof_h |
| temperature profile position (h is height above burner (m)) | |
| std::vector< double > | Tprof_T |
| temperature profile T values | |
| bool | doSoot = false |
| soot flag | |
| std::shared_ptr< soot::sootModel > | SM |
| soot model | |
| std::shared_ptr< soot::state > | SMstate |
| holds state variables (gas and soot) for soot model | |
| std::shared_ptr< HighFive::File > | fh5 |
| hdf5 file pointer | |
One-dimensional flame solver: burner stabilized premixed and diffusion flames Premixed flames can use a fixed temperature profile, or solve the energy equation. Diffusion flames are diffusion only, with Dirichlet boundary conditions. Flame stain occurs through the domain length.
| ignis::ignis | ( | const bool | _isPremixed, |
| const bool | _doEnergyEqn, | ||
| const bool | _isFlamelet, | ||
| const bool | _doSoot, | ||
| const size_t | _ngrd, | ||
| const double | _L, | ||
| const double | _P, | ||
| std::shared_ptr< Cantera::Solution > | csol, | ||
| std::string | _radType, | ||
| const std::vector< double > & | _yLbc, | ||
| const std::vector< double > & | _yRbc, | ||
| const double | _TLbc, | ||
| const double | _TRbc, | ||
| std::shared_ptr< soot::sootModel > | _SM, | ||
| std::shared_ptr< soot::state > | _SMstate | ||
| ) |
Constructor function
| _isPremixed | input: flag indicating if running a premixed or diffusion flame |
| _doEnergyEqn | input: flag indicating if solving the energy equation or using a given T profile (for premixed flames) |
| _doSoot | input: flag indicating if solving with soot |
| _ngrd | input: number of interior grid points |
| _L | input: domain size (m) |
| _P | input: system pressure (Pa) |
| csol | input: Cantera Solution object (used to set gas, kin, trn) |
| _yLbc | input: mass fractions on left boundary |
| _yRbc | input: mass fractions on right boundary (not used for premixed flames) |
| _TLbc | input: temperature (K) on left boundary |
| _TRbc | input: temperature (K) on right boundary (not used for premixed flames) |
| _SM | input: soot model object |
| _SMstate | input: soot model state object (gas and soot properties for input to SM) |
Definition at line 45 of file ignis.cc.
| void ignis::setIC | ( | const std::string | icType, |
| const std::string | fname = "" |
||
| ) |
Set initial condition for solution (or initial guess for steady solvers).
| icType | input: string indicating the type of the initial condition to use |
| fname | input: read input from this file name (defaults to empty string) |
Definition at line 485 of file ignis.cc.
| void ignis::storeState | ( | ) |
| void ignis::setFluxesUnity | ( | ) |
| void ignis::setFluxes | ( | ) |
| void ignis::setGrid | ( | double | _L | ) |
| void ignis::writeFileHdf5 | ( | const std::string | gname, |
| const std::string | timeType | ||
| ) |
There is a single hdf5 file, with multiple groups. Whenever you would normally write a file with x, mixf, T, h, rho, y, etc., instead, you make a new group inside the one hdf5 file.
| gname | input: write output to this group name |
Definition at line 264 of file ignis.cc.
| void ignis::writeFile | ( | const std::string | fname | ) |
| void ignis::solveSS | ( | ) |
Solve steady state problem. Uses Sundials Kinsol. It is more robust to solve the unsteady problem to steady state. Solves F(vars) = 0, where vars are the vector of variables at all grid points and F is the equation for each of them. See ignis::Func.
Definition at line 942 of file ignis.cc.
| void ignis::setChi | ( | const double | _chi0 | ) |
| void ignis::solveUnsteady | ( | const double | nTauRun, |
| const int | nSteps, | ||
| const bool | doWriteTime = true, |
||
| const double | Tmin = 0, |
||
| const double | Tmax = 0 |
||
| ) |
Solve unsteady ignis problems. Assumes y, T are initialized Two modes: write on every time step of size dt, or write on temperature steps of size dT. Default is in time --> Tmin, Tmax are zero --> dT = 0
| nTauRun | input: number of characteristic times to solve for. |
| nSteps | input: number of steps to take during the solution. |
| doWriteTime | input: if true (default) then write solution in time |
| Tmin | input: minimum temperature (default is 0, see code) (for stepping to desired T) |
| Tmax | input: maximum temperature (default is 0, see code) (for stepping to desired T) |
Definition at line 1122 of file ignis.cc.
| int ignis::Func | ( | const double * | vars, |
| double * | F | ||
| ) |
System of equations solved by the steady solver, F(vars) = 0
| vars | input: pointer to array of variables at every grid point. |
| F | output: pointer to array of function values for each variable at each grid point 1D vectors are accessed by convenience function Ia(igrid, kvar), as in vars[Ia(i,k)]. |
Definition at line 1008 of file ignis.cc.
| int ignis::rhsf | ( | const double * | vars, |
| double * | dvarsdt | ||
| ) |
Right hand side function for unsteady solver, as in dvar/dt = rhsf(var)
| vars | input: current value of variables at each grid point |
| dvarsdt | output: rate of each variable at each grid point |
Definition at line 1215 of file ignis.cc.
| int ignis::rhsf_flamelet | ( | const double * | vars, |
| double * | dvarsdt | ||
| ) |
Right hand side function for unsteady solver for flamelet equations, as in dvar/dt = rhsf(var)
| vars | input: current value of variables at each grid point |
| dvarsdt | output: rate of each variable at each grid point |
Definition at line 1317 of file ignis.cc.
| void ignis::setQrad | ( | std::vector< double > & | Q | ) |
|
inline |
| void ignis::setDerivative2 | ( | const double | vL, |
| const double | vR, | ||
| const std::vector< double > & | v, | ||
| std::vector< double > & | d2vdx2 | ||
| ) |
Compute second derivative of a profile at cell centers
| vL | input: variable on left face of domain |
| vR | input: variable on right face of domain |
| v | input: variable grid points |
| d2vdx2 | output: derivative on grid points |
Get derivative on faces, then take difference between faces | * | * | * | * |
Definition at line 1568 of file ignis.cc.
| void ignis::setDerivative | ( | const double | vL, |
| const double | vR, | ||
| const std::vector< double > & | v, | ||
| std::vector< double > & | dvdx | ||
| ) |
Compute derivative of a profile at cell centers
| vL | input: variable on left face of domain |
| vR | input: variable on right face of domain |
| v | input: variable grid points |
| dvdx | output: derivative on grid points |
Interpolate variable to faces, then take the derivative between faces | * | * | * | * |
Definition at line 1538 of file ignis.cc.
|
inline |
| size_t ignis::nvar |
| std::vector<std::vector<double> > ignis::y |
| std::vector<std::vector<double> > ignis::sootvars |
| double ignis::Pstore |
| std::vector<std::vector<double> > ignis::ystore |
| std::vector<std::vector<double> > ignis::sootstore |
| std::vector<double> ignis::yRbc |
| double ignis::TRbc |
| double ignis::hRbc |
| double ignis::cpRbc |
| std::vector<double> ignis::hspLbc |
| std::vector<double> ignis::hspRbc |
| std::vector<double> ignis::dx |
| double ignis::Tscale |
| double ignis::hscale |
| std::vector<double> ignis::sootScales |
| std::shared_ptr<Cantera::ThermoPhase> ignis::gas |
| std::shared_ptr<Cantera::Kinetics> ignis::kin |
| std::shared_ptr<Cantera::Transport> ignis::trn |
| std::shared_ptr<streams> ignis::strm |
| bool ignis::doLe1 = false |
| double ignis::Ttarget |
| std::vector<std::vector<double> > ignis::flux_y |
| std::vector<std::vector<double> > ignis::flux_soot |
| bool ignis::isFlamelet = false |
| bool ignis::isPremixed = false |
| bool ignis::doEnergyEqn = true |
| std::shared_ptr<linearInterp> ignis::LI |
| std::vector<double> ignis::Tprof_h |
| std::vector<double> ignis::Tprof_T |
| std::shared_ptr<soot::state> ignis::SMstate |
| std::shared_ptr<HighFive::File> ignis::fh5 |