From 8670f39b9f2bd3d0a9a0212f23e5a90fdcdb4e6f Mon Sep 17 00:00:00 2001 From: ignis Date: Wed, 25 Apr 2018 14:56:01 +0900 Subject: [PATCH] specie and specieMixtures feature for electrical property calculation --- .../mixtures/SpecieMixture/SpecieMixture.C | 20 +++++++++++++ .../mixtures/SpecieMixture/SpecieMixture.H | 6 ++++ .../basicSpecieMixture/basicSpecieMixture.C | 30 +++++++++++++++++++ .../basicSpecieMixture/basicSpecieMixture.H | 11 ++++++- .../specie/specie/specie.H | 3 ++ .../specie/specie/specieI.H | 6 ++++ 6 files changed, 75 insertions(+), 1 deletion(-) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C index 951fe48bf..6bf508bb4 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C @@ -68,6 +68,16 @@ Foam::scalar Foam::SpecieMixture::W } +template +Foam::scalar Foam::SpecieMixture::z +( + const label speciei +) const +{ + return this->getLocalThermo(speciei).z(); +} + + template Foam::scalar Foam::SpecieMixture::Qc ( @@ -78,6 +88,16 @@ Foam::scalar Foam::SpecieMixture::Qc } +template +Foam::scalar Foam::SpecieMixture::Qc2 +( + const label speciei +) const +{ + return this->getLocalThermo(speciei).Qc2(); +} + + template Foam::scalar Foam::SpecieMixture::Cp ( diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H index b4d6c31c8..ae08bf377 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H @@ -81,9 +81,15 @@ 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; + // Per specie thermo properties diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C index 82e111b97..0ff307384 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.C @@ -111,4 +111,34 @@ Foam::tmp Foam::basicSpecieMixture::Qc() const } +Foam::tmp Foam::basicSpecieMixture::Qc2() const +{ + const PtrList& Y(basicMultiComponentMixture::Y()); + + tmp tQc + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("Qc2", 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->Qc2(i); + } + + return tQc; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H index 459baecec..cd5880dbe 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H @@ -88,15 +88,24 @@ 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 W() const; - //- Charge number of the mixture [C/kg] + //- Specific charge of the mixture [C/kg] tmp Qc() const; + //- Absolute specific charge of the mixture [C^2/kg] + tmp Qc2() const; + // Per specie thermo properties diff --git a/src/thermophysicalModels/specie/specie/specie.H b/src/thermophysicalModels/specie/specie/specie.H index a8b1803b6..2251644dc 100644 --- a/src/thermophysicalModels/specie/specie/specie.H +++ b/src/thermophysicalModels/specie/specie/specie.H @@ -188,6 +188,9 @@ public: //- Electric charge [C/kg] inline scalar Qc() const; + //- Electric charge squared [C^2/kg] + inline scalar Qc2() const; + // I-O diff --git a/src/thermophysicalModels/specie/specie/specieI.H b/src/thermophysicalModels/specie/specie/specieI.H index becb6e87a..0b2689d53 100644 --- a/src/thermophysicalModels/specie/specie/specieI.H +++ b/src/thermophysicalModels/specie/specie/specieI.H @@ -150,6 +150,12 @@ inline scalar specie::Qc() const } +inline scalar specie::Qc2() const +{ + return nCharges_ * nCharges_ * NA * e * e / molWeight_; +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // inline void specie::operator=(const specie& st)