[1D] split updateProperties and add evalResidual
This commit is contained in:
parent
a8cbfd2c41
commit
2472e080c3
4 changed files with 21 additions and 17 deletions
|
|
@ -79,9 +79,8 @@ public:
|
|||
vector_fp& mobi_e_fixed);
|
||||
|
||||
protected:
|
||||
virtual void updateProperties(size_t jg, double* x, double* rsd,
|
||||
int* diag, double rdt, size_t j0,
|
||||
size_t j1, size_t jmin, size_t jmax);
|
||||
virtual void evalResidual(double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax);
|
||||
virtual void updateTransport(double* x, size_t j0, size_t j1);
|
||||
virtual void updateDiffFluxes(const double* x, size_t j0, size_t j1);
|
||||
//! Solving phase one: the fluxes of charged species are turned off
|
||||
|
|
|
|||
|
|
@ -242,9 +242,11 @@ protected:
|
|||
m_kin->getNetProductionRates(&m_wdot(0,j));
|
||||
}
|
||||
|
||||
virtual void updateProperties(size_t jg, double* x, double* rsd,
|
||||
int* diag, double rdt, size_t j0,
|
||||
size_t j1, size_t jmin, size_t jmax);
|
||||
virtual void updateProperties(size_t jg, double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax);
|
||||
|
||||
virtual void evalResidual(double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax);
|
||||
|
||||
/**
|
||||
* Update the thermodynamic properties from point j0 to point j1
|
||||
|
|
|
|||
|
|
@ -230,11 +230,10 @@ void IonFlow::setElectricPotential(const double v1, const double v2)
|
|||
m_outletVoltage = v2;
|
||||
}
|
||||
|
||||
void IonFlow::updateProperties(size_t jg, double* x, double* rsd,
|
||||
int* diag, double rdt, size_t j0,
|
||||
size_t j1, size_t jmin, size_t jmax)
|
||||
void IonFlow::evalResidual(double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax)
|
||||
{
|
||||
StFlow::updateProperties(jg, x, rsd, diag, rdt, j0, j1, jmin, jmax);
|
||||
StFlow::evalResidual(x, rsd, diag, rdt, jmin, jmax);
|
||||
if (m_stage != 3) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,17 +240,17 @@ void StFlow::eval(size_t jg, doublereal* xg,
|
|||
jmax = std::min(jpt+1,m_points-1);
|
||||
}
|
||||
|
||||
updateProperties(jg, x, rsd, diag, rdt, jmin, jmax);
|
||||
evalResidual(x, rsd, diag, rdt, jmin, jmax);
|
||||
}
|
||||
|
||||
void StFlow::updateProperties(size_t jg, double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax)
|
||||
{
|
||||
// properties are computed for grid points from j0 to j1
|
||||
size_t j0 = std::max<size_t>(jmin, 1) - 1;
|
||||
size_t j1 = std::min(jmax+1,m_points-1);
|
||||
|
||||
updateProperties(jg, x, rsd, diag, rdt, j0, j1, jmin, jmax);
|
||||
}
|
||||
|
||||
void StFlow::updateProperties(size_t jg, double* x, double* rsd,
|
||||
int* diag, double rdt, size_t j0,
|
||||
size_t j1, size_t jmin, size_t jmax)
|
||||
{
|
||||
updateThermo(x, j0, j1);
|
||||
if (jg == npos || m_force_full_update) {
|
||||
// update transport properties only if a Jacobian is not being
|
||||
|
|
@ -267,7 +267,11 @@ void StFlow::updateProperties(size_t jg, double* x, double* rsd,
|
|||
// update the species diffusive mass fluxes whether or not a
|
||||
// Jacobian is being evaluated
|
||||
updateDiffFluxes(x, j0, j1);
|
||||
}
|
||||
|
||||
void StFlow::evalResidual(double* x, double* rsd, int* diag,
|
||||
double rdt, size_t jmin, size_t jmax)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// evaluate the residual equations at all required
|
||||
// grid points
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue