diff --git a/applications/solvers/df0DFoam/createFields.H b/applications/solvers/df0DFoam/createFields.H index d4b73c372..0d648ed84 100644 --- a/applications/solvers/df0DFoam/createFields.H +++ b/applications/solvers/df0DFoam/createFields.H @@ -6,7 +6,7 @@ Info<< "Reading thermophysical properties\n" << endl; fluidThermo* pThermo = new heRhoThermo(mesh, word::null); fluidThermo& thermo = *pThermo; -thermo.validate(args.executable(), "ha"); +// thermo.validate(args.executable(), "ha"); volScalarField& p = thermo.p(); @@ -94,6 +94,8 @@ dfChemistryModel chemistry(thermo); PtrList& Y = chemistry.Y(); const word inertSpecie(chemistry.lookup("inertSpecie")); const label inertIndex(chemistry.species()[inertSpecie]); +chemistry.setEnergyName("ha"); +chemistry.updateEnergy(); forAll(Y, i) { diff --git a/applications/solvers/dfHighSpeedFoam/createFields.H b/applications/solvers/dfHighSpeedFoam/createFields.H index dcf09e117..ddffc838e 100644 --- a/applications/solvers/dfHighSpeedFoam/createFields.H +++ b/applications/solvers/dfHighSpeedFoam/createFields.H @@ -29,7 +29,7 @@ dictionary thermoDict ) ); -bool inviscid(thermoDict.lookup("inviscid")); +bool inviscid(thermoDict.lookupOrDefault("inviscid",false)); Info<< "Reading field U\n" << endl; volVectorField U @@ -58,9 +58,6 @@ volScalarField rho thermo.rho() ); -volScalarField e = thermo.he() - p/rho; -volScalarField& ha = thermo.he(); - volVectorField rhoU ( IOobject @@ -74,19 +71,6 @@ volVectorField rhoU rho*U ); -volScalarField rhoE -( - IOobject - ( - "rhoE", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - rho*(e + 0.5*magSqr(U)) -); - surfaceScalarField pos ( IOobject @@ -140,6 +124,22 @@ const label inertIndex(chemistry->species()[inertSpecie]); chemistry->setEnergyName("ea"); chemistry->updateEnergy(); +volScalarField& ea = thermo.he(); +volScalarField ha = ea + p/rho; + +volScalarField rhoE +( + IOobject + ( + "rhoE", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho*(ea + 0.5*magSqr(U)) +); + chemistry->correctThermo(); Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl; @@ -149,6 +149,28 @@ forAll(Y, i) } fields.add(thermo.he()); +const label nspecies(chemistry->species().size()); +PtrList rhoYi(nspecies); +forAll(rhoYi,i) +{ + rhoYi.set + ( + i, + new volScalarField + ( + IOobject + ( + "rhoYi" + Y[i].name(), + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho*Y[i] + ) + ); +} + const scalar Sct = chemistry->lookupOrDefault("Sct", 1.); volScalarField diffAlphaD ( diff --git a/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C b/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C index ee59f7f68..67254ec4d 100644 --- a/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C +++ b/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C @@ -132,6 +132,48 @@ int main(int argc, char *argv[]) surfaceScalarField rho_pos(interpolate(rho, pos)); surfaceScalarField rho_neg(interpolate(rho, neg)); + PtrList rhoYi_pos(nspecies); + PtrList rhoYi_neg(nspecies); + forAll(rhoYi_pos,i) + { + rhoYi_pos.set + ( + i, + new surfaceScalarField + ( + IOobject + ( + "rhoYi_pos" + Y[i].name(), + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + interpolate(rhoYi[i], pos,"Yi") + ) + ); + } + + forAll(rhoYi_neg,i) + { + rhoYi_neg.set + ( + i, + new surfaceScalarField + ( + IOobject + ( + "rhoYi_neg" + Y[i].name(), + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + interpolate(rhoYi[i], neg,"Yi") + ) + ); + } + surfaceVectorField rhoU_pos(interpolate(rhoU, pos, U.name())); surfaceVectorField rhoU_neg(interpolate(rhoU, neg, U.name())); @@ -139,8 +181,8 @@ int main(int argc, char *argv[]) surfaceScalarField rPsi_pos(interpolate(rPsi, pos, T.name())); surfaceScalarField rPsi_neg(interpolate(rPsi, neg, T.name())); - surfaceScalarField e_pos(interpolate(e, pos, T.name())); - surfaceScalarField e_neg(interpolate(e, neg, T.name())); + surfaceScalarField ea_pos(interpolate(ea, pos, T.name())); + surfaceScalarField ea_neg(interpolate(ea, neg, T.name())); surfaceVectorField U_pos("U_pos", rhoU_pos/rho_pos); surfaceVectorField U_neg("U_neg", rhoU_neg/rho_neg); @@ -217,6 +259,27 @@ int main(int argc, char *argv[]) phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg; + PtrList phiYi(nspecies); + forAll(phiYi,i) + { + phiYi.set + ( + i, + new surfaceScalarField + ( + IOobject + ( + "phiYi_" + Y[i].name(), + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + aphiv_pos*rhoYi_pos[i] + aphiv_neg*rhoYi_neg[i] + ) + ); + } + surfaceVectorField phiUp ( (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) @@ -226,8 +289,8 @@ int main(int argc, char *argv[]) surfaceScalarField phiEp ( "phiEp", - aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) - + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) + aphiv_pos*(rho_pos*(ea_pos + 0.5*magSqr(U_pos)) + p_pos) + + aphiv_neg*(rho_neg*(ea_neg + 0.5*magSqr(U_neg)) + p_neg) + aSf*p_pos - aSf*p_neg ); diff --git a/applications/solvers/dfHighSpeedFoam/rhoEEqn.H b/applications/solvers/dfHighSpeedFoam/rhoEEqn.H index a4b4987cc..532d064d1 100644 --- a/applications/solvers/dfHighSpeedFoam/rhoEEqn.H +++ b/applications/solvers/dfHighSpeedFoam/rhoEEqn.H @@ -15,31 +15,31 @@ solve - fvc::div(sigmaDotU) ); -e = rhoE/rho - 0.5*magSqr(U); -e.correctBoundaryConditions(); +ea = rhoE/rho - 0.5*magSqr(U); +ea.correctBoundaryConditions(); -ha = e + p/rho; +ha = ea + p/rho; chemistry->correctThermo(); // before this, we must update ha = e + p/rho -rhoE.boundaryFieldRef() == rho.boundaryField()*(e.boundaryField() + 0.5*magSqr(U.boundaryField())); +rhoE.boundaryFieldRef() == rho.boundaryField()*(ea.boundaryField() + 0.5*magSqr(U.boundaryField())); if (!inviscid) { fvScalarMatrix eEqn ( - fvm::ddt(rho, e) - fvc::ddt(rho, e) + fvm::ddt(rho, ea) - fvc::ddt(rho, ea) // alpha in deepflame is considered to calculate h by default (kappa/Cp), so multiply gamma to correct alpha - - fvm::laplacian(turbulence->alphaEff()*thermo.gamma(), e) + - fvm::laplacian(turbulence->alphaEff()*thermo.gamma(), ea) + diffAlphaD == fvc::div(hDiffCorrFlux) ); - eEqn.solve("e"); + eEqn.solve("ea"); - ha = e + p/rho; + ha = ea + p/rho; chemistry->correctThermo(); - rhoE = rho*(e + 0.5*magSqr(U)); + rhoE = rho*(ea + 0.5*magSqr(U)); } Info<< "min/max(T) = " diff --git a/applications/solvers/dfHighSpeedFoam/rhoYEqn.H b/applications/solvers/dfHighSpeedFoam/rhoYEqn.H index 288d52e96..46b0c9a94 100644 --- a/applications/solvers/dfHighSpeedFoam/rhoYEqn.H +++ b/applications/solvers/dfHighSpeedFoam/rhoYEqn.H @@ -37,32 +37,63 @@ tmp> mvConvection { volScalarField& Yi = Y[i]; + if (!inviscid) + { + hDiffCorrFlux += chemistry->hai(i)*(chemistry->rhoD(i)*fvc::grad(Yi) - Yi*sumYDiffError); + diffAlphaD += fvc::laplacian(thermo.alpha()*chemistry->hai(i), Yi); + } + if (i != inertIndex) { - fvScalarMatrix YiEqn + // original convection term + // fvScalarMatrix YiEqn + // ( + // fvm::ddt(rho, Yi) + // + mvConvection->fvmDiv(phi, Yi) + // == + // combustion->R(Yi) + // ); + + solve ( - fvm::ddt(rho, Yi) - + mvConvection->fvmDiv(phi, Yi) - == - combustion->R(Yi) + fvm::ddt(rhoYi[i]) + + fvc::div(phiYi[i]) + == + chemistry->RR(i) ); + Yi=rhoYi[i]/rho; + Yi.max(0.0); + if (!inviscid) { const surfaceScalarField phiUc = linearInterpolate(sumYDiffError) & mesh.Sf(); - - hDiffCorrFlux += chemistry->hai(i)*(chemistry->rhoD(i)*fvc::grad(Yi) - Yi*sumYDiffError); - diffAlphaD += fvc::laplacian(thermo.alpha()*chemistry->hai(i), Yi); tmp DEff = chemistry->rhoD(i) + turbulence->mut()/Sct; - YiEqn -= fvm::laplacian(DEff(), Yi) - mvConvection->fvmDiv(phiUc, Yi); - } + // original term + // YiEqn -= fvm::laplacian(DEff(), Yi) - mvConvection->fvmDiv(phiUc, Yi); - YiEqn.relax(); + fvScalarMatrix YiEqn + ( + fvm::ddt(rho, Yi) - fvc::ddt(rho, Yi) + - fvm::laplacian(DEff(), Yi) + + mvConvection->fvmDiv(phiUc, Yi) + ); - YiEqn.solve("Yi"); + YiEqn.relax(); - Yi.max(0.0); + YiEqn.solve("Yi"); + + Yi.max(0.0); + + } + + // original term + // YiEqn.relax(); + // YiEqn.solve("Yi"); + // Yi.max(0.0); + + rhoYi[i] = rho*Yi; Yt += Yi; } } diff --git a/applications/solvers/dfLowMachFoam/EEqn.H b/applications/solvers/dfLowMachFoam/EEqn.H index 7d360e59e..d72cc335a 100644 --- a/applications/solvers/dfLowMachFoam/EEqn.H +++ b/applications/solvers/dfLowMachFoam/EEqn.H @@ -25,7 +25,7 @@ EEqn.relax(); - EEqn.solve(); + EEqn.solve("ha"); } diff --git a/applications/solvers/dfLowMachFoam/createFields.H b/applications/solvers/dfLowMachFoam/createFields.H index 065d301e9..9e750c334 100644 --- a/applications/solvers/dfLowMachFoam/createFields.H +++ b/applications/solvers/dfLowMachFoam/createFields.H @@ -5,7 +5,7 @@ Info<< "Reading thermophysical properties\n" << endl; // fluidThermo* pThermo = new hePsiThermo(mesh, word::null); fluidThermo* pThermo = new heRhoThermo(mesh, word::null); fluidThermo& thermo = *pThermo; -thermo.validate(args.executable(), "ha"); +// thermo.validate(args.executable(), "ha"); const volScalarField& psi = thermo.psi(); volScalarField& p = thermo.p(); @@ -89,6 +89,8 @@ dfChemistryModel* chemistry = combustion->chemistry(); PtrList& Y = chemistry->Y(); const word inertSpecie(chemistry->lookup("inertSpecie")); const label inertIndex(chemistry->species()[inertSpecie]); +chemistry->setEnergyName("ha"); +chemistry->updateEnergy(); chemistry->correctThermo(); diff --git a/applications/solvers/dfLowMachFoam/dfLowMachFoam.C b/applications/solvers/dfLowMachFoam/dfLowMachFoam.C index ec13c4e5b..f00c7e88c 100644 --- a/applications/solvers/dfLowMachFoam/dfLowMachFoam.C +++ b/applications/solvers/dfLowMachFoam/dfLowMachFoam.C @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) rho = thermo.rho(); runTime.write(); - + Info<< "========Time Spent in diffenet parts========"<< endl; Info<< "Chemical sources = " << time_monitor_chem << " s" << endl; Info<< "Species Equations = " << time_monitor_Y << " s" << endl; diff --git a/applications/solvers/dfSprayFoam/EEqn.H b/applications/solvers/dfSprayFoam/EEqn.H index fae20487a..fceb1b44c 100644 --- a/applications/solvers/dfSprayFoam/EEqn.H +++ b/applications/solvers/dfSprayFoam/EEqn.H @@ -48,7 +48,7 @@ //fvOptions.constrain(EEqn); - EEqn.solve(); + EEqn.solve("ha"); //fvOptions.correct(he); diff --git a/applications/solvers/dfSprayFoam/createFields.H b/applications/solvers/dfSprayFoam/createFields.H index fbcd635f2..3c33fce70 100644 --- a/applications/solvers/dfSprayFoam/createFields.H +++ b/applications/solvers/dfSprayFoam/createFields.H @@ -4,7 +4,7 @@ Info<< "Reading thermophysical properties\n" << endl; // fluidThermo* pThermo = new hePsiThermo(mesh, word::null); fluidThermo* pThermo = new heRhoThermo(mesh, word::null); fluidThermo& thermo = *pThermo; -thermo.validate(args.executable(), "ha"); +// thermo.validate(args.executable(), "ha"); SLGThermo slgThermo(mesh, thermo); @@ -88,6 +88,8 @@ dfChemistryModel* chemistry = combustion->chemistry(); PtrList& Y = chemistry->Y(); const word inertSpecie(chemistry->lookup("inertSpecie")); const label inertIndex(chemistry->species()[inertSpecie]); +chemistry->setEnergyName("ha"); +chemistry->updateEnergy(); chemistry->correctThermo(); diff --git a/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/inference.py b/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/inference.py index a4181c1f6..0aec93c8a 100644 --- a/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/inference.py +++ b/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/inference.py @@ -1,3 +1,4 @@ +print ("Entering the first line") from builtins import Exception, print from calendar import prcal import torch @@ -10,7 +11,7 @@ import torch.profiler import os - +print("Entering Inference") torch.set_printoptions(precision=10) diff --git a/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml b/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml deleted file mode 120000 index efd9acc49..000000000 --- a/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../mechanisms/H2/H2_Li.yaml \ No newline at end of file diff --git a/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml b/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml new file mode 100644 index 000000000..46e3d1aa8 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_detonationH2/H2_Li.yaml @@ -0,0 +1,249 @@ +generator: ctml2yaml +cantera-version: 2.6.0 +date: Wed, 24 May 2023 11:11:36 +0800 +input-files: [H2_Li.xml] + +phases: +- name: gas + elements: [H, O, N] + species: [H2, H, H2O2, H2O, HO2, OH, O2, O, N2] + thermo: ideal-gas + transport: mixture-averaged + kinetics: gas + reactions: all + state: {T: 300.0 K, P: 1.01325e+05 Pa} + +species: +- name: H2 + composition: {H: 2.0} + note: '121286' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.298124, 8.249442e-04, -8.143015e-07, -9.475434e-11, 4.134872e-13, -1012.521, + -3.294094] + - [2.991423, 7.000644e-04, -5.633829e-08, -9.231578e-12, 1.582752e-15, -835.034, + -1.35511] + transport: + model: gas + geometry: linear + well-depth: 38.0 + diameter: 2.92 + dipole: 0.0 + polarizability: 0.79 + rotational-relaxation: 280.0 +- name: H + composition: {H: 1.0} + note: '120186' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547163e+04, -0.4601176] + - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547163e+04, -0.4601176] + transport: + model: gas + geometry: atom + well-depth: 145.0 + diameter: 2.05 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 +- name: H2O2 + composition: {H: 2.0, O: 2.0} + note: '120186' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.388754, 6.569226e-03, -1.485013e-07, -4.625806e-09, 2.471515e-12, -1.766315e+04, + 6.785363] + - [4.573167, 4.336136e-03, -1.474689e-06, 2.348904e-10, -1.431654e-14, -1.800696e+04, + 0.501137] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 3.8 +- name: H2O + composition: {H: 2.0, O: 1.0} + note: '20387' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.386842, 3.474982e-03, -6.354696e-06, 6.968581e-09, -2.506588e-12, -3.020811e+04, + 2.590233] + - [2.672146, 3.056293e-03, -8.73026e-07, 1.200996e-10, -6.391618e-15, -2.989921e+04, + 6.862817] + transport: + model: gas + geometry: nonlinear + well-depth: 572.4 + diameter: 2.605 + dipole: 1.844 + polarizability: 0.0 + rotational-relaxation: 4.0 +- name: HO2 + composition: {H: 1.0, O: 2.0} + note: L 5/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, + 294.80804, 3.71666245] + - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, + 111.856713, 3.78510215] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 1.0 +- name: OH + composition: {H: 1.0, O: 1.0} + note: S 9/01 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 6000.0] + data: + - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, + 3346.30913, -0.69043296] + - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, + 3683.62875, 5.70164073] + transport: + model: gas + geometry: linear + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 +- name: O2 + composition: {O: 2.0} + note: '121386' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.212936, 1.127486e-03, -5.75615e-07, 1.313877e-09, -8.768554e-13, -1005.249, + 6.034738] + - [3.697578, 6.135197e-04, -1.258842e-07, 1.775281e-11, -1.136435e-15, -1233.93, + 3.189166] + transport: + model: gas + geometry: linear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 1.6 + rotational-relaxation: 3.8 +- name: O + composition: {O: 1.0} + note: '120186' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [2.946429, -1.638166e-03, 2.421032e-06, -1.602843e-09, 3.890696e-13, 2.914764e+04, + 2.963995] + - [2.54206, -2.755062e-05, -3.102803e-09, 4.551067e-12, -4.368052e-16, 2.92308e+04, + 4.920308] + transport: + model: gas + geometry: atom + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 +- name: N2 + composition: {N: 2.0} + note: '121286' + thermo: + model: NASA7 + temperature-ranges: [300.0, 1000.0, 5000.0] + data: + - [3.298677, 1.40824e-03, -3.963222e-06, 5.641515e-09, -2.444855e-12, -1020.9, + 3.950372] + - [2.92664, 1.487977e-03, -5.684761e-07, 1.009704e-10, -6.753351e-15, -922.7977, + 5.980528] + transport: + model: gas + geometry: linear + well-depth: 97.53 + diameter: 3.621 + dipole: 0.0 + polarizability: 1.76 + rotational-relaxation: 4.0 + +reactions: +- equation: H + O2 <=> O + OH + rate-constant: {A: 3.547e+12, b: -0.406, Ea: 1.6599e+04 cal/mol} +- equation: O + H2 <=> H + OH + rate-constant: {A: 50.8, b: 2.67, Ea: 6290.0 cal/mol} +- equation: H2 + OH <=> H2O + H + rate-constant: {A: 2.16e+05, b: 1.51, Ea: 3430.0 cal/mol} +- equation: O + H2O <=> OH + OH + rate-constant: {A: 2970.0, b: 2.02, Ea: 1.34e+04 cal/mol} +- equation: H2 + M <=> H + H + M + type: three-body + rate-constant: {A: 4.577e+16, b: -1.4, Ea: 1.0438e+05 cal/mol} + efficiencies: {H2: 2.5, H2O: 12.0} +- equation: O + O + M <=> O2 + M + type: three-body + rate-constant: {A: 6.165e+09, b: -0.5, Ea: 0.0 cal/mol} + efficiencies: {H2: 2.5, H2O: 12.0} +- equation: O + H + M <=> OH + M + type: three-body + rate-constant: {A: 4.714e+12, b: -1.0, Ea: 0.0 cal/mol} + efficiencies: {H2: 2.5, H2O: 12.0} +- equation: H + OH + M <=> H2O + M + type: three-body + rate-constant: {A: 3.8e+16, b: -2.0, Ea: 0.0 cal/mol} + efficiencies: {H2: 2.5, H2O: 12.0} +- equation: H + O2 (+ M) <=> HO2 (+ M) + type: falloff + high-P-rate-constant: {A: 1.475e+09, b: 0.6, Ea: 0.0 cal/mol} + low-P-rate-constant: {A: 6.366e+14, b: -1.72, Ea: 524.8 cal/mol} + efficiencies: {H2: 2.0, H2O: 11.0, O2: 0.78} + Troe: {A: 0.8, T3: 1.0e-30, T1: 1.0e+30, T2: 1.0e+100} +- equation: HO2 + H <=> H2 + O2 + rate-constant: {A: 1.66e+10, b: 0.0, Ea: 823.0 cal/mol} +- equation: HO2 + H <=> OH + OH + rate-constant: {A: 7.079e+10, b: 0.0, Ea: 295.0 cal/mol} +- equation: HO2 + O <=> O2 + OH + rate-constant: {A: 3.25e+10, b: 0.0, Ea: 0.0 cal/mol} +- equation: HO2 + OH <=> H2O + O2 + rate-constant: {A: 2.89e+10, b: 0.0, Ea: -497.0 cal/mol} +- equation: HO2 + HO2 <=> H2O2 + O2 + rate-constant: {A: 4.2e+11, b: 0.0, Ea: 1.1982e+04 cal/mol} + duplicate: true +- equation: HO2 + HO2 <=> H2O2 + O2 + rate-constant: {A: 1.3e+08, b: 0.0, Ea: -1629.3 cal/mol} + duplicate: true +- equation: H2O2 (+ M) <=> OH + OH (+ M) + type: falloff + high-P-rate-constant: {A: 2.951e+14, b: 0.0, Ea: 4.843e+04 cal/mol} + low-P-rate-constant: {A: 1.202e+14, b: 0.0, Ea: 4.55e+04 cal/mol} + efficiencies: {H2: 2.5, H2O: 12.0} + Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30, T2: 1.0e+100} +- equation: H2O2 + H <=> H2O + OH + rate-constant: {A: 2.41e+10, b: 0.0, Ea: 3970.0 cal/mol} +- equation: H2O2 + H <=> HO2 + H2 + rate-constant: {A: 4.82e+10, b: 0.0, Ea: 7950.0 cal/mol} +- equation: H2O2 + O <=> OH + HO2 + rate-constant: {A: 9550.0, b: 2.0, Ea: 3970.0 cal/mol} +- equation: H2O2 + OH <=> HO2 + H2O + rate-constant: {A: 1.0e+09, b: 0.0, Ea: 0.0 cal/mol} + duplicate: true +- equation: H2O2 + OH <=> HO2 + H2O + rate-constant: {A: 5.8e+11, b: 0.0, Ea: 9557.0 cal/mol} + duplicate: true diff --git a/examples/dfHighSpeedFoam/oneD_detonationH2/system/fvSolution b/examples/dfHighSpeedFoam/oneD_detonationH2/system/fvSolution index 7ee0f7f07..ab12ce2a6 100755 --- a/examples/dfHighSpeedFoam/oneD_detonationH2/system/fvSolution +++ b/examples/dfHighSpeedFoam/oneD_detonationH2/system/fvSolution @@ -38,7 +38,7 @@ solvers relTol 0; } - e + ea { $U; tolerance 1e-11; diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/AR.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/AR.gz new file mode 100644 index 000000000..d840d11dc Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/AR.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/H2.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/H2.gz new file mode 100644 index 000000000..09c66570c Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/H2.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/O2.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/O2.gz new file mode 100644 index 000000000..73c7a8361 Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/O2.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/T.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/T.gz new file mode 100644 index 000000000..d4fd049a9 Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/T.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/U.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/U.gz new file mode 100644 index 000000000..b0f0044cd Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/U.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/Ydefault.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/Ydefault.gz new file mode 100644 index 000000000..6f20b2a35 Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/Ydefault.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/p.gz b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/p.gz new file mode 100644 index 000000000..41e197039 Binary files /dev/null and b/examples/dfHighSpeedFoam/oneD_inertShockTube/0_orig/p.gz differ diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/Allclean b/examples/dfHighSpeedFoam/oneD_inertShockTube/Allclean new file mode 100755 index 000000000..e40b94084 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/Allclean @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +echo "Cleaning log.*" +rm log.* +echo "Cleaning processor*" +rm -r processor* +echo "Cleaning polyMesh/" +rm -r constant/polyMesh +echo "Cleaning postProcessing/" +rm -r postProcessing +echo "Cleaning 0/" +rm -r 0 \ No newline at end of file diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/Allrun b/examples/dfHighSpeedFoam/oneD_inertShockTube/Allrun new file mode 100755 index 000000000..08065ff75 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/Allrun @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=dfHighSpeedFoam + +cp -r 0_orig/ 0/ +runApplication blockMesh +runApplication setFields +runApplication decomposePar +runApplication /usr/bin/mpirun -np 4 $application -parallel diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/H2_AR.yaml b/examples/dfHighSpeedFoam/oneD_inertShockTube/H2_AR.yaml new file mode 100644 index 000000000..b589c2af4 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/H2_AR.yaml @@ -0,0 +1,249 @@ +generator: ctml2yaml +cantera-version: 2.6.0 +date: Wed, 24 May 2023 11:11:32 +0800 +input-files: [H2_AR.xml] + +phases: +- name: gas + elements: [H, O, Ar] + species: [H2, O2, H, O, OH, HO2, H2O2, H2O, AR] + thermo: ideal-gas + transport: mixture-averaged + kinetics: gas + reactions: all + state: {T: 300.0 K, P: 1.01325e+05 Pa} + +species: +- name: H2 + composition: {H: 2.0} + note: TPIS78 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, + -917.935173, 0.683010238] + - [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14, + -950.158922, -3.20502331] + transport: + model: gas + geometry: linear + well-depth: 38.0 + diameter: 2.92 + dipole: 0.0 + polarizability: 0.79 + rotational-relaxation: 280.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O2 + composition: {O: 2.0} + note: TPIS89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, + -1063.94356, 3.65767573] + - [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14, + -1088.45772, 5.45323129] + transport: + model: gas + geometry: linear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 1.6 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H + composition: {H: 1.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04, + -0.446682853] + - [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22, + 2.54736599e+04, -0.446682914] + transport: + model: gas + geometry: atom + well-depth: 145.0 + diameter: 2.05 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O + composition: {O: 1.0} + note: L1/90 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, + 2.91222592e+04, 2.05193346] + - [2.56942078, -8.59741137e-05, 4.19484589e-08, -1.00177799e-11, 1.22833691e-15, + 2.92175791e+04, 4.78433864] + transport: + model: gas + geometry: atom + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: OH + composition: {H: 1.0, O: 1.0} + note: S9/01 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 6000.0] + data: + - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, + 3381.53812, -0.69043296] + - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, + 3718.85774, 5.70164073] + transport: + model: gas + geometry: linear + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: HO2 + composition: {H: 1.0, O: 2.0} + note: L5/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, + 294.80804, 3.71666245] + - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, + 111.856713, 3.78510215] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 1.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O2 + composition: {H: 2.0, O: 2.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.27611269, -5.42822417e-04, 1.67335701e-05, -2.15770813e-08, 8.62454363e-12, + -1.77025821e+04, 3.43505074] + - [4.16500285, 4.90831694e-03, -1.90139225e-06, 3.71185986e-10, -2.87908305e-14, + -1.78617877e+04, 2.91615662] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O + composition: {H: 2.0, O: 1.0} + note: L8/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12, + -3.02937267e+04, -0.849032208] + - [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14, + -3.00042971e+04, 4.9667701] + transport: + model: gas + geometry: nonlinear + well-depth: 572.4 + diameter: 2.605 + dipole: 1.844 + polarizability: 0.0 + rotational-relaxation: 4.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: AR + composition: {Ar: 1.0} + note: '120186' + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 5000.0] + data: + - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366] + - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366] + transport: + model: gas + geometry: atom + well-depth: 136.5 + diameter: 3.33 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 + +reactions: +- equation: H2 + O2 <=> 2 OH + rate-constant: {A: 1.7e+10, b: 0.0, Ea: 4.778e+04 cal/mol} +- equation: OH + H2 <=> H2O + H + rate-constant: {A: 1.17e+06, b: 1.3, Ea: 3626.0 cal/mol} +- equation: H + O2 <=> OH + O + rate-constant: {A: 5.13e+13, b: -0.816, Ea: 1.6507e+04 cal/mol} +- equation: O + H2 <=> OH + H + rate-constant: {A: 1.8e+07, b: 1.0, Ea: 8826.0 cal/mol} +- equation: H + O2 + M <=> HO2 + M + type: three-body + rate-constant: {A: 2.1e+12, b: -1.0, Ea: 0.0 cal/mol} + efficiencies: {H2: 3.3, H2O: 21.0, O2: 0.0} +- equation: H + O2 + O2 <=> HO2 + O2 + rate-constant: {A: 6.7e+13, b: -1.42, Ea: 0.0 cal/mol} +- equation: OH + HO2 <=> H2O + O2 + rate-constant: {A: 5.0e+10, b: 0.0, Ea: 1000.0 cal/mol} +- equation: H + HO2 <=> 2 OH + rate-constant: {A: 2.5e+11, b: 0.0, Ea: 1900.0 cal/mol} +- equation: O + HO2 <=> O2 + OH + rate-constant: {A: 4.8e+10, b: 0.0, Ea: 1000.0 cal/mol} +- equation: 2 OH <=> O + H2O + rate-constant: {A: 6.0e+05, b: 1.3, Ea: 0.0 cal/mol} +- equation: H2 + M <=> H + H + M + type: three-body + rate-constant: {A: 2.23e+09, b: 0.5, Ea: 9.26e+04 cal/mol} + efficiencies: {H: 2.0, H2: 3.0, H2O: 6.0} +- equation: O2 + M <=> O + O + M + type: three-body + rate-constant: {A: 1.85e+08, b: 0.5, Ea: 9.556e+04 cal/mol} +- equation: H + OH + M <=> H2O + M + type: three-body + rate-constant: {A: 7.5e+17, b: -2.6, Ea: 0.0 cal/mol} + efficiencies: {H2O: 20.0} +- equation: H + HO2 <=> H2 + O2 + rate-constant: {A: 2.5e+10, b: 0.0, Ea: 700.0 cal/mol} +- equation: HO2 + HO2 <=> H2O2 + O2 + rate-constant: {A: 2.0e+09, b: 0.0, Ea: 0.0 cal/mol} +- equation: H2O2 + M <=> OH + OH + M + type: three-body + rate-constant: {A: 1.3e+14, b: 0.0, Ea: 4.55e+04 cal/mol} +- equation: H2O2 + H <=> HO2 + H2 + rate-constant: {A: 1.6e+09, b: 0.0, Ea: 3800.0 cal/mol} +- equation: H2O2 + OH <=> H2O + HO2 + rate-constant: {A: 1.0e+10, b: 0.0, Ea: 1800.0 cal/mol} diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/CanteraTorchProperties b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/CanteraTorchProperties new file mode 100644 index 000000000..729c32720 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/CanteraTorchProperties @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object chemistryProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +chemistry off; + +CanteraMechanismFile "H2_AR.yaml"; + +transportModel "Mix"; + +odeCoeffs +{ + "relTol" 1e-6; + "absTol" 1e-10; +} + +inertSpecie "AR"; + +splittingStrategy off; + +TorchSettings +{ + torch off; + GPU off; + log off; + torchModel ""; + coresPerNode 4; +} + +loadbalancing +{ + active true; + log false; + algorithm allAverage;//headTail; +} + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/combustionProperties b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/combustionProperties new file mode 100644 index 000000000..7418500d0 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/combustionProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object combustionProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +combustionModel laminar; + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/thermophysicalProperties b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/thermophysicalProperties new file mode 100644 index 000000000..873b8e168 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/thermophysicalProperties @@ -0,0 +1,18 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +inviscid false; +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/turbulenceProperties b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/turbulenceProperties new file mode 100644 index 000000000..ab70e94d3 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/blockMeshDict b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/blockMeshDict new file mode 100644 index 000000000..41764eb7e --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 1) + (1 0 1) + (1 1 1) + (0 1 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (400 1 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + sides + { + type patch; + faces + ( + (1 2 6 5) + (0 4 7 3) + ); + } + empty + { + type empty; + faces + ( + (0 1 5 4) + (5 6 7 4) + (3 7 6 2) + (0 3 2 1) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/controlDict b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/controlDict new file mode 100644 index 000000000..080b45151 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/controlDict @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application dfHighSpeedFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 4e-5; + +deltaT 1e-08; + +writeControl adjustableRunTime; + +writeInterval 5e-6; + +cycleWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression on; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 0.02; + +maxDeltaT 1; + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/decomposeParDict b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/decomposeParDict new file mode 100755 index 000000000..470777a2a --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/decomposeParDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSchemes b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSchemes new file mode 100644 index 000000000..80832f273 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSchemes @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +//fluxScheme Kurganov; + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(tauMC) Gauss linear; + div(hDiffCorrFlux) Gauss cubic; + div(phi,Yi_h) Gauss vanLeer; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; + reconstruct(rho) Minmod; + reconstruct(U) MinmodV; + reconstruct(T) Minmod; + reconstruct(Yi) Minmod; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSolution b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSolution new file mode 100644 index 000000000..b9fb7f36c --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/fvSolution @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + U + { + //solver smoothSolver; + //smoother GaussSeidel; + //nSweeps 2; + //tolerance 1e-17; + //relTol 0; + + solver PBiCGStab; + preconditioner DIC; + tolerance 1e-11; + relTol 0; + } + + h + { + $U; + tolerance 1e-11; + relTol 0; + } + + ea + { + $U; + tolerance 1e-11; + relTol 0; + } + + "rho.*" + { + solver diagonal; + } + + "(O2|N2|Yi)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-11; + relTol 0; + } + +} + +CENTRAL +{ +} + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/sample b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/sample new file mode 100644 index 000000000..f5ac29bbb --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/sample @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs ("libsampling.so"); + +interpolationScheme cellPoint; + +setFormat raw; + +sets +( + data + { + type lineFace; + axis x; + start (-4.995 0 0); + end (4.995 0 0); + nPoints 1000; + } +); + +fields (T mag(U) p); + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_inertShockTube/system/setFieldsDict b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/setFieldsDict new file mode 100644 index 000000000..e3ff97265 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_inertShockTube/system/setFieldsDict @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volVectorFieldValue U (0 0 0) + volScalarFieldValue T 400 + volScalarFieldValue p 8000 +); + +regions +( + boxToCell + { + box (0.05 -0.1 -0.1) (0.1 0.1 0.1); + fieldValues + ( + volScalarFieldValue T 1200 + volScalarFieldValue p 80000 + ); + } +); + + +// ************************************************************************* // diff --git a/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml b/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml deleted file mode 120000 index 71bb20c38..000000000 --- a/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../mechanisms/H2/H2_AR.yaml \ No newline at end of file diff --git a/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml b/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml new file mode 100644 index 000000000..b589c2af4 --- /dev/null +++ b/examples/dfHighSpeedFoam/oneD_reactiveShockTube/H2_AR.yaml @@ -0,0 +1,249 @@ +generator: ctml2yaml +cantera-version: 2.6.0 +date: Wed, 24 May 2023 11:11:32 +0800 +input-files: [H2_AR.xml] + +phases: +- name: gas + elements: [H, O, Ar] + species: [H2, O2, H, O, OH, HO2, H2O2, H2O, AR] + thermo: ideal-gas + transport: mixture-averaged + kinetics: gas + reactions: all + state: {T: 300.0 K, P: 1.01325e+05 Pa} + +species: +- name: H2 + composition: {H: 2.0} + note: TPIS78 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, + -917.935173, 0.683010238] + - [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14, + -950.158922, -3.20502331] + transport: + model: gas + geometry: linear + well-depth: 38.0 + diameter: 2.92 + dipole: 0.0 + polarizability: 0.79 + rotational-relaxation: 280.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O2 + composition: {O: 2.0} + note: TPIS89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, + -1063.94356, 3.65767573] + - [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14, + -1088.45772, 5.45323129] + transport: + model: gas + geometry: linear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 1.6 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H + composition: {H: 1.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04, + -0.446682853] + - [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22, + 2.54736599e+04, -0.446682914] + transport: + model: gas + geometry: atom + well-depth: 145.0 + diameter: 2.05 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O + composition: {O: 1.0} + note: L1/90 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, + 2.91222592e+04, 2.05193346] + - [2.56942078, -8.59741137e-05, 4.19484589e-08, -1.00177799e-11, 1.22833691e-15, + 2.92175791e+04, 4.78433864] + transport: + model: gas + geometry: atom + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: OH + composition: {H: 1.0, O: 1.0} + note: S9/01 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 6000.0] + data: + - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, + 3381.53812, -0.69043296] + - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, + 3718.85774, 5.70164073] + transport: + model: gas + geometry: linear + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: HO2 + composition: {H: 1.0, O: 2.0} + note: L5/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, + 294.80804, 3.71666245] + - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, + 111.856713, 3.78510215] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 1.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O2 + composition: {H: 2.0, O: 2.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.27611269, -5.42822417e-04, 1.67335701e-05, -2.15770813e-08, 8.62454363e-12, + -1.77025821e+04, 3.43505074] + - [4.16500285, 4.90831694e-03, -1.90139225e-06, 3.71185986e-10, -2.87908305e-14, + -1.78617877e+04, 2.91615662] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O + composition: {H: 2.0, O: 1.0} + note: L8/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12, + -3.02937267e+04, -0.849032208] + - [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14, + -3.00042971e+04, 4.9667701] + transport: + model: gas + geometry: nonlinear + well-depth: 572.4 + diameter: 2.605 + dipole: 1.844 + polarizability: 0.0 + rotational-relaxation: 4.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: AR + composition: {Ar: 1.0} + note: '120186' + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 5000.0] + data: + - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366] + - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.366] + transport: + model: gas + geometry: atom + well-depth: 136.5 + diameter: 3.33 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 + +reactions: +- equation: H2 + O2 <=> 2 OH + rate-constant: {A: 1.7e+10, b: 0.0, Ea: 4.778e+04 cal/mol} +- equation: OH + H2 <=> H2O + H + rate-constant: {A: 1.17e+06, b: 1.3, Ea: 3626.0 cal/mol} +- equation: H + O2 <=> OH + O + rate-constant: {A: 5.13e+13, b: -0.816, Ea: 1.6507e+04 cal/mol} +- equation: O + H2 <=> OH + H + rate-constant: {A: 1.8e+07, b: 1.0, Ea: 8826.0 cal/mol} +- equation: H + O2 + M <=> HO2 + M + type: three-body + rate-constant: {A: 2.1e+12, b: -1.0, Ea: 0.0 cal/mol} + efficiencies: {H2: 3.3, H2O: 21.0, O2: 0.0} +- equation: H + O2 + O2 <=> HO2 + O2 + rate-constant: {A: 6.7e+13, b: -1.42, Ea: 0.0 cal/mol} +- equation: OH + HO2 <=> H2O + O2 + rate-constant: {A: 5.0e+10, b: 0.0, Ea: 1000.0 cal/mol} +- equation: H + HO2 <=> 2 OH + rate-constant: {A: 2.5e+11, b: 0.0, Ea: 1900.0 cal/mol} +- equation: O + HO2 <=> O2 + OH + rate-constant: {A: 4.8e+10, b: 0.0, Ea: 1000.0 cal/mol} +- equation: 2 OH <=> O + H2O + rate-constant: {A: 6.0e+05, b: 1.3, Ea: 0.0 cal/mol} +- equation: H2 + M <=> H + H + M + type: three-body + rate-constant: {A: 2.23e+09, b: 0.5, Ea: 9.26e+04 cal/mol} + efficiencies: {H: 2.0, H2: 3.0, H2O: 6.0} +- equation: O2 + M <=> O + O + M + type: three-body + rate-constant: {A: 1.85e+08, b: 0.5, Ea: 9.556e+04 cal/mol} +- equation: H + OH + M <=> H2O + M + type: three-body + rate-constant: {A: 7.5e+17, b: -2.6, Ea: 0.0 cal/mol} + efficiencies: {H2O: 20.0} +- equation: H + HO2 <=> H2 + O2 + rate-constant: {A: 2.5e+10, b: 0.0, Ea: 700.0 cal/mol} +- equation: HO2 + HO2 <=> H2O2 + O2 + rate-constant: {A: 2.0e+09, b: 0.0, Ea: 0.0 cal/mol} +- equation: H2O2 + M <=> OH + OH + M + type: three-body + rate-constant: {A: 1.3e+14, b: 0.0, Ea: 4.55e+04 cal/mol} +- equation: H2O2 + H <=> HO2 + H2 + rate-constant: {A: 1.6e+09, b: 0.0, Ea: 3800.0 cal/mol} +- equation: H2O2 + OH <=> H2O + HO2 + rate-constant: {A: 1.0e+10, b: 0.0, Ea: 1800.0 cal/mol} diff --git a/examples/dfHighSpeedFoam/oneD_reactiveShockTube/system/fvSolution b/examples/dfHighSpeedFoam/oneD_reactiveShockTube/system/fvSolution index 17c77b5df..b9fb7f36c 100755 --- a/examples/dfHighSpeedFoam/oneD_reactiveShockTube/system/fvSolution +++ b/examples/dfHighSpeedFoam/oneD_reactiveShockTube/system/fvSolution @@ -38,7 +38,7 @@ solvers relTol 0; } - e + ea { $U; tolerance 1e-11; diff --git a/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml b/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml deleted file mode 120000 index 3d0e2d49b..000000000 --- a/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../mechanisms/H2/H2_Ja.yaml \ No newline at end of file diff --git a/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml b/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml new file mode 100644 index 000000000..1711869de --- /dev/null +++ b/examples/dfHighSpeedFoam/twoD_detonationH2/H2_Ja.yaml @@ -0,0 +1,256 @@ +generator: ctml2yaml +cantera-version: 2.6.0 +date: Wed, 24 May 2023 11:11:40 +0800 +input-files: [H2_Ja.xml] + +phases: +- name: gas + elements: [O, H, C, N] + species: [H, H2, O, O2, OH, H2O, N2, HO2, H2O2] + thermo: ideal-gas + transport: mixture-averaged + kinetics: gas + reactions: all + state: {T: 300.0 K, P: 1.01325e+05 Pa} + +species: +- name: H + composition: {H: 1.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04, + -0.446682853] + - [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22, + 2.54736599e+04, -0.446682914] + transport: + model: gas + geometry: atom + well-depth: 145.0 + diameter: 2.05 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2 + composition: {H: 2.0} + note: TPIS78 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, + -917.935173, 0.683010238] + - [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14, + -950.158922, -3.20502331] + transport: + model: gas + geometry: linear + well-depth: 38.0 + diameter: 2.92 + dipole: 0.0 + polarizability: 0.79 + rotational-relaxation: 280.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O + composition: {O: 1.0} + note: L1/90 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, + 2.91222592e+04, 2.05193346] + - [2.56942078, -8.59741137e-05, 4.19484589e-08, -1.00177799e-11, 1.22833691e-15, + 2.92175791e+04, 4.78433864] + transport: + model: gas + geometry: atom + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: O2 + composition: {O: 2.0} + note: TPIS89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, + -1063.94356, 3.65767573] + - [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14, + -1088.45772, 5.45323129] + transport: + model: gas + geometry: linear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 1.6 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: OH + composition: {H: 1.0, O: 1.0} + note: S9/01 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 6000.0] + data: + - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, + 3381.53812, -0.69043296] + - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, + 3718.85774, 5.70164073] + transport: + model: gas + geometry: linear + well-depth: 80.0 + diameter: 2.75 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 0.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O + composition: {H: 2.0, O: 1.0} + note: L8/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12, + -3.02937267e+04, -0.849032208] + - [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14, + -3.00042971e+04, 4.9667701] + transport: + model: gas + geometry: nonlinear + well-depth: 572.4 + diameter: 2.605 + dipole: 1.844 + polarizability: 0.0 + rotational-relaxation: 4.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: N2 + composition: {N: 2.0} + note: '121286' + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 5000.0] + data: + - [3.298677, 1.4082404e-03, -3.963222e-06, 5.641515e-09, -2.444854e-12, -1020.8999, + 3.950372] + - [2.92664, 1.4879768e-03, -5.68476e-07, 1.0097038e-10, -6.753351e-15, -922.7977, + 5.980528] + transport: + model: gas + geometry: linear + well-depth: 97.53 + diameter: 3.621 + dipole: 0.0 + polarizability: 1.76 + rotational-relaxation: 4.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: HO2 + composition: {H: 1.0, O: 2.0} + note: L5/89 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, + 294.80804, 3.71666245] + - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, + 111.856713, 3.78510215] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 1.0 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 +- name: H2O2 + composition: {H: 2.0, O: 2.0} + note: L7/88 + thermo: + model: NASA7 + temperature-ranges: [200.0, 1000.0, 3500.0] + data: + - [4.27611269, -5.42822417e-04, 1.67335701e-05, -2.15770813e-08, 8.62454363e-12, + -1.77025821e+04, 3.43505074] + - [4.16500285, 4.90831694e-03, -1.90139225e-06, 3.71185986e-10, -2.87908305e-14, + -1.78617877e+04, 2.91615662] + transport: + model: gas + geometry: nonlinear + well-depth: 107.4 + diameter: 3.458 + dipole: 0.0 + polarizability: 0.0 + rotational-relaxation: 3.8 + dispersion-coefficient: 0.0 + quadrupole-polarizability: 0.0 + +reactions: +- equation: H2 + O2 <=> HO2 + H + rate-constant: {A: 1.0e+11, b: 0.0, Ea: 5.6e+04 cal/mol} +- equation: H + O2 <=> OH + O + rate-constant: {A: 2.6e+11, b: 0.0, Ea: 1.68e+04 cal/mol} +- equation: O + H2 <=> OH + H + rate-constant: {A: 1.8e+07, b: 1.0, Ea: 8900.0 cal/mol} +- equation: OH + H2 <=> H2O + H + rate-constant: {A: 2.2e+10, b: 0.0, Ea: 5150.0 cal/mol} +- equation: OH + OH <=> H2O + O + rate-constant: {A: 6.3e+09, b: 0.0, Ea: 1090.0 cal/mol} +- equation: H + OH + M <=> H2O + M + type: three-body + rate-constant: {A: 2.2e+16, b: -2.0, Ea: 0.0 cal/mol} + efficiencies: {H2O: 6.0} +- equation: H + H + M <=> H2 + M + type: three-body + rate-constant: {A: 6.4e+11, b: -1.0, Ea: 0.0 cal/mol} + efficiencies: {H2: 2.0, H2O: 6.0} +- equation: H + O + M <=> OH + M + type: three-body + rate-constant: {A: 6.0e+10, b: -0.6, Ea: 0.0 cal/mol} + efficiencies: {H2O: 6.0} +- equation: H + O2 + M <=> HO2 + M + type: three-body + rate-constant: {A: 2.1e+09, b: 0.0, Ea: -1000.0 cal/mol} + efficiencies: {H2: 2.0, H2O: 6.0} +- equation: HO2 + H <=> OH + OH + rate-constant: {A: 1.4e+11, b: 0.0, Ea: 1080.0 cal/mol} +- equation: HO2 + H <=> H2O + O + rate-constant: {A: 1.0e+10, b: 0.0, Ea: 1080.0 cal/mol} +- equation: HO2 + O <=> O2 + OH + rate-constant: {A: 1.5e+10, b: 0.0, Ea: 950.0 cal/mol} +- equation: HO2 + OH <=> H2O + O2 + rate-constant: {A: 8.0e+09, b: 0.0, Ea: 0.0 cal/mol} +- equation: 2 HO2 <=> H2O2 + O2 + rate-constant: {A: 2.0e+09, b: 0.0, Ea: 0.0 cal/mol} +- equation: H + H2O2 <=> H2 + HO2 + rate-constant: {A: 1.4e+09, b: 0.0, Ea: 3600.0 cal/mol} +- equation: O + H2O2 <=> OH + HO2 + rate-constant: {A: 1.4e+10, b: 0.0, Ea: 6400.0 cal/mol} +- equation: OH + H2O2 <=> H2O + HO2 + rate-constant: {A: 6.1e+09, b: 0.0, Ea: 1430.0 cal/mol} +- equation: H2O2 + M <=> OH + OH + M + type: three-body + rate-constant: {A: 1.2e+14, b: 0.0, Ea: 4.55e+04 cal/mol} + efficiencies: {H2O: 15.0} +- equation: O + O + M <=> O2 + M + type: three-body + rate-constant: {A: 6.0e+07, b: 0.0, Ea: -1800.0 cal/mol} diff --git a/examples/dfHighSpeedFoam/twoD_detonationH2/system/fvSolution b/examples/dfHighSpeedFoam/twoD_detonationH2/system/fvSolution index 17c77b5df..b9fb7f36c 100755 --- a/examples/dfHighSpeedFoam/twoD_detonationH2/system/fvSolution +++ b/examples/dfHighSpeedFoam/twoD_detonationH2/system/fvSolution @@ -38,7 +38,7 @@ solvers relTol 0; } - e + ea { $U; tolerance 1e-11; diff --git a/intelligent-combustion b/intelligent-combustion new file mode 160000 index 000000000..64890eabe --- /dev/null +++ b/intelligent-combustion @@ -0,0 +1 @@ +Subproject commit 64890eabe64d91e042c9808e40156867aa53c2f0 diff --git a/src/dfCanteraMixture/CanteraMixture.C b/src/dfCanteraMixture/CanteraMixture.C index 1e3ff53af..0460e2241 100644 --- a/src/dfCanteraMixture/CanteraMixture.C +++ b/src/dfCanteraMixture/CanteraMixture.C @@ -50,7 +50,7 @@ Foam::CanteraMixture::CanteraMixture transportModelName_(CanteraTorchProperties_.lookup("transportModel")), Tref_(mesh.objectRegistry::lookupObject("T")), pref_(mesh.objectRegistry::lookupObject("p")), - energyName_("ha") + energyName_("energy") { if(!isFile(CanteraMechanismFile_)) { diff --git a/src/dfChemistryModel/dfChemistryModel.C b/src/dfChemistryModel/dfChemistryModel.C index 19fcc5577..c3d62f644 100644 --- a/src/dfChemistryModel/dfChemistryModel.C +++ b/src/dfChemistryModel/dfChemistryModel.C @@ -467,7 +467,14 @@ void Foam::dfChemistryModel::correctThermo() } CanteraGas_->setState_TPY(pT[facei], pp[facei], yTemp_.begin()); - ph[facei] = CanteraGas_->enthalpy_mass(); + if(mixture_.heName()=="ha") + { + ph[facei] = CanteraGas_->enthalpy_mass(); + } + else if(mixture_.heName()=="ea") + { + ph[facei] = CanteraGas_->intEnergy_mass(); + } ppsi[facei] = mixture_.psi(pp[facei],pT[facei]);