diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C index 853fe889a..951fe48bf 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C @@ -69,12 +69,12 @@ Foam::scalar Foam::SpecieMixture::W template -Foam::scalar Foam::SpecieMixture::z +Foam::scalar Foam::SpecieMixture::Qc ( const label speciei ) const { - return this->getLocalThermo(speciei).z(); + return this->getLocalThermo(speciei).Qc(); } diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H index 1fc03f531..b4d6c31c8 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H @@ -81,8 +81,8 @@ public: //- Molecular weight of the given specie [kg/kmol] virtual scalar W(const label speciei) const; - //- Number of elementary 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; // Per specie thermo properties diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C index a3643c0d3..82e111b97 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C @@ -81,4 +81,34 @@ Foam::tmp Foam::basicSpecieMixture::W() const } +Foam::tmp Foam::basicSpecieMixture::Qc() const +{ + const PtrList& Y(basicMultiComponentMixture::Y()); + + tmp 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; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H index e814154a9..459baecec 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H @@ -88,9 +88,15 @@ public: //- Molecular weight of the given specie [kg/kmol] 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] tmp W() const; + //- Charge number of the mixture [C/kg] + tmp Qc() const; + // Per specie thermo properties diff --git a/src/thermophysicalModels/specie/specie/specie.H b/src/thermophysicalModels/specie/specie/specie.H index e48be854f..a8b1803b6 100644 --- a/src/thermophysicalModels/specie/specie/specie.H +++ b/src/thermophysicalModels/specie/specie/specie.H @@ -174,6 +174,21 @@ public: 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 //- Write to Ostream diff --git a/src/thermophysicalModels/specie/specie/specieI.H b/src/thermophysicalModels/specie/specie/specieI.H index a0d498b5e..becb6e87a 100644 --- a/src/thermophysicalModels/specie/specie/specieI.H +++ b/src/thermophysicalModels/specie/specie/specieI.H @@ -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 * * * * * * * * * * * * * // inline void specie::operator=(const specie& st) diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermo.H b/src/thermophysicalModels/specie/thermo/thermo/thermo.H index c0c42c479..26251ca56 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermo.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermo.H @@ -336,21 +336,6 @@ public: ) 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 diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H index 4252c50d2..44197fd18 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H @@ -530,20 +530,4 @@ inline Foam::species::thermo Foam::species::operator== } -template class Type> -inline Foam::scalar -Foam::species::thermo::qc() const -{ - return this->z() * this->NA * this->e; -} - - -template class Type> -inline Foam::scalar -Foam::species::thermo::QC() const -{ - return this->z() * this->NA * this->e / this->W(); -} - - // ************************************************************************* //