From d9f5d3ca22d77eaa5ea57692dd269717ebba4bc1 Mon Sep 17 00:00:00 2001 From: of Date: Mon, 3 Oct 2022 10:55:26 +0800 Subject: [PATCH] fix a bug abour spray energy source term, we are using absolute enthalpy, but lagrangian can only offter sensible enthalpy source term --- applications/solvers/dfSprayFoam/EEqn.H | 9 +++++++++ src/dfChemistryModel/dfChemistryModel.H | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/applications/solvers/dfSprayFoam/EEqn.H b/applications/solvers/dfSprayFoam/EEqn.H index 6b82915e..c014e7dc 100644 --- a/applications/solvers/dfSprayFoam/EEqn.H +++ b/applications/solvers/dfSprayFoam/EEqn.H @@ -1,6 +1,14 @@ { volScalarField& he = thermo.he(); + + tmp thcSource(new fvScalarMatrix(he, dimEnergy/dimTime)); + fvScalarMatrix& hcSource = thcSource.ref(); + forAll(Y, i) + { + hcSource.source() -= parcels.rhoTrans(i)*chemistry->mixture().Hc(i)/runTime.deltaT(); + } + //hSource.source() -= parcels.hsTrans()/runTime.deltaT();// equivalent to parcels.Sh(he) fvScalarMatrix EEqn ( fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he) @@ -11,6 +19,7 @@ == rho*(U&g) + parcels.Sh(he) + + hcSource + fvc::div(hDiffCorrFlux) //+ radiation->Sh(thermo, he) //+ fvOptions(rho, he) diff --git a/src/dfChemistryModel/dfChemistryModel.H b/src/dfChemistryModel/dfChemistryModel.H index f4d68477..7bd6b7cb 100644 --- a/src/dfChemistryModel/dfChemistryModel.H +++ b/src/dfChemistryModel/dfChemistryModel.H @@ -222,12 +222,14 @@ public: const volScalarField& rhoD(const label i) const {return rhoD_[i];} - volScalarField& hai(const label i) {return hai_[i];} + const volScalarField& hai(const label i) {return hai_[i];} // update T, psi, mu, alpha, rhoD, hai (if needed) void correctThermo(); ThermoType& thermo() {return thermo_;} + + const CanteraMixture& mixture() {return mixture_;} };