StFlow.cpp Source File#
StFlow.cpp
Go to the documentation of this file.
Header file defining class TransportFactory (see TransportFactory)
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
const AnyValue & getMetadata(const string &key) const
Get a value from the metadata applicable to the AnyMap tree containing this node.
Definition AnyMap.cpp:580
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
double getDouble(const string &key, double default_) const
If key exists, return it as a double, otherwise return default_.
Definition AnyMap.cpp:1520
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
const string & getString(const string &key, const string &default_) const
If key exists, return it as a string, otherwise return default_.
Definition AnyMap.cpp:1530
A wrapper for a variable whose type is determined at runtime.
Definition AnyMap.h:86
bool isScalar() const
Returns true if the held value is a scalar type (such as double, long int, string,...
Definition AnyMap.cpp:651
const vector< T > & asVector(size_t nMin=npos, size_t nMax=npos) const
Return the held value, if it is a vector of type T.
Definition AnyMap.inl.h:109
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
Definition Array.h:203
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Definition Array.cpp:47
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
size_t lastPoint() const
The index of the last (that is, right-most) grid point belonging to this domain.
Definition Domain1D.h:400
shared_ptr< Solution > m_solution
Composite thermo/kinetics/transport handler.
Definition Domain1D.h:567
virtual void resize(size_t nv, size_t np)
Resize the domain to have nv components and np grid points.
Definition Domain1D.cpp:26
size_t firstPoint() const
The index of the first (that is, left-most) grid point belonging to this domain.
Definition Domain1D.h:392
void needJacUpdate()
Set this if something has changed in the governing equations (for example, the value of a constant ha...
Definition Domain1D.cpp:95
virtual size_t loc(size_t j=0) const
Location of the start of the local solution vector in the global solution vector,.
Definition Domain1D.h:384
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
virtual void setMassFractions_NoNorm(const double *const y)
Set the mass fractions to the specified values without normalizing.
Definition Phase.cpp:355
virtual void setPressure(double p)
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition Phase.h:616
const vector< double > & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Definition Phase.cpp:395
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:129
virtual void setTemperature(double temp)
Set the internally stored temperature of the phase (K).
Definition Phase.h:623
virtual void setMassFractions(const double *const y)
Set the mass fractions to the specified values and normalize them.
Definition Phase.cpp:341
A container class holding arrays of state information.
Definition SolutionArray.h:33
void setLoc(int loc, bool restore=true)
Update the buffered location used to access SolutionArray entries.
Definition SolutionArray.cpp:739
AnyValue getComponent(const string &name) const
Retrieve a component of the SolutionArray by name.
Definition SolutionArray.cpp:640
bool hasComponent(const string &name) const
Check whether SolutionArray contains a component.
Definition SolutionArray.cpp:622
shared_ptr< ThermoPhase > thermo()
Retrieve associated ThermoPhase object.
Definition SolutionArray.cpp:534
static shared_ptr< SolutionArray > create(const shared_ptr< Solution > &sol, int size=0, const AnyMap &meta={})
Instantiate a new SolutionArray reference.
Definition SolutionArray.h:51
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
Definition StFlow.h:45
void eval(size_t jGlobal, double *xGlobal, double *rsdGlobal, integer *diagGlobal, double rdt) override
Evaluate the residual functions for axisymmetric stagnation flow.
Definition StFlow.cpp:296
size_t m_kExcessLeft
Index of species with a large mass fraction at each boundary, for which the mass fraction may be calc...
Definition StFlow.h:657
void setTransport(shared_ptr< Transport > trans) override
Set transport model to existing instance.
Definition StFlow.cpp:140
void setKinetics(shared_ptr< Kinetics > kin) override
Set the kinetics manager.
Definition StFlow.cpp:134
void resetBadValues(double *xg) override
When called, this function should reset "bad" values in the state vector such as negative species con...
Definition StFlow.cpp:201
size_t rightExcessSpecies() const
Index of the species on the right boundary with the largest mass fraction.
Definition StFlow.h:311
virtual void evalMomentum(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the momentum equation residual.
Definition StFlow.cpp:462
void updateThermo(const double *x, size_t j0, size_t j1)
Update the thermodynamic properties from point j0 to point j1 (inclusive), based on solution x.
Definition StFlow.h:483
void resize(size_t components, size_t points) override
Change the grid size. Called after grid refinement.
Definition StFlow.cpp:160
StFlow(ThermoPhase *ph=0, size_t nsp=1, size_t points=1)
Create a new flow domain.
Definition StFlow.cpp:19
virtual void evalContinuity(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the continuity equation residual.
Definition StFlow.cpp:405
void setBoundaryEmissivities(double e_left, double e_right)
Set the emissivities for the boundary values.
Definition StFlow.cpp:979
virtual void evalEnergy(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the energy equation residual.
Definition StFlow.cpp:522
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
Definition StFlow.cpp:805
size_t componentIndex(const string &name) const override
index of component with name name.
Definition StFlow.cpp:719
void setGas(const double *x, size_t j)
Set the gas object state to be consistent with the solution at point j.
Definition StFlow.cpp:229
virtual bool componentActive(size_t n) const
Returns true if the specified component is an active part of the solver state.
Definition StFlow.cpp:742
virtual bool doElectricField(size_t j) const
Retrieve flag indicating whether electric field is solved or not (used by IonFlow specialization)
Definition StFlow.cpp:973
virtual void evalSpecies(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the species equations' residuals.
Definition StFlow.cpp:560
void setupGrid(size_t n, const double *z) override
called to set up initial grid, and after grid refinement
Definition StFlow.cpp:186
size_t leftExcessSpecies() const
Index of the species on the left boundary with the largest mass fraction.
Definition StFlow.h:306
Array2D m_dhk_dz
Array of size m_nsp by m_points-1 for saving enthalpy fluxes.
Definition StFlow.h:618
virtual void evalElectricField(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the electric field equation residual to be zero everywhere.
Definition StFlow.cpp:599
void _finalize(const double *x) override
In some cases, a domain may need to set parameters that depend on the initial solution estimate.
Definition StFlow.cpp:249
virtual size_t getSolvingStage() const
Get the solving stage (used by IonFlow specialization)
Definition StFlow.cpp:949
virtual void evalLambda(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the lambda equation residual.
Definition StFlow.cpp:494
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
Definition StFlow.cpp:839
virtual void updateDiffFluxes(const double *x, size_t j0, size_t j1)
Update the diffusive mass fluxes.
Definition StFlow.cpp:655
string componentName(size_t n) const override
Name of the nth component. May be overloaded.
Definition StFlow.cpp:697
void setGasAtMidpoint(const double *x, size_t j)
Set the gas state to be consistent with the solution at the midpoint between j and j + 1.
Definition StFlow.cpp:237
virtual void grad_hk(const double *x, size_t j)
Get the gradient of species specific molar enthalpies.
Definition StFlow.cpp:1017
void computeRadiation(double *x, size_t jmin, size_t jmax)
Computes the radiative heat loss vector over points jmin to jmax and stores the data in the qdotRadia...
Definition StFlow.cpp:358
virtual void updateProperties(size_t jg, double *x, size_t jmin, size_t jmax)
Update the properties (thermo, transport, and diffusion flux).
Definition StFlow.cpp:334
virtual void setSolvingStage(const size_t stage)
Solving stage mode for handling ionized species (used by IonFlow specialization)
Definition StFlow.cpp:955
virtual void fixElectricField(size_t j=npos)
Set to fix voltage in a point (used by IonFlow specialization)
Definition StFlow.cpp:967
virtual void updateTransport(double *x, size_t j0, size_t j1)
Update the transport properties at grid points in the range from j0 to j1, based on solution x.
Definition StFlow.cpp:608
virtual void solveElectricField(size_t j=npos)
Set to solve electric field in a point (used by IonFlow specialization)
Definition StFlow.cpp:961
void _getInitialSoln(double *x) override
Write the initial solution estimate into array x.
Definition StFlow.cpp:220
vector< size_t > m_kRadiating
Indices within the ThermoPhase of the radiating species.
Definition StFlow.h:635
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
virtual double maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
Definition ThermoPhase.h:504
const AnyMap & input() const
Access input data associated with the phase description.
Definition ThermoPhase.cpp:1152
virtual void getThermalDiffCoeffs(double *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
Definition Transport.h:271
virtual string transportModel() const
Identifies the model represented by this Transport object.
Definition Transport.h:93
virtual void getMixDiffCoeffs(double *const d)
Returns a vector of mixture averaged diffusion coefficients.
Definition Transport.h:315
virtual double thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
Definition Transport.h:155
virtual void getMultiDiffCoeffs(const size_t ld, double *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
Definition Transport.h:300
Header for a file containing miscellaneous numerical functions.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
Definition global.h:175
double linearInterp(double x, const vector< double > &xpts, const vector< double > &fpts)
Linearly interpolate a function defined on a discrete grid.
Definition funcs.cpp:13
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition global.h:267
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
Definition ct_defs.h:164
Generated by 1.9.7