From e3278f0f1b2d1b064bf74e4621c3bd1b302bfec3 Mon Sep 17 00:00:00 2001 From: ignis Date: Sun, 9 Oct 2016 15:31:43 +0900 Subject: [PATCH] basicMultiComponentMixture got featured species diffusivity fields --- .../basicMultiComponentMixture.C | 19 ++++++++ .../basicMultiComponentMixture.H | 27 +++++++++++ .../basicMultiComponentMixtureI.H | 47 +++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C index 2ad347e1..f71ece0b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C @@ -35,6 +35,7 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture ) : species_(specieNames), + D_(species_.size()), Y_(species_.size()) { forAll(species_, i) @@ -99,6 +100,24 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture ) ); } + + D_.set + ( + i, + new volScalarField + ( + IOobject + ( + "D." + species_[i], + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("D", dimArea/dimTime, 0.0) + ) + ); } // Do not enforce constraint of sum of mass fractions to equal 1 here diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H index ea712fc2..0a5abd06 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H @@ -62,6 +62,9 @@ protected: //- Species mass fractions PtrList Y_; + //- Mixture-averaged species diffusivities + PtrList D_; + public: @@ -87,6 +90,12 @@ public: // Member functions + //- Calculate mixture-aveaged diffusivities + virtual void calculateDiffusivities(const volScalarField& p, const volScalarField& T) const + { + return; + } + //- Return the table of species const speciesTable& species() const { @@ -111,6 +120,24 @@ public: //- Return the const mass-fraction field for a specie given by name inline const volScalarField& Y(const word& specieName) const; + //- Return the species diffusivity fields + inline PtrList& D(); + + //- Return the const species diffusivity fields + inline const PtrList& D() const; + + //- Return the diffusivity field for a specie given by index + inline volScalarField& D(const label i); + + //- Return the const diffusivity field for a specie given by index + inline const volScalarField& D(const label i) const; + + //- Return the diffusivity field for a specie given by name + inline volScalarField& D(const word& specieName); + + //- Return the const diffusivity field for a specie given by name + inline const volScalarField& D(const word& specieName) const; + //- Does the mixture include this specie? inline bool contains(const word& specieName) const; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H index 49cb92e8..90275ab6 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H @@ -70,6 +70,53 @@ inline const Foam::volScalarField& Foam::basicMultiComponentMixture::Y } +inline Foam::PtrList& +Foam::basicMultiComponentMixture::D() +{ + return D_; +} + + +inline const Foam::PtrList& +Foam::basicMultiComponentMixture::D() const +{ + return D_; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::D(const label i) +{ + return D_[i]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::D +( + const label i +) const +{ + return D_[i]; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::D +( + const word& specieName +) +{ + return D_[species_[specieName]]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::D +( + const word& specieName +) const +{ + return D_[species_[specieName]]; +} + + inline bool Foam::basicMultiComponentMixture::contains ( const word& specieName