mixture got specific charge field calculation

This commit is contained in:
ignis 2018-04-19 13:39:45 +09:00
parent 3efddbac8a
commit c06d324891
8 changed files with 67 additions and 35 deletions

View file

@ -69,12 +69,12 @@ Foam::scalar Foam::SpecieMixture<MixtureType>::W
template<class MixtureType> template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::z Foam::scalar Foam::SpecieMixture<MixtureType>::Qc
( (
const label speciei const label speciei
) const ) const
{ {
return this->getLocalThermo(speciei).z(); return this->getLocalThermo(speciei).Qc();
} }

View file

@ -81,8 +81,8 @@ public:
//- Molecular weight of the given specie [kg/kmol] //- Molecular weight of the given specie [kg/kmol]
virtual scalar W(const label speciei) const; virtual scalar W(const label speciei) const;
//- Number of elementary charges of the given specie [] //- Specific charge of the given specie []
virtual scalar z(const label specieI) const; virtual scalar Qc(const label specieI) const;
// Per specie thermo properties // Per specie thermo properties

View file

@ -81,4 +81,34 @@ 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", dimless, 0)
)
);
volScalarField& Qc = tQc.ref();
forAll(Y, i)
{
Qc += Y[i]*this->Qc(i);
}
return tQc;
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -88,9 +88,15 @@ public:
//- Molecular weight of the given specie [kg/kmol] //- Molecular weight of the given specie [kg/kmol]
virtual scalar W(const label speciei) const = 0; virtual scalar W(const label speciei) const = 0;
//- Specific charge of the given specie [C/kg]
virtual scalar Qc(const label speciei) const = 0;
//- Molecular weight of the mixture [kg/kmol] //- Molecular weight of the mixture [kg/kmol]
tmp<volScalarField> W() const; tmp<volScalarField> W() const;
//- Charge number of the mixture [C/kg]
tmp<volScalarField> Qc() const;
// Per specie thermo properties // Per specie thermo properties

View file

@ -174,6 +174,21 @@ public:
inline scalar z() const; 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;
// I-O // I-O
//- Write to Ostream //- Write to Ostream

View file

@ -138,6 +138,18 @@ inline scalar specie::z() const
} }
inline scalar specie::qc() const
{
return nCharges_ * NA * e;
}
inline scalar specie::Qc() const
{
return nCharges_ * NA * e / molWeight_;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void specie::operator=(const specie& st) inline void specie::operator=(const specie& st)

View file

@ -336,21 +336,6 @@ public:
) const; ) 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;
// I-O // I-O

View file

@ -530,20 +530,4 @@ inline Foam::species::thermo<Thermo, Type> Foam::species::operator==
} }
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::species::thermo<Thermo, Type>::qc() const
{
return this->z() * this->NA * this->e;
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::species::thermo<Thermo, Type>::QC() const
{
return this->z() * this->NA * this->e / this->W();
}
// ************************************************************************* // // ************************************************************************* //