26 #define SAFE_DELETE(x) if (x) { delete (x); x = 0; }
33 SimpleTransport::SimpleTransport(
thermo_t* thermo,
int ndim) :
36 compositionDepType_(0),
37 useHydroRadius_(false),
48 m_visc_temp_ok(false),
50 m_diff_temp_ok(false),
51 m_cond_temp_ok(false),
60 compositionDepType_(0),
61 useHydroRadius_(false),
71 m_visc_temp_ok(false),
73 m_diff_temp_ok(false),
74 m_cond_temp_ok(false),
163 return (dynamic_cast<Transport*>(tr));
199 if (phaseNode.
hasChild(
"transport")) {
201 string transportModel = transportNode.
attrib(
"model");
202 if (transportModel ==
"Simple") {
208 std::string modelName =
"";
212 if (modelName ==
"solvent_only") {
214 }
else if (modelName ==
"mixture_averaged") {
217 throw CanteraError(
"SimpleTransport::initLiquid",
"Unknown compositionDependence Model: " + modelName);
257 for (
size_t k = 0; k <
m_nsp; k++) {
288 for (
size_t k = 0; k <
m_nsp; k++) {
330 for (
size_t k = 0; k <
m_nsp; k++) {
370 "Neither diffusivity nor hydroradius is set for species " + spName);
382 for (
size_t k = 0; k <
m_nsp; k++) {
444 for (
size_t k = 0; k <
m_nsp; k++) {
472 for (
size_t i = 0; i <
m_nsp; i++) {
473 for (
size_t j = 0; j <
m_nsp; j++) {
475 d[i*m_nsp+j] = bdiff;
500 for (
size_t k = 0; k <
m_nsp; k++) {
527 for (
size_t k = 0; k <
m_nsp; k++) {
535 for (
size_t a = 0; a <
m_nDim; a++) {
537 if (fabs(grad_V[a]) > 1.0E-13) {
545 for (
size_t a = 0; a <
m_nDim; a++) {
553 for (
size_t i = 0; i < itop; i++) {
588 for (
size_t k = 0; k <
m_nsp; k++) {
606 for (
size_t k = 0; k <
m_nsp; k++) {
637 const doublereal* grad_T,
639 const doublereal* grad_X,
650 for (
size_t n = 0; n <
m_nDim; n++) {
651 for (
size_t k = 0; k <
m_nsp; k++) {
652 if (y[k] > 1.0E-200) {
653 Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
655 Vdiff[n * m_nsp + k] = 0.0;
688 int ldx,
const doublereal* grad_X,
689 int ldf,
const doublereal* grad_Phi,
700 for (
size_t n = 0; n <
m_nDim; n++) {
701 for (
size_t k = 0; k <
m_nsp; k++) {
702 if (y[k] > 1.0E-200) {
703 Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
705 Vdiff[n * m_nsp + k] = 0.0;
741 size_t ldx,
const doublereal*
const grad_X,
742 size_t ldf, doublereal*
const fluxes)
778 AssertThrow(ldf >=
m_nsp ,
"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp");
794 for (
size_t n = 0; n <
m_nDim; n++) {
796 for (
size_t k = 0; k <
m_nsp; k++) {
797 fluxes[n*ldf + k] = - concTotal * mw[k] *
m_spwork[k] *
799 rhoVc[n] += fluxes[n*ldf + k];
803 for (
size_t n = 0; n <
m_nDim; n++) {
805 for (
size_t k = 0; k <
m_nsp; k++) {
806 fluxes[n*ldf + k] = - concTotal * mw[k] *
m_spwork[k] *
m_Grad_X[n*m_nsp + k];
807 rhoVc[n] += fluxes[n*ldf + k];
813 for (
size_t n = 0; n <
m_nDim; n++) {
815 for (
size_t k = 0; k <
m_nsp; k++) {
816 rhoVc[n] += fluxes[n*ldf + k];
819 for (
size_t n = 0; n <
m_nDim; n++) {
820 for (
size_t k = 0; k <
m_nsp; k++) {
821 fluxes[n*ldf + k] -= y[k] *
rhoVc[n];
825 for (
size_t n = 0; n <
m_nDim; n++) {
827 for (
size_t k = 0; k <
m_nsp; k++) {
828 rhoVc[n] += fluxes[n*ldf + k] / mw[k];
831 for (
size_t n = 0; n <
m_nDim; n++) {
832 for (
size_t k = 0; k <
m_nsp; k++) {
837 for (
size_t n = 0; n <
m_nDim; n++) {
839 for (
size_t k = 0; k <
m_nsp; k++) {
840 rhoVc[n] += fluxes[n*ldf + k] / mw[k];
843 for (
size_t n = 0; n <
m_nDim; n++) {
844 for (
size_t k = 0; k <
m_nsp; k++) {
851 throw CanteraError(
"SimpleTransport::getSpeciesFluxesExt()",
852 "unknown velocity basis");
868 for (
size_t k = 0; k <
m_nsp; k++) {
902 for (
size_t k = 0; k <
m_nsp; k++) {
932 for (
size_t k = 0; k <
m_nsp; k++) {
948 for (
size_t k = 0; k <
m_nsp; k++) {
953 for (
size_t k = 0; k <
m_nsp; k++) {
980 for (
size_t k = 0; k <
m_nsp; k++) {
996 "negative temperature "+
fp2str(t));
1024 "\n\n\n**** Method "+ msg +
" not implemented in model "
1026 "(Did you forget to specify a transport model?)\n\n\n");