Skip to content

Commit

Permalink
update psi calculation in dfChemistryModel and dfCanteraMixture (#252)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wengzf20 authored Apr 28, 2023
1 parent 16bdb68 commit 8b67cc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/dfCanteraMixture/CanteraMixture.H
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public:
const scalar& T
) const
{
return CanteraGas_->meanMolecularWeight()/CanteraGas_->RT();
// for ideal gas, psi = CanteraGas_->density()/p = 1/RT
return CanteraGas_->density()/p;
}

scalar mu
Expand Down
7 changes: 3 additions & 4 deletions src/dfChemistryModel/dfChemistryModel.C
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ void Foam::dfChemistryModel<ThermoType>::correctThermo()

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

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

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

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

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

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

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

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

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

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

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

Expand Down

0 comments on commit 8b67cc2

Please sign in to comment.