28 const size_t c_offset_U = 0;
29 const size_t c_offset_V = 1;
30 const size_t c_offset_T = 2;
31 const size_t c_offset_L = 3;
32 const size_t c_offset_Y = 4;
35 const int c_Mixav_Transport = 0;
36 const int c_Multi_Transport = 1;
37 const int c_Soret = 2;
73 virtual void setupGrid(
size_t n,
const doublereal* z);
78 Kinetics& kinetics() {
100 void enableSoret(
bool withSoret);
101 bool withSoret()
const {
114 virtual void setState(
size_t point,
const doublereal* state,
117 for (
size_t k = 0; k < m_nsp; k++) {
126 for (
size_t j = 0; j < m_points; j++) {
128 for (
size_t k = 0; k < m_nsp; k++) {
129 x[index(4+k,j)] =
Y_fixed(k,j);
134 virtual void _finalize(
const doublereal* x);
153 m_do_energy[j] =
false;
164 m_do_species[k] =
true;
170 return m_fixedtemp[j];
175 doublereal
Y_fixed(
size_t k,
size_t j)
const {
176 return m_fixedy(k,j);
182 size_t componentIndex(std::string name)
const;
195 virtual void save(
XML_Node& o,
const doublereal*
const sol);
197 virtual void restore(
const XML_Node& dom, doublereal* soln);
200 virtual std::string flowType() {
204 void solveEnergyEqn(
size_t j=
npos) {
206 for (
size_t i = 0; i < m_points; i++) {
207 m_do_energy[i] =
true;
210 m_do_energy[j] =
true;
212 m_refiner->setActive(0,
true);
213 m_refiner->setActive(1,
true);
214 m_refiner->setActive(2,
true);
218 void fixTemperature(
size_t j=
npos) {
220 for (
size_t i = 0; i < m_points; i++) {
221 m_do_energy[i] =
false;
224 m_do_energy[j] =
false;
226 m_refiner->setActive(0,
false);
227 m_refiner->setActive(1,
false);
228 m_refiner->setActive(2,
false);
232 bool doSpecies(
size_t k) {
233 return m_do_species[k];
235 bool doEnergy(
size_t j) {
236 return m_do_energy[j];
239 void solveSpecies(
size_t k=
npos) {
241 for (
size_t i = 0; i < m_nsp; i++) {
242 m_do_species[i] =
true;
245 m_do_species[k] =
true;
250 void fixSpecies(
size_t k=
npos) {
252 for (
size_t i = 0; i < m_nsp; i++) {
253 m_do_species[i] =
false;
256 m_do_species[k] =
false;
261 void integrateChem(doublereal* x,doublereal dt);
263 void resize(
size_t components,
size_t points);
265 virtual void setFixedPoint(
int j0, doublereal t0) {}
268 void setJac(MultiJac* jac);
269 void setGas(
const doublereal* x,
size_t j);
272 doublereal density(
size_t j)
const {
276 virtual bool fixed_mdot() {
279 void setViscosityFlag(
bool dovisc) {
285 doublereal component(
const doublereal* x,
size_t i,
size_t j)
const {
286 doublereal xx = x[index(i,j)];
290 doublereal conc(
const doublereal* x,
size_t k,
size_t j)
const {
291 return Y(x,k,j)*density(j)/m_wt[k];
294 doublereal cbar(
const doublereal* x,
size_t k,
size_t j)
const {
298 doublereal wdot(
size_t k,
size_t j)
const {
313 for (
size_t j = j0; j <= j1; j++) {
315 m_rho[j] = m_thermo->
density();
326 doublereal cdif2(
const doublereal* x,
size_t n,
size_t j,
327 const doublereal* f)
const {
328 doublereal c1 = (f[j] + f[j-1])*(x[index(n,j)] - x[index(n,j-1)]);
329 doublereal c2 = (f[j+1] + f[j])*(x[index(n,j+1)] - x[index(n,j)]);
330 return (c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1));
339 doublereal T(
const doublereal* x,
size_t j)
const {
340 return x[index(c_offset_T, j)];
342 doublereal& T(doublereal* x,
size_t j) {
343 return x[index(c_offset_T, j)];
345 doublereal T_prev(
size_t j)
const {
349 doublereal rho_u(
const doublereal* x,
size_t j)
const {
350 return m_rho[j]*x[index(c_offset_U, j)];
353 doublereal u(
const doublereal* x,
size_t j)
const {
354 return x[index(c_offset_U, j)];
357 doublereal V(
const doublereal* x,
size_t j)
const {
358 return x[index(c_offset_V, j)];
360 doublereal V_prev(
size_t j)
const {
364 doublereal lambda(
const doublereal* x,
size_t j)
const {
365 return x[index(c_offset_L, j)];
368 doublereal Y(
const doublereal* x,
size_t k,
size_t j)
const {
369 return x[index(c_offset_Y + k, j)];
372 doublereal& Y(doublereal* x,
size_t k,
size_t j) {
373 return x[index(c_offset_Y + k, j)];
376 doublereal Y_prev(
size_t k,
size_t j)
const {
380 doublereal X(
const doublereal* x,
size_t k,
size_t j)
const {
381 return m_wtm[j]*Y(x,k,j)/m_wt[k];
384 doublereal flux(
size_t k,
size_t j)
const {
392 doublereal dVdz(
const doublereal* x,
size_t j)
const {
393 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
394 return (V(x,jloc) - V(x,jloc-1))/m_dz[jloc-1];
397 doublereal dYdz(
const doublereal* x,
size_t k,
size_t j)
const {
398 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
399 return (Y(x,k,jloc) - Y(x,k,jloc-1))/m_dz[jloc-1];
402 doublereal dTdz(
const doublereal* x,
size_t j)
const {
403 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
404 return (T(x,jloc) - T(x,jloc-1))/m_dz[jloc-1];
407 doublereal shear(
const doublereal* x,
size_t j)
const {
408 doublereal c1 = m_visc[j-1]*(V(x,j) - V(x,j-1));
409 doublereal c2 = m_visc[j]*(V(x,j+1) - V(x,j));
410 return 2.0*(c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1));
413 doublereal divHeatFlux(
const doublereal* x,
size_t j)
const {
414 doublereal c1 = m_tcon[j-1]*(T(x,j) - T(x,j-1));
415 doublereal c2 = m_tcon[j]*(T(x,j+1) - T(x,j));
416 return -2.0*(c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1));
419 size_t mindex(
size_t k,
size_t j,
size_t m) {
420 return m*m_nsp*m_nsp + m_nsp*j + k;
433 doublereal m_inlet_u;
434 doublereal m_inlet_V;
435 doublereal m_inlet_T;
436 doublereal m_rho_inlet;
440 doublereal m_surface_T;
471 IdealGasPhase* m_thermo;
480 std::vector<bool> m_do_energy;
482 std::vector<bool> m_do_species;
483 int m_transport_option;
515 virtual void eval(
size_t j, doublereal* x, doublereal* r,
516 integer* mask, doublereal rdt);
517 virtual std::string flowType() {
518 return "Axisymmetric Stagnation";
534 virtual void eval(
size_t j, doublereal* x, doublereal* r,
535 integer* mask, doublereal rdt);
536 virtual std::string flowType() {
539 virtual bool fixed_mdot() {
565 size_t size_new, doublereal* newSoln,
IdealGasPhase& newmech);