Compare commits
No commits in common. "ionicWind" and "master" have entirely different histories.
23 changed files with 22 additions and 878 deletions
|
|
@ -1,23 +0,0 @@
|
|||
allmake:
|
||||
image: park0d/of4builder
|
||||
tags:
|
||||
- openfoam4
|
||||
before_script:
|
||||
- "[[ -d ../ThirdParty-4.x ]] || git clone https://github.com/OpenFOAM/ThirdParty-4.x.git ../ThirdParty-4.x"
|
||||
- source etc/bashrc
|
||||
- rm -rf platforms
|
||||
- wclean all
|
||||
script:
|
||||
- ./Allwmake -j
|
||||
artifacts:
|
||||
paths:
|
||||
- ./
|
||||
|
||||
cantera:
|
||||
image: park0d/of4builder
|
||||
tags:
|
||||
- openfoam4
|
||||
script:
|
||||
- whereis libcantera
|
||||
|
||||
|
||||
|
|
@ -96,8 +96,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||
pc_,
|
||||
this->Tc_,
|
||||
X,
|
||||
dMassPC,
|
||||
this->rhoc_
|
||||
dMassPC
|
||||
);
|
||||
|
||||
// Limit phase change mass by availability of each specie
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ License
|
|||
|
||||
#include "NoPhaseChange.H"
|
||||
#include "LiquidEvaporation.H"
|
||||
#include "LiquidEvaporationConvDiff.H"
|
||||
#include "LiquidEvaporationBoil.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
|
@ -40,7 +39,6 @@ License
|
|||
makePhaseChangeModel(CloudType); \
|
||||
makePhaseChangeModelType(NoPhaseChange, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporation, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporationConvDiff, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -142,8 +142,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
|
|
@ -197,8 +196,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||
// vapour concentration at surface [kmol/m3] at film temperature
|
||||
const scalar Cs = pSat/(RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
|
||||
// vapour concentration in bulk gas [kmol/m3] at film temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Ts);
|
||||
|
||||
// molar flux of vapour [kmol/m2/s]
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
|
|
|||
|
|
@ -119,8 +119,7 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -142,8 +142,7 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -1,287 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "LiquidEvaporationConvDiff.H"
|
||||
#include "specie.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationConvDiff<CloudType>::calcXc
|
||||
(
|
||||
const label celli
|
||||
) const
|
||||
{
|
||||
scalarField Xc(this->owner().thermo().carrier().Y().size());
|
||||
|
||||
forAll(Xc, i)
|
||||
{
|
||||
Xc[i] =
|
||||
this->owner().thermo().carrier().Y()[i][celli]
|
||||
/this->owner().thermo().carrier().W(i);
|
||||
}
|
||||
|
||||
return Xc/sum(Xc);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Sh
|
||||
(
|
||||
const scalar Re,
|
||||
const scalar Sc
|
||||
) const
|
||||
{
|
||||
return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(dict, owner, typeName),
|
||||
liquids_(owner.thermo().liquids()),
|
||||
activeLiquids_(this->coeffDict().lookup("activeLiquids")),
|
||||
liqToCarrierMap_(activeLiquids_.size(), -1),
|
||||
liqToLiqMap_(activeLiquids_.size(), -1)
|
||||
{
|
||||
if (activeLiquids_.size() == 0)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Evaporation model selected, but no active liquids defined"
|
||||
<< nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Participating liquid species:" << endl;
|
||||
|
||||
// Determine mapping between liquid and carrier phase species
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
Info<< " " << activeLiquids_[i] << endl;
|
||||
liqToCarrierMap_[i] =
|
||||
owner.composition().carrierId(activeLiquids_[i]);
|
||||
}
|
||||
|
||||
// Determine mapping between model active liquids and global liquids
|
||||
const label idLiquid = owner.composition().idLiquid();
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
liqToLiqMap_[i] =
|
||||
owner.composition().localId(idLiquid, activeLiquids_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
|
||||
(
|
||||
const LiquidEvaporationConvDiff<CloudType>& pcm
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(pcm),
|
||||
liquids_(pcm.owner().thermo().liquids()),
|
||||
activeLiquids_(pcm.activeLiquids_),
|
||||
liqToCarrierMap_(pcm.liqToCarrierMap_),
|
||||
liqToLiqMap_(pcm.liqToLiqMap_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::~LiquidEvaporationConvDiff()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LiquidEvaporationConvDiff<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label celli,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc //POSECH
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
if ((liquids_.Tc(X) - T) < SMALL)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Parcel reached critical conditions: "
|
||||
<< "evaporating all avaliable mass" << endl;
|
||||
}
|
||||
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
const label lid = liqToLiqMap_[i];
|
||||
dMassPC[lid] = GREAT;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// construct carrier phase species volume fractions for cell, celli
|
||||
const scalarField Xc(calcXc(celli));
|
||||
|
||||
// calculate mass transfer of each specie in liquid
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
const label gid = liqToCarrierMap_[i];
|
||||
const label lid = liqToLiqMap_[i];
|
||||
|
||||
// vapour diffusivity [m2/s]
|
||||
const scalar Dab = liquids_.properties()[lid].D(pc, Ts);
|
||||
|
||||
// saturation pressure for species i [pa]
|
||||
// - carrier phase pressure assumed equal to the liquid vapour pressure
|
||||
// close to the surface
|
||||
// NOTE: if pSat > pc then particle is superheated
|
||||
// calculated evaporation rate will be greater than that of a particle
|
||||
// at boiling point, but this is not a boiling model
|
||||
const scalar pSat = liquids_.properties()[lid].pv(pc, T);
|
||||
|
||||
// Schmidt number
|
||||
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||
|
||||
// Sherwood number
|
||||
const scalar Sh = this->Sh(Re, Sc);
|
||||
|
||||
// mass transfer coefficient [m/s]
|
||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
|
||||
// vapour concentration at surface [kmol/m3] at film temperature
|
||||
const scalar Cs = pSat/(RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
|
||||
|
||||
// molar flux of vapour [kmol/m2/s]
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
||||
// droplet surface pressure assumed to surface vapour pressure
|
||||
const scalar ps = liquids_.pv(pc, Ts, X);
|
||||
|
||||
// vapour density at droplet surface [kg/m3]
|
||||
const scalar rhos = ps*liquids_.W(X)/(RR*Ts);
|
||||
|
||||
// vapour mass fraction at surface
|
||||
const scalar Ys = min((Cs*liquids_.W(X)/rhos),0.9);
|
||||
|
||||
// vapour mass fraction in bulk gas
|
||||
const scalar Yinf = Cinf*liquids_.W(X)/rhos;
|
||||
|
||||
// Spalding mass number
|
||||
const scalar Bm = max(((Ys - Yinf)/(1.0 - Ys)),0.0);
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += kc*pi*sqr(d)*rhoc*log(1+Bm)*dt;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
scalar dh = 0;
|
||||
|
||||
typedef PhaseChangeModel<CloudType> parent;
|
||||
switch (parent::enthalpyTransfer_)
|
||||
{
|
||||
case (parent::etLatentHeat):
|
||||
{
|
||||
dh = liquids_.properties()[idl].hl(p, T);
|
||||
break;
|
||||
}
|
||||
case (parent::etEnthalpyDifference):
|
||||
{
|
||||
scalar hc = this->owner().composition().carrier().Ha(idc, p, T);
|
||||
scalar hp = liquids_.properties()[idl].h(p, T);
|
||||
|
||||
dh = hc - hp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return dh;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Tvap
|
||||
(
|
||||
const scalarField& X
|
||||
) const
|
||||
{
|
||||
return liquids_.Tpt(X);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::TMax
|
||||
(
|
||||
const scalar p,
|
||||
const scalarField& X
|
||||
) const
|
||||
{
|
||||
return liquids_.pvInvert(p, X);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::LiquidEvaporationConvDiff
|
||||
|
||||
Description
|
||||
Liquid evaporation model
|
||||
- uses ideal gas assumption
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef LiquidEvaporationConvDiff_H
|
||||
#define LiquidEvaporationConvDiff_H
|
||||
|
||||
#include "PhaseChangeModel.H"
|
||||
#include "liquidMixtureProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class LiquidEvaporationConvDiff Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class LiquidEvaporationConvDiff
|
||||
:
|
||||
public PhaseChangeModel<CloudType>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Global liquid properties data
|
||||
const liquidMixtureProperties& liquids_;
|
||||
|
||||
//- List of active liquid names
|
||||
List<word> activeLiquids_;
|
||||
|
||||
//- Mapping between liquid and carrier species
|
||||
List<label> liqToCarrierMap_;
|
||||
|
||||
//- Mapping between local and global liquid species
|
||||
List<label> liqToLiqMap_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Sherwood number as a function of Reynolds and Schmidt numbers
|
||||
scalar Sh(const scalar Re, const scalar Sc) const;
|
||||
|
||||
//- Calculate the carrier phase component volume fractions at celli
|
||||
tmp<scalarField> calcXc(const label celli) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("liquidEvaporationConvDiff");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
LiquidEvaporationConvDiff(const dictionary& dict, CloudType& cloud);
|
||||
|
||||
//- Construct copy
|
||||
LiquidEvaporationConvDiff(const LiquidEvaporationConvDiff<CloudType>& pcm);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<PhaseChangeModel<CloudType>> clone() const
|
||||
{
|
||||
return autoPtr<PhaseChangeModel<CloudType>>
|
||||
(
|
||||
new LiquidEvaporationConvDiff<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~LiquidEvaporationConvDiff();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update model
|
||||
virtual void calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label celli,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
virtual scalar dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const;
|
||||
|
||||
//- Return vapourisation temperature
|
||||
virtual scalar Tvap(const scalarField& X) const;
|
||||
|
||||
//- Return maximum/limiting temperature
|
||||
virtual scalar TMax(const scalar p, const scalarField& X) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "LiquidEvaporationConvDiff.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -78,8 +78,7 @@ void Foam::NoPhaseChange<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const
|
||||
{
|
||||
// Nothing to do...
|
||||
|
|
|
|||
|
|
@ -94,8 +94,7 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -166,8 +166,7 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
scalarField& dMassPC
|
||||
) const = 0;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ irreversibleReactionDelimiter {space}"=>"{space}
|
|||
startPDependentSpecie {space}"("{space}"+"{space}
|
||||
pDependentSpecie {specieName}")"{space}
|
||||
reactionCoeffs {space}{floatNum}{some_space}{floatNum}{some_space}{floatNum}{space}
|
||||
reactionKeyword {space}[A-Za-z](([A-Za-z0-9)*-])|("("[^+]))*((\+({some_space}))?){space}
|
||||
reactionKeyword {space}[A-Za-z](([A-Za-z0-9)*-])|("("[^+]))*{space}
|
||||
reactionKeywordSlash {reactionKeyword}"/"{space}
|
||||
thirdBodyEfficiency {space}{floatNum}{space}"/"{space}
|
||||
startReactionCoeffs {space}"/"{space}
|
||||
|
|
@ -637,8 +637,7 @@ bool finishReaction = false;
|
|||
(
|
||||
currentSpecieName,
|
||||
1.0,
|
||||
molecularWeight(currentSpecieComposition),
|
||||
chargeNumber(currentSpecieComposition)
|
||||
molecularWeight(currentSpecieComposition)
|
||||
),
|
||||
currentLowT,
|
||||
currentHighT,
|
||||
|
|
|
|||
|
|
@ -144,28 +144,6 @@ Foam::scalar Foam::chemkinReader::molecularWeight
|
|||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::chemkinReader::chargeNumber
|
||||
(
|
||||
const List<specieElement>& specieComposition
|
||||
) const
|
||||
{
|
||||
scalar nElemCharges = 0.0;
|
||||
|
||||
forAll(specieComposition, i)
|
||||
{
|
||||
label nAtoms = specieComposition[i].nAtoms;
|
||||
const word& elementName = specieComposition[i].elementName;
|
||||
|
||||
if (elementName[0] == 'e')
|
||||
{
|
||||
nElemCharges -= nAtoms;
|
||||
}
|
||||
}
|
||||
|
||||
return nElemCharges;
|
||||
}
|
||||
|
||||
|
||||
void Foam::chemkinReader::checkCoeffs
|
||||
(
|
||||
const scalarList& reactionCoeffs,
|
||||
|
|
|
|||
|
|
@ -254,11 +254,6 @@ private:
|
|||
const List<specieElement>& specieComposition
|
||||
) const;
|
||||
|
||||
scalar chargeNumber
|
||||
(
|
||||
const List<specieElement>& specieComposition
|
||||
) const;
|
||||
|
||||
void finishElements(labelList& currentAtoms);
|
||||
|
||||
void checkCoeffs
|
||||
|
|
|
|||
|
|
@ -68,70 +68,6 @@ Foam::scalar Foam::SpecieMixture<MixtureType>::W
|
|||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
Foam::scalar Foam::SpecieMixture<MixtureType>::z
|
||||
(
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
return this->getLocalThermo(speciei).z();
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
Foam::scalar Foam::SpecieMixture<MixtureType>::Qc
|
||||
(
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
return this->getLocalThermo(speciei).Qc();
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
Foam::scalar Foam::SpecieMixture<MixtureType>::Qc2
|
||||
(
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
return this->getLocalThermo(speciei).Qc2();
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
void Foam::SpecieMixture<MixtureType>::Cp
|
||||
(
|
||||
scalarField& Cps,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
forAll(this->species(), speciei)
|
||||
{
|
||||
Cps[speciei] = this->getLocalThermo(speciei).Cp(p, T);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
void Foam::SpecieMixture<MixtureType>::Cv
|
||||
(
|
||||
scalarField& Cvs,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
forAll(this->species(), speciei)
|
||||
{
|
||||
Cvs[speciei] = this->getLocalThermo(speciei).Cv(p, T);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
template<class MixtureType>
|
||||
Foam::scalar Foam::SpecieMixture<MixtureType>::Cp
|
||||
(
|
||||
|
|
|
|||
|
|
@ -81,34 +81,6 @@ public:
|
|||
//- Molecular weight of the given specie [kg/kmol]
|
||||
virtual scalar W(const label speciei) const;
|
||||
|
||||
//- Number of charges of the given specie []
|
||||
virtual scalar z(const label speciei) const;
|
||||
|
||||
//- Specific charge of the given specie []
|
||||
virtual scalar Qc(const label specieI) const;
|
||||
|
||||
//- Absolute specific charge of the given specie []
|
||||
virtual scalar Qc2(const label specieI) const;
|
||||
|
||||
|
||||
// All species thermo properties
|
||||
|
||||
//- Heat capacity at constant pressure [J/(kg K)]
|
||||
virtual void Cp
|
||||
(
|
||||
scalarField& Cps,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant volume [J/(kg K)]
|
||||
virtual void Cv
|
||||
(
|
||||
scalarField& Cvs,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const;
|
||||
|
||||
|
||||
// Per specie thermo properties
|
||||
|
||||
|
|
|
|||
|
|
@ -81,72 +81,4 @@ Foam::tmp<Foam::volScalarField> Foam::basicSpecieMixture::W() const
|
|||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::basicSpecieMixture::Qc() const
|
||||
{
|
||||
const PtrList<volScalarField>& Y(basicMultiComponentMixture::Y());
|
||||
|
||||
tmp<volScalarField> tQc
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("Qc", Y[0].group()),
|
||||
Y[0].time().timeName(),
|
||||
Y[0].mesh()
|
||||
),
|
||||
Y[0].mesh(),
|
||||
dimensionedScalar("zero", dimCurrent*dimTime/dimMass, 0)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& Qc = tQc.ref();
|
||||
|
||||
dimensionedScalar Qci("Qci", dimCurrent*dimTime/dimMass, 0);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
Qci.value() = this->Qc(i);
|
||||
Qc += Y[i]*Qci;
|
||||
// Qc += Y[i]*this->Qc(i);
|
||||
}
|
||||
|
||||
return tQc;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::basicSpecieMixture::Qc2() const
|
||||
{
|
||||
const PtrList<volScalarField>& Y(basicMultiComponentMixture::Y());
|
||||
|
||||
tmp<volScalarField> tQc
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("Qc2", Y[0].group()),
|
||||
Y[0].time().timeName(),
|
||||
Y[0].mesh()
|
||||
),
|
||||
Y[0].mesh(),
|
||||
dimensionedScalar("zero", sqr(dimCurrent*dimTime)/dimMass, 0)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& Qc = tQc.ref();
|
||||
|
||||
dimensionedScalar Qc2i("Qc2i", sqr(dimCurrent*dimTime)/dimMass, 0);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
Qc2i.value() = this->Qc2(i);
|
||||
Qc += Y[i]*Qc2i;
|
||||
//Qc += Y[i]*this->Qc2(i);
|
||||
}
|
||||
|
||||
return tQc;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -88,43 +88,9 @@ public:
|
|||
//- Molecular weight of the given specie [kg/kmol]
|
||||
virtual scalar W(const label speciei) const = 0;
|
||||
|
||||
//- Number of charges of the given specie []
|
||||
virtual scalar z(const label speciei) const = 0;
|
||||
|
||||
//- Specific charge of the given specie [C/kg]
|
||||
virtual scalar Qc(const label speciei) const = 0;
|
||||
|
||||
//- Absolute specific charge of the given specie [C/kg]
|
||||
virtual scalar Qc2(const label speciei) const = 0;
|
||||
|
||||
//- Molecular weight of the mixture [kg/kmol]
|
||||
tmp<volScalarField> W() const;
|
||||
|
||||
//- Specific charge of the mixture [C/kg]
|
||||
tmp<volScalarField> Qc() const;
|
||||
|
||||
//- Absolute specific charge of the mixture [C^2/kg]
|
||||
tmp<volScalarField> Qc2() const;
|
||||
|
||||
|
||||
// All species thermo properties
|
||||
|
||||
//- Heat capacity at constant pressure [J/(kg K)]
|
||||
virtual void Cp
|
||||
(
|
||||
scalarField& Cps,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const = 0;
|
||||
|
||||
//- Heat capacity at constant volume [J/(kg K)]
|
||||
virtual void Cv
|
||||
(
|
||||
scalarField& Cvs,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const = 0;
|
||||
|
||||
|
||||
// Per specie thermo properties
|
||||
|
||||
|
|
|
|||
|
|
@ -29,24 +29,6 @@ License
|
|||
|
||||
/* * * * * * * * * * * * * * * public constants * * * * * * * * * * * * * * */
|
||||
|
||||
//- Universal gas constant (default in [J/(kmol K)])
|
||||
const Foam::scalar Foam::specie::RR = constant::physicoChemical::R.value()*1000;
|
||||
|
||||
//- Standard pressure (default in [Pa])
|
||||
const Foam::scalar Foam::specie::Pstd = constant::standard::Pstd.value();
|
||||
|
||||
//- Standard temperature (default in [K])
|
||||
const Foam::scalar Foam::specie::Tstd = constant::standard::Tstd.value();
|
||||
|
||||
//- Elementary charge (default in [C])
|
||||
const Foam::scalar Foam::specie::e = constant::electromagnetic::e.value();
|
||||
|
||||
//- Avogadro number (default in [1/mol])
|
||||
const Foam::scalar Foam::specie::NA = constant::physicoChemical::NA.value()*1000;
|
||||
|
||||
//- Boltzmann constant (default in [J/K])
|
||||
const Foam::scalar Foam::specie::k = constant::physicoChemical::k.value();
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(specie, 0);
|
||||
|
|
@ -59,8 +41,7 @@ Foam::specie::specie(Istream& is)
|
|||
:
|
||||
name_(is),
|
||||
nMoles_(readScalar(is)),
|
||||
molWeight_(readScalar(is)),
|
||||
nCharges_(readScalar(is))
|
||||
molWeight_(readScalar(is))
|
||||
{
|
||||
is.check("specie::specie(Istream& is)");
|
||||
}
|
||||
|
|
@ -70,8 +51,7 @@ Foam::specie::specie(const dictionary& dict)
|
|||
:
|
||||
name_(dict.dictName()),
|
||||
nMoles_(readScalar(dict.subDict("specie").lookup("nMoles"))),
|
||||
molWeight_(readScalar(dict.subDict("specie").lookup("molWeight"))),
|
||||
nCharges_(dict.subDict("specie").lookupOrDefault("nCharges", 0.0))
|
||||
molWeight_(readScalar(dict.subDict("specie").lookup("molWeight")))
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -82,7 +62,6 @@ void Foam::specie::write(Ostream& os) const
|
|||
dictionary dict("specie");
|
||||
dict.add("nMoles", nMoles_);
|
||||
dict.add("molWeight", molWeight_);
|
||||
dict.add("nCharges", nCharges_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
|
@ -93,8 +72,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const specie& st)
|
|||
{
|
||||
os << st.name_ << tab
|
||||
<< st.nMoles_ << tab
|
||||
<< st.molWeight_ << tab
|
||||
<< st.nCharges_;
|
||||
<< st.molWeight_;
|
||||
|
||||
os.check("Ostream& operator<<(Ostream& os, const specie& st)");
|
||||
return os;
|
||||
|
|
|
|||
|
|
@ -77,9 +77,6 @@ class specie
|
|||
//- Molecular weight of specie [kg/kmol]
|
||||
scalar molWeight_;
|
||||
|
||||
//- Number of elementary charges of specie
|
||||
scalar nCharges_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -87,29 +84,6 @@ public:
|
|||
ClassName("specie");
|
||||
|
||||
|
||||
// Public constants
|
||||
|
||||
// Thermodynamic constants
|
||||
|
||||
//- Universal gas constant [J/(kmol K)]
|
||||
static const scalar RR;
|
||||
|
||||
//- Standard pressure [Pa]
|
||||
static const scalar Pstd;
|
||||
|
||||
//- Standard temperature [K]
|
||||
static const scalar Tstd;
|
||||
|
||||
//- Elementary charge [C]
|
||||
static const scalar e;
|
||||
|
||||
//- Avogadro number [1/kmol]
|
||||
static const scalar NA;
|
||||
|
||||
//- Boltzmann constant [J/K]
|
||||
static const scalar k;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
|
|
@ -124,23 +98,6 @@ public:
|
|||
const scalar molWeight
|
||||
);
|
||||
|
||||
//- Construct from components without name
|
||||
inline specie
|
||||
(
|
||||
const scalar nMoles,
|
||||
const scalar molWeight,
|
||||
const scalar nCharges
|
||||
);
|
||||
|
||||
//- Construct from components with name
|
||||
inline specie
|
||||
(
|
||||
const word& name,
|
||||
const scalar nMoles,
|
||||
const scalar molWeight,
|
||||
const scalar nCharges
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
inline specie(const specie&);
|
||||
|
||||
|
|
@ -170,27 +127,6 @@ public:
|
|||
//- Gas constant [J/(kg K)]
|
||||
inline scalar R() const;
|
||||
|
||||
//- Charge number
|
||||
inline scalar z() const;
|
||||
|
||||
|
||||
// Electric charge function
|
||||
|
||||
|
||||
// Mole specific properties
|
||||
|
||||
//- Electric charge [C/kmol]
|
||||
inline scalar qc() const;
|
||||
|
||||
|
||||
// Mass specific properties
|
||||
|
||||
//- Electric charge [C/kg]
|
||||
inline scalar Qc() const;
|
||||
|
||||
//- Electric charge squared [C^2/kg]
|
||||
inline scalar Qc2() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ inline specie::specie
|
|||
:
|
||||
name_(name),
|
||||
nMoles_(nMoles),
|
||||
molWeight_(molWeight),
|
||||
nCharges_(0.0)
|
||||
molWeight_(molWeight)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -53,36 +52,7 @@ inline specie::specie
|
|||
)
|
||||
:
|
||||
nMoles_(nMoles),
|
||||
molWeight_(molWeight),
|
||||
nCharges_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
inline specie::specie
|
||||
(
|
||||
const word& name,
|
||||
const scalar nMoles,
|
||||
const scalar molWeight,
|
||||
const scalar nCharges
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
nMoles_(nMoles),
|
||||
molWeight_(molWeight),
|
||||
nCharges_(nCharges)
|
||||
{}
|
||||
|
||||
|
||||
inline specie::specie
|
||||
(
|
||||
const scalar nMoles,
|
||||
const scalar molWeight,
|
||||
const scalar nCharges
|
||||
)
|
||||
:
|
||||
nMoles_(nMoles),
|
||||
molWeight_(molWeight),
|
||||
nCharges_(nCharges)
|
||||
molWeight_(molWeight)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -92,8 +62,7 @@ inline specie::specie(const specie& st)
|
|||
:
|
||||
name_(st.name_),
|
||||
nMoles_(st.nMoles_),
|
||||
molWeight_(st.molWeight_),
|
||||
nCharges_(st.nCharges_)
|
||||
molWeight_(st.molWeight_)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -101,8 +70,7 @@ inline specie::specie(const word& name, const specie& st)
|
|||
:
|
||||
name_(name),
|
||||
nMoles_(st.nMoles_),
|
||||
molWeight_(st.molWeight_),
|
||||
nCharges_(st.nCharges_)
|
||||
molWeight_(st.molWeight_)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -132,30 +100,6 @@ inline scalar specie::R() const
|
|||
}
|
||||
|
||||
|
||||
inline scalar specie::z() const
|
||||
{
|
||||
return nCharges_;
|
||||
}
|
||||
|
||||
|
||||
inline scalar specie::qc() const
|
||||
{
|
||||
return nCharges_ * NA * e;
|
||||
}
|
||||
|
||||
|
||||
inline scalar specie::Qc() const
|
||||
{
|
||||
return nCharges_ * NA * e / molWeight_;
|
||||
}
|
||||
|
||||
|
||||
inline scalar specie::Qc2() const
|
||||
{
|
||||
return nCharges_ * nCharges_ * NA * e * e / molWeight_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void specie::operator=(const specie& st)
|
||||
|
|
@ -163,7 +107,6 @@ inline void specie::operator=(const specie& st)
|
|||
//name_ = st.name_;
|
||||
nMoles_ = st.nMoles_;
|
||||
molWeight_ = st.molWeight_;
|
||||
nCharges_ = st.nCharges_;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -171,10 +114,6 @@ inline void specie::operator+=(const specie& st)
|
|||
{
|
||||
scalar sumNmoles = max(nMoles_ + st.nMoles_, SMALL);
|
||||
|
||||
nCharges_ =
|
||||
nMoles_/sumNmoles*nCharges_
|
||||
+ st.nMoles_/sumNmoles*st.nCharges_;
|
||||
|
||||
molWeight_ =
|
||||
nMoles_/sumNmoles*molWeight_
|
||||
+ st.nMoles_/sumNmoles*st.molWeight_;
|
||||
|
|
@ -191,10 +130,6 @@ inline void specie::operator-=(const specie& st)
|
|||
diffnMoles = SMALL;
|
||||
}
|
||||
|
||||
nCharges_ =
|
||||
nMoles_/diffnMoles*nCharges_
|
||||
- st.nMoles_/diffnMoles*st.nCharges_;
|
||||
|
||||
molWeight_ =
|
||||
nMoles_/diffnMoles*molWeight_
|
||||
- st.nMoles_/diffnMoles*st.molWeight_;
|
||||
|
|
@ -219,9 +154,7 @@ inline specie operator+(const specie& st1, const specie& st2)
|
|||
(
|
||||
sumNmoles,
|
||||
st1.nMoles_/sumNmoles*st1.molWeight_
|
||||
+ st2.nMoles_/sumNmoles*st2.molWeight_,
|
||||
st1.nMoles_/sumNmoles*st1.nCharges_
|
||||
+ st2.nMoles_/sumNmoles*st2.nCharges_
|
||||
+ st2.nMoles_/sumNmoles*st2.molWeight_
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -238,9 +171,7 @@ inline specie operator-(const specie& st1, const specie& st2)
|
|||
(
|
||||
diffNmoles,
|
||||
st1.nMoles_/diffNmoles*st1.molWeight_
|
||||
- st2.nMoles_/diffNmoles*st2.molWeight_,
|
||||
st1.nMoles_/diffNmoles*st1.nCharges_
|
||||
- st2.nMoles_/diffNmoles*st2.nCharges_
|
||||
- st2.nMoles_/diffNmoles*st2.molWeight_
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -250,8 +181,7 @@ inline specie operator*(const scalar s, const specie& st)
|
|||
return specie
|
||||
(
|
||||
s*st.nMoles_,
|
||||
st.molWeight_,
|
||||
st.nCharges_
|
||||
st.molWeight_
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,7 +336,6 @@ public:
|
|||
) const;
|
||||
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write to Ostream
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue