Skip to content

Commit 8b67cc2

Browse files
authored
update psi calculation in dfChemistryModel and dfCanteraMixture (#252)
* Update psi in CanteraMixture.H replace W/RT with rho/p * Update psi calculation dfChemistryModel.C call psi function from dfCanteraMixture directly * Update dfChemistryModel.C * Update dfChemistryModel.C * Update dfChemistryModel.C * Update CanteraMixture.H
1 parent 16bdb68 commit 8b67cc2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/dfCanteraMixture/CanteraMixture.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public:
117117
const scalar& T
118118
) const
119119
{
120-
return CanteraGas_->meanMolecularWeight()/CanteraGas_->RT();
120+
// for ideal gas, psi = CanteraGas_->density()/p = 1/RT
121+
return CanteraGas_->density()/p;
121122
}
122123

123124
scalar mu

src/dfChemistryModel/dfChemistryModel.C

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ void Foam::dfChemistryModel<ThermoType>::correctThermo()
383383

384384
T_[celli] = CanteraGas_->temperature();
385385

386-
// meanMolecularWeight() kg/kmol RT() Joules/kmol
387-
psi_[celli] = CanteraGas_->meanMolecularWeight()/CanteraGas_->RT();
386+
psi_[celli] = mixture_.psi(p_[celli],T_[celli]);
388387

389388
mu_[celli] = mixture_.CanteraTransport()->viscosity(); // Pa-s
390389

@@ -453,7 +452,7 @@ void Foam::dfChemistryModel<ThermoType>::correctThermo()
453452

454453
ph[facei] = CanteraGas_->enthalpy_mass();
455454

456-
ppsi[facei] = CanteraGas_->meanMolecularWeight()/CanteraGas_->RT();
455+
ppsi[facei] = mixture_.psi(pp[facei],pT[facei]);
457456

458457
pmu[facei] = mixture_.CanteraTransport()->viscosity();
459458

@@ -494,7 +493,7 @@ void Foam::dfChemistryModel<ThermoType>::correctThermo()
494493

495494
pT[facei] = CanteraGas_->temperature();
496495

497-
ppsi[facei] = CanteraGas_->meanMolecularWeight()/CanteraGas_->RT();
496+
ppsi[facei] = mixture_.psi(pp[facei],pT[facei]);
498497

499498
pmu[facei] = mixture_.CanteraTransport()->viscosity();
500499

0 commit comments

Comments
 (0)