diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/Make/files b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/Make/files
index f193faaf03..8dba9ed218 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/Make/files
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/Make/files
@@ -20,9 +20,9 @@ wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartu
wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C
wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C
+alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C
alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C
-alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C
-alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C
+alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C
alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
copiedFixedValue/copiedFixedValueFvPatchScalarField.C
fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C
deleted file mode 100644
index 7a6e41a482..0000000000
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,215 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2015-2019 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 .
-
-\*---------------------------------------------------------------------------*/
-
-#include "alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H"
-#include "fvPatchFieldMapper.H"
-#include "addToRunTimeSelectionTable.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF
-)
-:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
- vaporPhaseName_("vapor"),
- relax_(1.0),
- fixedDmdt_(0.0),
- L_(0.0)
-{}
-
-
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF,
- const dictionary& dict
-)
-:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
- vaporPhaseName_(dict.lookup("vaporPhase")),
- relax_(dict.lookupOrDefault("relax", 1.0)),
- fixedDmdt_(dict.lookupOrDefault("fixedDmdt", 0.0)),
- L_(dict.lookupOrDefault("L", 0.0))
-{}
-
-
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
- const fvPatch& p,
- const DimensionedField& iF,
- const fvPatchFieldMapper& mapper
-)
-:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
- (
- psf,
- p,
- iF,
- mapper
- ),
- fixedDmdt_(psf.fixedDmdt_),
- L_(psf.L_)
-{}
-
-
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf
-)
-:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
- relax_(psf.relax_),
- fixedDmdt_(psf.fixedDmdt_),
- L_(psf.L_)
-{}
-
-
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
- const DimensionedField& iF
-)
-:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
- relax_(psf.relax_),
- fixedDmdt_(psf.fixedDmdt_),
- L_(psf.L_)
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-bool alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-activePhasePair(const phasePairKey& phasePair) const
-{
- if (phasePair == phasePairKey(vaporPhaseName_, internalField().group()))
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-
-const scalarField& alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-dmdt(const phasePairKey& phasePair) const
-{
- if (activePhasePair(phasePair))
- {
- return dmdt_;
- }
- else
- {
- FatalErrorInFunction
- << " dmdt requested for invalid phasePair!"
- << abort(FatalError);
-
- return mDotL_;
- }
-}
-
-
-const scalarField& alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
-mDotL(const phasePairKey& phasePair) const
-{
- if (activePhasePair(phasePair))
- {
- return mDotL_;
- }
- else
- {
- FatalErrorInFunction
- << " mDotL requested for invalid phasePair!"
- << abort(FatalError);
-
- return mDotL_;
- }
-}
-
-
-void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
-{
- if (updated())
- {
- return;
- }
-
- dmdt_ = (1 - relax_)*dmdt_ + relax_*fixedDmdt_;
- mDotL_ = dmdt_*L_;
-
- operator==(calcAlphat(*this));
-
- fixedValueFvPatchScalarField::updateCoeffs();
-}
-
-
-void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::write
-(
- Ostream& os
-) const
-{
- fvPatchField::write(os);
- writeEntry(os, "vaporPhase", vaporPhaseName_);
- writeEntry(os, "relax", relax_);
- writeEntry(os, "fixedDmdt", fixedDmdt_);
- writeEntry(os, "L", L_);
- writeEntry(os, "dmdt", dmdt_);
- writeEntry(os, "value", *this);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
- fvPatchScalarField,
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
-);
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace compressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000..ef8dfbf2d3
--- /dev/null
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C
@@ -0,0 +1,156 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2015-2019 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.H"
+#include "fvPatchFieldMapper.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF),
+ fixedDmdtf_(0),
+ L_(0)
+{}
+
+
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict),
+ fixedDmdtf_(dict.lookupOrDefault("fixedDmdtf", 0)),
+ L_(dict.lookupOrDefault("L", 0))
+{}
+
+
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+(
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField& psf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ alphatPhaseChangeWallFunctionFvPatchScalarField
+ (
+ psf,
+ p,
+ iF,
+ mapper
+ ),
+ fixedDmdtf_(psf.fixedDmdtf_),
+ L_(psf.L_)
+{}
+
+
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+(
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField& psf
+)
+:
+ alphatPhaseChangeWallFunctionFvPatchScalarField(psf),
+ fixedDmdtf_(psf.fixedDmdtf_),
+ L_(psf.L_)
+{}
+
+
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::
+alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+(
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField& psf,
+ const DimensionedField& iF
+)
+:
+ alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
+ fixedDmdtf_(psf.fixedDmdtf_),
+ L_(psf.L_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ dmdtf_ = (1 - relax_)*dmdtf_ + relax_*fixedDmdtf_;
+ dmdtLf_ = dmdtf_*L_;
+
+ operator==(calcAlphat(*this));
+
+ fixedValueFvPatchScalarField::updateCoeffs();
+}
+
+
+void alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::write
+(
+ Ostream& os
+) const
+{
+ alphatPhaseChangeWallFunctionFvPatchScalarField::write(os);
+
+ writeEntry(os, "fixedDmdtf", fixedDmdtf_);
+ writeEntry(os, "L", L_);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+ fvPatchScalarField,
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
+);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.H
similarity index 64%
rename from applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H
rename to applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.H
index cfe32297f5..53411b3161 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.H
@@ -23,25 +23,24 @@ License
Class
Foam::compressible::
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
Description
- A simple alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField with
+ A simple alphatPhaseChangeWallFunctionFvPatchScalarField with
a fixed volumetric phase-change mass flux.
See also
- Foam::compressible::
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ Foam::compressible::alphatPhaseChangeWallFunctionFvPatchScalarField
SourceFiles
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
-#ifndef alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H
-#define alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H
+#ifndef alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField_H
+#define alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField_H
-#include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H"
+#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -51,23 +50,17 @@ namespace compressible
{
/*---------------------------------------------------------------------------*\
- Class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField Declaration
+ Class alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
-class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+class alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
:
- public alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ public alphatPhaseChangeWallFunctionFvPatchScalarField
{
// Private Data
- //- name on the phase
- word vaporPhaseName_;
-
- //- dmdt relaxationFactor
- scalar relax_;
-
//- Volumetric phase-change mass flux in near wall cells
- scalar fixedDmdt_;
+ scalar fixedDmdtf_;
//- Latent heat
scalar L_;
@@ -76,20 +69,20 @@ class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
public:
//- Runtime type information
- TypeName("compressible::alphatFixedDmdtWallBoilingWallFunction");
+ TypeName("compressible::alphatFixedDmdtfWallBoilingWallFunction");
// Constructors
//- Construct from patch and internal field
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField&
);
//- Construct from patch, internal field and dictionary
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField&,
@@ -97,20 +90,20 @@ public:
);
//- Construct by mapping given
- // alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ // alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
// onto a new patch
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField&,
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField&,
const fvPatchFieldMapper&
);
//- Copy constructor
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField&
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
@@ -118,7 +111,7 @@ public:
{
return tmp
(
- new alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ new alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
*this
)
@@ -126,9 +119,9 @@ public:
}
//- Copy constructor setting internal field reference
- alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
- const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField&,
+ const alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField&,
const DimensionedField&
);
@@ -140,7 +133,7 @@ public:
{
return tmp
(
- new alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
+ new alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField
(
*this,
iF
@@ -151,15 +144,6 @@ public:
// Member Functions
- //- Is there phase change mass transfer for this phasePair
- virtual bool activePhasePair(const phasePairKey&) const;
-
- //- Return the rate of phase-change for specific phase pair
- virtual const scalarField& dmdt(const phasePairKey&) const;
-
- //- Return the rate of phase-change for specific phase pair
- virtual const scalarField& mDotL(const phasePairKey&) const;
-
// Evaluation functions
//- Update the coefficients associated with the patch field
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C
index ba7ff7ee04..0130ec720a 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C
@@ -48,9 +48,11 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
const DimensionedField& iF
)
:
- fixedValueFvPatchScalarField(p, iF),
- dmdt_(p.size(), 0),
- mDotL_(p.size(), 0)
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField(p, iF),
+ otherPhaseName_(word::null),
+ relax_(1),
+ dmdtf_(p.size(), 0),
+ dmdtLf_(p.size(), 0)
{}
@@ -62,18 +64,31 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
const dictionary& dict
)
:
- fixedValueFvPatchScalarField(p, iF, dict),
- dmdt_(p.size(), 0),
- mDotL_(p.size(), 0)
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
+ otherPhaseName_(dict.lookup("otherPhase")),
+ relax_(dict.lookupOrDefault("relax", 1)),
+ dmdtf_(p.size(), 0),
+ dmdtLf_(p.size(), 0)
{
- if (dict.found("dmdt"))
+ // Check that otherPhaseName != this phase
+ if (internalField().group() == otherPhaseName_)
{
- dmdt_ = scalarField("dmdt", dict, p.size());
+ FatalErrorInFunction
+ << "otherPhase should be the name of the vapor phase that "
+ << "corresponds to the liquid base or vice versa" << nl
+ << "This phase: " << internalField().group() << nl
+ << "otherPhase: " << otherPhaseName_
+ << abort(FatalError);
}
- if (dict.found("mDotL"))
+ if (dict.found("dmdtf"))
{
- dmdt_ = scalarField("mDotL", dict, p.size());
+ dmdtf_ = scalarField("dmdtf", dict, p.size());
+ }
+
+ if (dict.found("dmdtLf"))
+ {
+ dmdtf_ = scalarField("dmdtLf", dict, p.size());
}
}
@@ -87,9 +102,11 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
- fixedValueFvPatchScalarField(ptf, p, iF, mapper),
- dmdt_(mapper(ptf.dmdt_)),
- mDotL_(mapper(ptf.mDotL_))
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
+ otherPhaseName_(ptf.otherPhaseName_),
+ relax_(ptf.relax_),
+ dmdtf_(mapper(ptf.dmdtf_)),
+ dmdtLf_(mapper(ptf.dmdtLf_))
{}
@@ -99,9 +116,11 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
const alphatPhaseChangeWallFunctionFvPatchScalarField& awfpsf
)
:
- fixedValueFvPatchScalarField(awfpsf),
- dmdt_(awfpsf.dmdt_),
- mDotL_(awfpsf.mDotL_)
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField(awfpsf),
+ otherPhaseName_(awfpsf.otherPhaseName_),
+ relax_(awfpsf.relax_),
+ dmdtf_(awfpsf.dmdtf_),
+ dmdtLf_(awfpsf.dmdtLf_)
{}
@@ -112,21 +131,88 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
const DimensionedField& iF
)
:
- fixedValueFvPatchScalarField(awfpsf, iF),
- dmdt_(awfpsf.dmdt_),
- mDotL_(awfpsf.mDotL_)
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField(awfpsf, iF),
+ otherPhaseName_(awfpsf.otherPhaseName_),
+ relax_(awfpsf.relax_),
+ dmdtf_(awfpsf.dmdtf_),
+ dmdtLf_(awfpsf.dmdtLf_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void alphatPhaseChangeWallFunctionFvPatchScalarField::
-write(Ostream& os) const
+bool alphatPhaseChangeWallFunctionFvPatchScalarField::
+activePhasePair(const phasePairKey& phasePair) const
{
- fvPatchField::write(os);
- writeEntry(os, "dmdt", dmdt_);
- writeEntry(os, "mDotL", mDotL_);
- writeEntry(os, "value", *this);
+ if (phasePair == phasePairKey(otherPhaseName_, internalField().group()))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+const scalarField&
+alphatPhaseChangeWallFunctionFvPatchScalarField::dmdtf() const
+{
+ return dmdtf_;
+}
+
+
+const scalarField& alphatPhaseChangeWallFunctionFvPatchScalarField::
+dmdtf(const phasePairKey& phasePair) const
+{
+ if (activePhasePair(phasePair))
+ {
+ return dmdtf_;
+ }
+ else
+ {
+ FatalErrorInFunction
+ << " dmdtf requested for invalid phasePair!"
+ << abort(FatalError);
+
+ return dmdtLf_;
+ }
+}
+
+
+const scalarField&
+alphatPhaseChangeWallFunctionFvPatchScalarField::dmdtLf() const
+{
+ return dmdtLf_;
+}
+
+
+const scalarField& alphatPhaseChangeWallFunctionFvPatchScalarField::
+dmdtLf(const phasePairKey& phasePair) const
+{
+ if (activePhasePair(phasePair))
+ {
+ return dmdtLf_;
+ }
+ else
+ {
+ FatalErrorInFunction
+ << " dmdtLf requested for invalid phasePair!"
+ << abort(FatalError);
+
+ return dmdtLf_;
+ }
+}
+
+
+void alphatPhaseChangeWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::write(os);
+
+ writeEntry(os, "otherPhase", otherPhaseName_);
+ writeEntry(os, "relax", relax_);
+ writeEntry(os, "dmdtf", dmdtf_);
+ writeEntry(os, "dmdtLf", dmdtLf_);
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H
index b78a6e3d61..6e52b783ed 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H
@@ -28,8 +28,7 @@ Description
Abstract base-class for all alphatWallFunctions supporting phase-change.
See also
- Foam::fixedValueFvPatchScalarField
- Foam::alphatWallFunctionFvPatchScalarField
+ Foam::alphatPhaseJayatillekeWallFunctionFvPatchScalarField
SourceFiles
alphatPhaseChangeWallFunctionFvPatchScalarField.C
@@ -39,7 +38,7 @@ SourceFiles
#ifndef alphatPhaseChangeWallFunctionFvPatchScalarField_H
#define alphatPhaseChangeWallFunctionFvPatchScalarField_H
-#include "fixedValueFvPatchFields.H"
+#include "alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H"
#include "phasePairKey.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -55,17 +54,23 @@ namespace compressible
class alphatPhaseChangeWallFunctionFvPatchScalarField
:
- public fixedValueFvPatchScalarField
+ public alphatPhaseJayatillekeWallFunctionFvPatchScalarField
{
protected:
// Protected data
+ //- Name of the other phase
+ const word otherPhaseName_;
+
+ //- Relaxation factor
+ const scalar relax_;
+
//- Rate of phase-change
- scalarField dmdt_;
+ scalarField dmdtf_;
//- Latent heat of the phase-change
- scalarField mDotL_;
+ scalarField dmdtLf_;
public:
@@ -118,47 +123,22 @@ public:
// Member Functions
- //- Return the rate of phase-change
- virtual const scalarField& dmdt() const
- {
- return dmdt_;
- }
-
- //- Return the enthalpy source due to phase-change
- virtual const scalarField& mDotL() const
- {
- return mDotL_;
- }
//- Is there phase change mass transfer for this phasePair
- virtual bool activePhasePair(const phasePairKey&) const
- {
- return false;
- }
+ bool activePhasePair(const phasePairKey&) const;
+
+ //- Return the rate of phase-change
+ const scalarField& dmdtf() const;
//- Return the rate of phase-change for specific phase pair
- virtual const scalarField& dmdt(const phasePairKey&) const
- {
- return dmdt_;
- }
+ const scalarField& dmdtf(const phasePairKey&) const;
+
+ //- Return the enthalpy source due to phase-change
+ const scalarField& dmdtLf() const;
//- Return the rate of phase-change for specific phase pair
- virtual const scalarField& mDotL(const phasePairKey&) const
- {
- return mDotL_;
- }
+ const scalarField& dmdtLf(const phasePairKey&) const;
- //- Return the rate of phase-change for specific phase
- virtual scalarField dmdt(const word&) const
- {
- return dmdt_;
- }
-
- //- Return the enthalpy source due to phase-change for specific phase
- virtual scalarField mDotL(const word&) const
- {
- return mDotL_;
- }
// Evaluation functions
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C
similarity index 77%
rename from applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C
rename to applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C
index f93001318c..21295872dc 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C
@@ -23,11 +23,9 @@ License
\*---------------------------------------------------------------------------*/
-#include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H"
+#include "alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H"
#include "phaseSystem.H"
-#include "compressibleTurbulenceModel.H"
-#include "ThermalDiffusivity.H"
-#include "PhaseCompressibleTurbulenceModel.H"
+#include "phaseCompressibleTurbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -39,27 +37,23 @@ namespace compressible
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-scalar alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::maxExp_
- = 50.0;
-scalar alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::tolerance_
- = 0.01;
-label alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::maxIters_
- = 10;
+scalar alphatPhaseJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0;
+scalar alphatPhaseJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
+label alphatPhaseJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-tmp
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::Psmooth
+tmp alphatPhaseJayatillekeWallFunctionFvPatchScalarField::Psmooth
(
const scalarField& Prat
) const
{
- return 9.24*(pow(Prat, 0.75) - 1)*(1 + 0.28*exp(-0.007*Prat));
+ return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat));
}
tmp
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
(
const nutWallFunctionFvPatchScalarField& nutw,
const scalarField& P,
@@ -83,6 +77,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
if (yptNew < vSmall)
{
ypsf[facei] = 0;
+ break;
}
else if (mag(yptNew - ypt) < tolerance_)
{
@@ -100,8 +95,76 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
return typsf;
}
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchScalarField(p, iF),
+ Prt_(0.85)
+{}
+
+
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField
+(
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchScalarField(ptf, p, iF, mapper),
+ Prt_(ptf.Prt_)
+{}
+
+
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchScalarField(p, iF, dict),
+ Prt_(dict.lookupOrDefault("Prt", 0.85))
+{}
+
+
+
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField
+(
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& awfpsf
+)
+:
+ fixedValueFvPatchScalarField(awfpsf),
+ Prt_(awfpsf.Prt_)
+{}
+
+
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField
+(
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& awfpsf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchScalarField(awfpsf, iF),
+ Prt_(awfpsf.Prt_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
tmp
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
+alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat
(
const scalarField& prevAlphat
) const
@@ -221,73 +284,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
}
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF
-)
-:
- alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF),
- Prt_(0.85)
-{}
-
-
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF,
- const dictionary& dict
-)
-:
- alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict),
- Prt_(dict.lookupOrDefault("Prt", 0.85))
-{}
-
-
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
-(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField& ptf,
- const fvPatch& p,
- const DimensionedField& iF,
- const fvPatchFieldMapper& mapper
-)
-:
- alphatPhaseChangeWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
- Prt_(ptf.Prt_)
-{}
-
-
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
-(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField& awfpsf
-)
-:
- alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf),
- Prt_(awfpsf.Prt_)
-{}
-
-
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::
-alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
-(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField& awfpsf,
- const DimensionedField& iF
-)
-:
- alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf, iF),
- Prt_(awfpsf.Prt_)
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
+void alphatPhaseJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
@@ -300,14 +297,13 @@ void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
}
-void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::write
+void alphatPhaseJayatillekeWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchField::write(os);
writeEntry(os, "Prt", Prt_);
- writeEntry(os, "dmdt", dmdt_);
writeEntry(os, "value", *this);
}
@@ -317,10 +313,9 @@ void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::write
makePatchTypeField
(
fvPatchScalarField,
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
);
-
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H
similarity index 75%
rename from applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H
rename to applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H
index 53d07224f0..633eeff4de 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H
@@ -23,7 +23,7 @@ License
Class
Foam::compressible::
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
Description
This boundary condition provides a thermal wall function for turbulent
@@ -43,7 +43,7 @@ Usage
\verbatim
{
- type alphatPhaseChangeJayatillekeWallFunction;
+ type alphatPhaseJayatillekeWallFunction;
Prt 0.85;
kappa 0.41;
E 9.8;
@@ -55,14 +55,14 @@ See also
Foam::compressible::alphatPhaseChangeWallFunctionFvPatchScalarField
SourceFiles
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
-#ifndef compressible_alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H
-#define compressible_alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H
+#ifndef compressible_alphatPhaseJayatillekeWallFunctionFvPatchScalarField_H
+#define compressible_alphatPhaseJayatillekeWallFunctionFvPatchScalarField_H
-#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H"
+#include "fixedValueFvPatchFields.H"
#include "nutWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -73,12 +73,12 @@ namespace compressible
{
/*---------------------------------------------------------------------------*\
- Class alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField Declaration
+ Class alphatPhaseJayatillekeWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
-class alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+class alphatPhaseJayatillekeWallFunctionFvPatchScalarField
:
- public alphatPhaseChangeWallFunctionFvPatchScalarField
+ public fixedValueFvPatchScalarField
{
protected:
@@ -108,30 +108,24 @@ protected:
const scalarField& Prat
) const;
- //- Update turbulent thermal diffusivity
- tmp calcAlphat
- (
- const scalarField& prevAlphat
- ) const;
-
public:
//- Runtime type information
- TypeName("compressible::alphatPhaseChangeJayatillekeWallFunction");
+ TypeName("compressible::alphatPhaseJayatillekeWallFunction");
// Constructors
//- Construct from patch and internal field
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField&
);
//- Construct from patch, internal field and dictionary
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField&,
@@ -139,20 +133,20 @@ public:
);
//- Construct by mapping given
- // alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ // alphatPhaseJayatillekeWallFunctionFvPatchScalarField
// onto a new patch
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField&,
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField&,
const fvPatchFieldMapper&
);
//- Copy constructor
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField&
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
@@ -160,7 +154,7 @@ public:
{
return tmp
(
- new alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ new alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
*this
)
@@ -168,9 +162,9 @@ public:
}
//- Copy constructor setting internal field reference
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
- const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField&,
+ const alphatPhaseJayatillekeWallFunctionFvPatchScalarField&,
const DimensionedField&
);
@@ -182,7 +176,7 @@ public:
{
return tmp
(
- new alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ new alphatPhaseJayatillekeWallFunctionFvPatchScalarField
(
*this,
iF
@@ -195,6 +189,9 @@ public:
// Evaluation functions
+ //- Evaluate the turbulent thermal diffusivity
+ tmp calcAlphat(const scalarField& prevAlphat) const;
+
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
index 4b5b0d8892..afef358c40 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
@@ -73,10 +73,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const DimensionedField& iF
)
:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
- otherPhaseName_("vapor"),
+ alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF),
phaseType_(liquidPhase),
- relax_(0.1),
AbyV_(p.size(), 0),
alphatConv_(p.size(), 0),
dDep_(p.size(), 1e-5),
@@ -103,10 +101,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const dictionary& dict
)
:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
- otherPhaseName_(dict.lookup("otherPhase")),
+ alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict),
phaseType_(phaseTypeNames_.read(dict.lookup("phaseType"))),
- relax_(dict.lookupOrDefault("relax", 0.1)),
AbyV_(p.size(), 0),
alphatConv_(p.size(), 0),
dDep_(p.size(), 1e-5),
@@ -116,18 +112,6 @@ alphatWallBoilingWallFunctionFvPatchScalarField
departureDiamModel_(nullptr),
departureFreqModel_(nullptr)
{
-
- // Check that otherPhaseName != this phase
- if (internalField().group() == otherPhaseName_)
- {
- FatalErrorInFunction
- << "otherPhase should be the name of the vapor phase that "
- << "corresponds to the liquid base of vice versa" << nl
- << "This phase: " << internalField().group() << nl
- << "otherPhase: " << otherPhaseName_
- << abort(FatalError);
- }
-
switch (phaseType_)
{
case vaporPhase:
@@ -138,7 +122,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
dict.subDict("partitioningModel")
);
- dmdt_ = 0;
+ dmdtf_ = 0;
break;
}
@@ -205,16 +189,14 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ alphatPhaseChangeWallFunctionFvPatchScalarField
(
psf,
p,
iF,
mapper
),
- otherPhaseName_(psf.otherPhaseName_),
phaseType_(psf.phaseType_),
- relax_(psf.relax_),
AbyV_(psf.AbyV_),
alphatConv_(mapper(psf.alphatConv_)),
dDep_(mapper(psf.dDep_)),
@@ -232,10 +214,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const alphatWallBoilingWallFunctionFvPatchScalarField& psf
)
:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
- otherPhaseName_(psf.otherPhaseName_),
+ alphatPhaseChangeWallFunctionFvPatchScalarField(psf),
phaseType_(psf.phaseType_),
- relax_(psf.relax_),
AbyV_(psf.AbyV_),
alphatConv_(psf.alphatConv_),
dDep_(psf.dDep_),
@@ -254,10 +234,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const DimensionedField& iF
)
:
- alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
- otherPhaseName_(psf.otherPhaseName_),
+ alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
phaseType_(psf.phaseType_),
- relax_(psf.relax_),
AbyV_(psf.AbyV_),
alphatConv_(psf.alphatConv_),
dDep_(psf.dDep_),
@@ -271,53 +249,6 @@ alphatWallBoilingWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-bool alphatWallBoilingWallFunctionFvPatchScalarField::
-activePhasePair(const phasePairKey& phasePair) const
-{
- if (phasePair == phasePairKey(otherPhaseName_, internalField().group()))
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-const scalarField& alphatWallBoilingWallFunctionFvPatchScalarField::
-dmdt(const phasePairKey& phasePair) const
-{
- if (activePhasePair(phasePair))
- {
- return dmdt_;
- }
- else
- {
- FatalErrorInFunction
- << " dmdt requested for invalid phasePair!"
- << abort(FatalError);
-
- return dmdt_;
- }
-}
-
-const scalarField& alphatWallBoilingWallFunctionFvPatchScalarField::
-mDotL(const phasePairKey& phasePair) const
-{
- if (activePhasePair(phasePair))
- {
- return mDotL_;
- }
- else
- {
- FatalErrorInFunction
- << " mDotL requested for invalid phasePair!"
- << abort(FatalError);
-
- return mDotL_;
- }
-}
-
void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
@@ -594,13 +525,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
// Volumetric mass source in the near wall cell due to the
// wall boiling
- dmdt_ =
- (1 - relax_)*dmdt_
+ dmdtf_ =
+ (1 - relax_)*dmdtf_
+ relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_;
// Volumetric source in the near wall cell due to the wall
// boiling
- mDotL_ = dmdt_*L;
+ dmdtLf_ = dmdtf_*L;
// Quenching heat transfer coefficient
const scalarField hQ
@@ -657,8 +588,8 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
Info<< " A2: " << gMin(A2) << " - " << gMax(A2) << endl;
Info<< " A2E: " << gMin(A2E) << " - "
<< gMax(A2E) << endl;
- Info<< " dmdtW: " << gMin(dmdt_) << " - "
- << gMax(dmdt_) << endl;
+ Info<< " dmdtW: " << gMin(dmdtf_) << " - "
+ << gMax(dmdtf_) << endl;
Info<< " qc: " << gMin(qc) << " - " << gMax(qc) << endl;
Info<< " qq: " << gMin(fLiquid*qq()) << " - "
<< gMax(fLiquid*qq()) << endl;
@@ -706,11 +637,12 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
- fvPatchField::write(os);
+ alphatPhaseChangeWallFunctionFvPatchScalarField::write(os);
writeEntry(os, "phaseType", phaseTypeNames_[phaseType_]);
-
- writeEntry(os, "relax", relax_);
+ writeEntry(os, "alphatConv", alphatConv_);
+ writeEntry(os, "dDep", dDep_);
+ writeEntry(os, "qQuenching", qq_);
switch (phaseType_)
{
@@ -747,13 +679,6 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
break;
}
}
-
- writeEntry(os, "otherPhase", otherPhaseName_);
- writeEntry(os, "dmdt", dmdt_);
- writeEntry(os, "dDep", dDep_);
- writeEntry(os, "qQuenching", qq_);
- writeEntry(os, "alphatConv", alphatConv_);
- writeEntry(os, "value", *this);
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H
index dfa4c1c68b..632e9d660c 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H
@@ -131,7 +131,7 @@ SourceFiles
#ifndef compressible_alphatWallBoilingWallFunctionFvPatchScalarField_H
#define compressible_alphatWallBoilingWallFunctionFvPatchScalarField_H
-#include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H"
+#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H"
#include "partitioningModel.H"
#include "nucleationSiteModel.H"
#include "departureDiameterModel.H"
@@ -150,7 +150,7 @@ namespace compressible
class alphatWallBoilingWallFunctionFvPatchScalarField
:
- public alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
+ public alphatPhaseChangeWallFunctionFvPatchScalarField
{
public:
@@ -163,23 +163,17 @@ public:
liquidPhase
};
+ //- Heat source type names
+ static const NamedEnum phaseTypeNames_;
+
private:
// Private Data
- //- name of the other phase (vapor/liquid phase)
- word otherPhaseName_;
-
- //- Heat source type names
- static const NamedEnum phaseTypeNames_;
-
//- Heat source type
phaseType phaseType_;
- //- dmdt relaxationFactor
- scalar relax_;
-
//- Patch face area by cell volume
scalarField AbyV_;
@@ -280,17 +274,6 @@ public:
// Member Functions
- using alphatPhaseChangeWallFunctionFvPatchScalarField::dmdt;
-
- //- Is there phase change mass transfer for this phasePair
- virtual bool activePhasePair(const phasePairKey&) const;
-
- //- Return the rate of phase-change for specific phase pair
- virtual const scalarField& dmdt(const phasePairKey&) const;
-
- //- Return the rate of phase-change for specific phase pair
- virtual const scalarField& mDotL(const phasePairKey&) const;
-
//- Return the departure diameter field
const scalarField& dDeparture() const
{
@@ -306,9 +289,10 @@ public:
//- Return the evaporation surface heat flux [W/m^2]
tmp qe() const
{
- return mDotL_/AbyV_;
+ return dmdtLf_/AbyV_;
}
+
// Evaluation functions
//- Update the coefficients associated with the patch field
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C
index 61a919ab6c..b8f40a82b8 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C
@@ -135,20 +135,20 @@ Foam::tmp Foam::interfaceCompositionModel::L
}
-void Foam::interfaceCompositionModel::addMDotL
+void Foam::interfaceCompositionModel::addDmdtL
(
const volScalarField& K,
const volScalarField& Tf,
- volScalarField& mDotL,
- volScalarField& mDotLPrime
+ volScalarField& dmdtL,
+ volScalarField& dmdtLPrime
) const
{
forAllConstIter(hashedWordList, species_, iter)
{
const volScalarField rhoKDL(thermo_.rho()*K*D(*iter)*L(*iter, Tf));
- mDotL += rhoKDL*dY(*iter, Tf);
- mDotLPrime += rhoKDL*YfPrime(*iter, Tf);
+ dmdtL += rhoKDL*dY(*iter, Tf);
+ dmdtLPrime += rhoKDL*YfPrime(*iter, Tf);
}
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H
index d5d29d27ff..bd0481fd61 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H
@@ -182,12 +182,12 @@ public:
) const;
//- Add latent heat flow rate to total
- virtual void addMDotL
+ virtual void addDmdtL
(
const volScalarField& K,
const volScalarField& Tf,
- volScalarField& mDotL,
- volScalarField& mDotLPrime
+ volScalarField& dmdtL,
+ volScalarField& dmdtLPrime
) const;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C
index ca11d114c5..2e5b4f0f4b 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -63,8 +63,14 @@ Foam::phaseTransferModels::deposition::~deposition()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+bool Foam::phaseTransferModels::deposition::mixture() const
+{
+ return true;
+}
+
+
Foam::tmp
-Foam::phaseTransferModels::deposition::dmdt() const
+Foam::phaseTransferModels::deposition::dmdtf() const
{
const phaseModel* dropletPtr = nullptr;
scalar sign = 1;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H
index 38897306d4..f12762943d 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H
@@ -92,8 +92,11 @@ public:
// Member Functions
- //- The mass transfer rate
- virtual tmp dmdt() const;
+ //- Whether or not there is a mass transfer rate for the mixture
+ virtual bool mixture() const;
+
+ //- The mass transfer rate for the mixture
+ virtual tmp dmdtf() const;
};
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C
index d7fb0b33e8..83e39266b7 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -39,6 +39,8 @@ namespace Foam
const Foam::dimensionSet Foam::phaseTransferModel::dimDmdt =
Foam::dimDensity/Foam::dimTime;
+const Foam::hashedWordList Foam::phaseTransferModel::noSpecies_ =
+ Foam::hashedWordList();
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@@ -48,6 +50,15 @@ Foam::phaseTransferModel::phaseTransferModel
const phasePair& pair
)
:
+ regIOobject
+ (
+ IOobject
+ (
+ IOobject::groupName(typeName, pair.name()),
+ pair.phase1().mesh().time().timeName(),
+ pair.phase1().mesh()
+ )
+ ),
pair_(pair)
{}
@@ -58,4 +69,37 @@ Foam::phaseTransferModel::~phaseTransferModel()
{}
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+bool Foam::phaseTransferModel::mixture() const
+{
+ return false;
+}
+
+
+Foam::tmp Foam::phaseTransferModel::dmdtf() const
+{
+ return tmp(nullptr);
+}
+
+
+const Foam::hashedWordList& Foam::phaseTransferModel::species() const
+{
+ return noSpecies_;
+}
+
+
+Foam::HashPtrTable
+Foam::phaseTransferModel::dmidtf() const
+{
+ return HashPtrTable();
+}
+
+
+bool Foam::phaseTransferModel::writeData(Ostream& os) const
+{
+ return os.good();
+}
+
+
// ************************************************************************* //
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H
index 9af52d3ece..ba14ab2fce 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H
@@ -38,6 +38,8 @@ SourceFiles
#include "volFields.H"
#include "dictionary.H"
+#include "HashPtrTable.H"
+#include "hashedWordList.H"
#include "runTimeSelectionTables.H"
namespace Foam
@@ -50,6 +52,8 @@ class phasePair;
\*---------------------------------------------------------------------------*/
class phaseTransferModel
+:
+ public regIOobject
{
protected:
@@ -85,6 +89,9 @@ public:
//- Mass transfer rate dimensions
static const dimensionSet dimDmdt;
+ //- Empty species list
+ static const hashedWordList noSpecies_;
+
// Constructors
@@ -111,29 +118,20 @@ public:
// Member Functions
- //- Return the active species for the current pair,
- // by default returns empty list
- virtual const wordList activeSpecies() const
- {
- return wordList();
- };
+ //- Whether or not there is a mass transfer rate for the mixture
+ virtual bool mixture() const;
- //- Do possible corrections before dmdt calculations
- virtual void correct() {};
+ //- The mass transfer rate for the mixture
+ virtual tmp dmdtf() const;
- //- The mass transfer rate
- virtual tmp dmdt() const = 0;
+ //- The list of individual species that are transferred
+ virtual const hashedWordList& species() const;
- //- The mass transfer rate for the given species, this needs to be
- // implemented only if the model uses non uniform species transfer
- virtual tmp speciesDmdt
- (
- const word speciesName
- ) const
- {
- NotImplemented;
- return dmdt();
- };
+ //- The mass transfer rate for individual species
+ virtual HashPtrTable dmidtf() const;
+
+ //- Dummy write for regIOobject
+ bool writeData(Ostream& os) const;
};
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C
index 31e1d7ea1d..3be9c4ff75 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C
@@ -74,44 +74,33 @@ Foam::phaseTransferModels::reactionDriven::~reactionDriven()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-Foam::tmp
-Foam::phaseTransferModels::reactionDriven::dmdt() const
+const Foam::hashedWordList&
+Foam::phaseTransferModels::reactionDriven::species() const
{
- volScalarField dmdt
- (
- volScalarField::New
- (
- "reactionDrivendmdt",
- pair_.phase1().mesh(),
- dimensionedScalar(Foam::phaseTransferModel::dimDmdt, 0)
- )
- );
-
- forAllConstIter
- (
- wordList,
- species_,
- sIter
- )
- {
- dmdt += speciesDmdt(*sIter);
- }
-
- return dmdt;
+ return species_;
}
-Foam::tmp
-Foam::phaseTransferModels::reactionDriven::speciesDmdt
-(
- const word speciesName
-) const
+Foam::HashPtrTable
+Foam::phaseTransferModels::reactionDriven::dmidtf() const
{
- // Reaction rate query requires non const Y
- volScalarField& Y =
- const_cast(reactingPhase_.Y(speciesName));
+ HashPtrTable result;
- return sign_*reactingPhase_*reactingPhase_.R(Y) & Y;
+ forAll(species_, i)
+ {
+ const word name = species_[i];
+
+ volScalarField& Y =
+ const_cast(reactingPhase_.Y(name));
+
+ result.set
+ (
+ species_[i],
+ (sign_*reactingPhase_*reactingPhase_.R(Y) & Y).ptr()
+ );
+ }
+
+ return result;
};
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H
index 7376ae2fbc..0e5634cfcd 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H
@@ -74,7 +74,7 @@ private:
const scalar sign_;
//- List of species changing phase
- wordList species_;
+ const hashedWordList species_;
public:
@@ -99,20 +99,11 @@ public:
// Member Functions
- //- Return the active species for the current pair
- virtual const wordList activeSpecies() const
- {
- return species_;
- };
+ //- The list of individual species that are transferred
+ virtual const hashedWordList& species() const;
- //- The mass transfer rate
- virtual tmp dmdt() const;
-
- //- The mass transfer rate for the given species
- virtual tmp speciesDmdt
- (
- const word speciesName
- ) const;
+ //- The mass transfer rate for individual species
+ virtual HashPtrTable dmidtf() const;
};
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C
index f4323f2d0d..abc7e3a525 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C
@@ -31,46 +31,97 @@ License
namespace Foam
{
+namespace blendedInterfacialModel
+{
-// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+template
+inline tmp interpolate(tmp f);
template<>
-inline tmp
-blendedInterfacialModel::interpolate(tmp f)
+inline tmp interpolate(tmp f)
{
return f;
}
-
template<>
-inline tmp
-blendedInterfacialModel::interpolate(tmp f)
+inline tmp interpolate(tmp f)
{
return fvc::interpolate(f);
}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
+} // End namespace blendedInterfacialModel
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
-template
-void Foam::BlendedInterfacialModel::correctFixedFluxBCs
+template class PatchField, class GeoMesh>
+void Foam::BlendedInterfacialModel::calculateBlendingCoeffs
(
- GeoField& field
+ tmp>& f1,
+ tmp>& f2,
+ const bool subtract
) const
{
- typename GeoField::Boundary& fieldBf = field.boundaryFieldRef();
+ typedef GeometricField scalarGeoField;
- forAll(phase1_.phi()().boundaryField(), patchi)
+ if (model_.valid() && subtract)
+ {
+ FatalErrorInFunction
+ << "Cannot treat an interfacial model with no distinction between "
+ << "continuous and dispersed phases as signed"
+ << exit(FatalError);
+ }
+
+ if (model_.valid() || model1In2_.valid())
+ {
+ f1 =
+ blendedInterfacialModel::interpolate
+ (
+ blending_.f1(phase1_, phase2_)
+ );
+ }
+
+ if (model_.valid() || model2In1_.valid())
+ {
+ f2 =
+ (subtract ? -1 : +1)
+ *blendedInterfacialModel::interpolate
+ (
+ blending_.f2(phase1_, phase2_)
+ );
+ }
+}
+
+
+template
+template class PatchField, class GeoMesh>
+void Foam::BlendedInterfacialModel::correctFixedFluxBCs
+(
+ GeometricField& field
+) const
+{
+ typedef GeometricField typeGeoField;
+
+ typename typeGeoField::Boundary& fieldBf = field.boundaryFieldRef();
+
+ forAll(fieldBf, patchi)
{
if
(
- isA
(
- phase1_.phi()().boundaryField()[patchi]
+ !phase1_.stationary()
+ && isA
+ (
+ phase1_.phi()().boundaryField()[patchi]
+ )
+ )
+ || (
+ !phase2_.stationary()
+ && isA
+ (
+ phase2_.phi()().boundaryField()[patchi]
+ )
)
)
{
@@ -103,73 +154,30 @@ Foam::BlendedInterfacialModel::evaluate
typedef GeometricField typeGeoField;
tmp f1, f2;
+ calculateBlendingCoeffs(f1, f2, subtract);
- if (model_.valid() || model1In2_.valid())
- {
- f1 =
- blendedInterfacialModel::interpolate
- (
- blending_.f1(phase1_, phase2_)
- );
- }
-
- if (model_.valid() || model2In1_.valid())
- {
- f2 =
- blendedInterfacialModel::interpolate
- (
- blending_.f2(phase1_, phase2_)
- );
- }
-
- tmp x
- (
- new typeGeoField
+ tmp x =
+ typeGeoField::New
(
- IOobject
- (
- ModelType::typeName + ":" + name,
- phase1_.mesh().time().timeName(),
- phase1_.mesh(),
- IOobject::NO_READ,
- IOobject::NO_WRITE,
- false
- ),
+ ModelType::typeName + ":"
+ + IOobject::groupName(name, phasePair(phase1_, phase2_).name()),
phase1_.mesh(),
- dimensioned("zero", dims, Zero)
- )
- );
+ dimensioned(dims, Zero)
+ );
if (model_.valid())
{
- if (subtract)
- {
- FatalErrorInFunction
- << "Cannot treat an interfacial model with no distinction "
- << "between continuous and dispersed phases as signed"
- << exit(FatalError);
- }
-
- x.ref() += (model_().*method)(args ...)*(scalar(1) - f1() - f2());
+ x.ref() += (scalar(1) - f1() - f2())*(model_().*method)(args ...);
}
if (model1In2_.valid())
{
- x.ref() += (model1In2_().*method)(args ...)*f1;
+ x.ref() += f1*(model1In2_().*method)(args ...);
}
if (model2In1_.valid())
{
- tmp dx = (model2In1_().*method)(args ...)*f2;
-
- if (subtract)
- {
- x.ref() -= dx;
- }
- else
- {
- x.ref() += dx;
- }
+ x.ref() += f2*(model2In1_().*method)(args ...);
}
if
@@ -185,6 +193,96 @@ Foam::BlendedInterfacialModel::evaluate
}
+template
+template
+<
+ class Type,
+ template class PatchField,
+ class GeoMesh,
+ class ... Args
+>
+Foam::HashPtrTable>
+Foam::BlendedInterfacialModel::evaluate
+(
+ HashPtrTable>
+ (ModelType::*method)(Args ...) const,
+ const word& name,
+ const dimensionSet& dims,
+ const bool subtract,
+ Args ... args
+) const
+{
+ typedef GeometricField scalarGeoField;
+ typedef GeometricField typeGeoField;
+
+ tmp f1, f2;
+ calculateBlendingCoeffs(f1, f2, subtract);
+
+ HashPtrTable xs;
+
+ auto addToXs = [&]
+ (
+ const scalarGeoField& f,
+ const HashPtrTable& dxs
+ )
+ {
+ forAllConstIter(typename HashPtrTable, dxs, dxIter)
+ {
+ if (xs.found(dxIter.key()))
+ {
+ *xs[dxIter.key()] += f**dxIter();
+ }
+ else
+ {
+ xs.insert
+ (
+ dxIter.key(),
+ typeGeoField::New
+ (
+ ModelType::typeName + ':'
+ + IOobject::groupName
+ (
+ IOobject::groupName(name, dxIter.key()),
+ phasePair(phase1_, phase2_).name()
+ ),
+ f**dxIter()
+ ).ptr()
+ );
+ }
+ }
+ };
+
+ if (model_.valid())
+ {
+ addToXs(scalar(1) - f1() - f2(), (model_().*method)(args ...));
+ }
+
+ if (model1In2_.valid())
+ {
+ addToXs(f1, (model1In2_().*method)(args ...));
+ }
+
+ if (model2In1_.valid())
+ {
+ addToXs(f2, (model1In2_().*method)(args ...));
+ }
+
+ if
+ (
+ correctFixedFluxBCs_
+ && (model_.valid() || model1In2_.valid() || model2In1_.valid())
+ )
+ {
+ forAllIter(typename HashPtrTable, xs, xIter)
+ {
+ correctFixedFluxBCs(*xIter());
+ }
+ }
+
+ return xs;
+}
+
+
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
@@ -290,46 +388,6 @@ Foam::BlendedInterfacialModel::~BlendedInterfacialModel()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
-template
-void Foam::BlendedInterfacialModel::correct()
-{
- if (model1In2_.valid())
- {
- model1In2_->correct();
- }
- if (model2In1_.valid())
- {
- model2In1_->correct();
- }
- if (model_.valid())
- {
- model_->correct();
- }
-}
-
-
-template
-const Foam::wordList Foam::BlendedInterfacialModel::
-activeSpecies() const
-{
- wordList activeSpeciesList;
- if (model1In2_.valid())
- {
- activeSpeciesList.append(model1In2_->activeSpecies());
- }
- if (model2In1_.valid())
- {
- activeSpeciesList.append(model2In1_->activeSpecies());
- }
- if (model_.valid())
- {
- activeSpeciesList.append(model_->activeSpecies());
- }
-
- return activeSpeciesList;
-}
-
-
template
Foam::tmp
Foam::BlendedInterfacialModel::K() const
@@ -384,29 +442,50 @@ Foam::BlendedInterfacialModel::D() const
template
-Foam::tmp
-Foam::BlendedInterfacialModel::dmdt() const
+bool Foam::BlendedInterfacialModel::mixture() const
{
- return evaluate(&ModelType::dmdt, "dmdt", ModelType::dimDmdt, false);
+ return
+ (model1In2_.valid() && model1In2_->mixture())
+ || (model2In1_.valid() && model2In1_->mixture())
+ || (model_.valid() && model_->mixture());
}
template
Foam::tmp
-Foam::BlendedInterfacialModel::speciesDmdt
-(
- const word speciesName
-) const
+Foam::BlendedInterfacialModel::dmdtf() const
{
- return
- evaluate
- (
- &ModelType::speciesDmdt,
- "speciesDmdt",
- ModelType::dimDmdt,
- false,
- speciesName
- );
+ return evaluate(&ModelType::dmdtf, "dmdtf", ModelType::dimDmdt, true);
+}
+
+
+template
+Foam::hashedWordList Foam::BlendedInterfacialModel::species() const
+{
+ wordList species;
+
+ if (model1In2_.valid())
+ {
+ species.append(model1In2_->species());
+ }
+ if (model2In1_.valid())
+ {
+ species.append(model2In1_->species());
+ }
+ if (model_.valid())
+ {
+ species.append(model_->species());
+ }
+
+ return hashedWordList(move(species));
+}
+
+
+template
+Foam::HashPtrTable
+Foam::BlendedInterfacialModel::dmidtf() const
+{
+ return evaluate(&ModelType::dmidtf, "dmidtf", ModelType::dimDmdt, true);
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H
index 432e1d3490..e216dc3282 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H
@@ -37,6 +37,8 @@ SourceFiles
#include "blendingMethod.H"
#include "phasePair.H"
#include "orderedPhasePair.H"
+#include "HashPtrTable.H"
+#include "hashedWordList.H"
#include "geometricZeroField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -44,21 +46,6 @@ SourceFiles
namespace Foam
{
-/*---------------------------------------------------------------------------*\
- Class blendedInterfacialModel Declaration
-\*---------------------------------------------------------------------------*/
-
-class blendedInterfacialModel
-{
- public:
-
- //- Convenience function to interpolate blending values. Needs to be
- // specialised, so can't sit in the templated class.
- template
- static inline tmp interpolate(tmp f);
-};
-
-
/*---------------------------------------------------------------------------*\
Class BlendedInterfacialModel Declaration
\*---------------------------------------------------------------------------*/
@@ -94,9 +81,21 @@ class BlendedInterfacialModel
// Private Member Functions
+ //- Calculate the blending coefficients
+ template class PatchField, class GeoMesh>
+ void calculateBlendingCoeffs
+ (
+ tmp>& f1,
+ tmp>& f2,
+ const bool subtract
+ ) const;
+
//- Correct coeff/value on fixed flux boundary conditions
- template
- void correctFixedFluxBCs(GeoField& field) const;
+ template class PatchField, class GeoMesh>
+ void correctFixedFluxBCs
+ (
+ GeometricField& field
+ ) const;
//- Return the blended coeff/value
template
@@ -116,6 +115,24 @@ class BlendedInterfacialModel
Args ... args
) const;
+ //- Return the blended coeff/value
+ template
+ <
+ class Type,
+ template class PatchField,
+ class GeoMesh,
+ class ... Args
+ >
+ HashPtrTable> evaluate
+ (
+ HashPtrTable>
+ (ModelType::*method)(Args ...) const,
+ const word& name,
+ const dimensionSet& dims,
+ const bool subtract,
+ Args ... args
+ ) const;
+
public:
@@ -162,12 +179,6 @@ public:
// Member Functions
- //- Correct the underlying models
- void correct();
-
- //- Return the list of active species
- const wordList activeSpecies() const;
-
//- Return the blended force coefficient
tmp K() const;
@@ -187,11 +198,17 @@ public:
//- Return the blended diffusivity
tmp D() const;
- //- Return the blended mass transfer rate
- tmp dmdt() const;
+ //- Return the list of individual species that are transferred
+ bool mixture() const;
- //- Return the blended species transfer rate
- tmp speciesDmdt(const word speciesName) const;
+ //- Return the blended mass transfer rate
+ tmp dmdtf() const;
+
+ //- Return the list of individual species that are transferred
+ hashedWordList species() const;
+
+ //- Return the blended mass transfer rates for individual species
+ HashPtrTable dmidtf() const;
//- Dummy write for regIOobject
bool writeData(Ostream& os) const;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
index 495ceb485f..9981199674 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
@@ -32,13 +32,12 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template
-Foam::autoPtr
+Foam::autoPtr
Foam::InterfaceCompositionPhaseChangePhaseSystem::
-iDmdts() const
+dmdtfs() const
{
- autoPtr iDmdtsPtr(new phaseSystem::dmdtTable);
-
- phaseSystem::dmdtTable& iDmdts = iDmdtsPtr();
+ autoPtr dmdtPtr(new phaseSystem::dmdtfTable);
+ phaseSystem::dmdtfTable& dmdtfs = dmdtPtr();
forAllConstIter
(
@@ -66,43 +65,43 @@ iDmdts() const
(
hashedWordList,
compositionModel.species(),
- memberIter
+ specieIter
)
{
- const word& member = *memberIter;
+ const word& specie = *specieIter;
- const label dmidtSign = pairIter.index() == 0 ? +1 : -1;
-
- tmp dmidt
+ tmp dmidtf
(
- *(*iDmdtSu_[pair])[member]
- + *(*iDmdtSp_[pair])[member]*phase.Y(member)
+ (pairIter.index() == 0 ? +1 : -1)
+ *(
+ *(*dmidtfSus_[pair])[specie]
+ + *(*dmidtfSps_[pair])[specie]*phase.Y(specie)
+ )
);
- if (iDmdts.found(pair))
+ if (dmdtfs.found(pair))
{
- *iDmdts[pair] += dmidtSign*dmidt;
+ *dmdtfs[pair] += dmidtf;
}
else
{
- iDmdts.insert(pair, (dmidtSign*dmidt).ptr());
+ dmdtfs.insert(pair, dmidtf.ptr());
}
}
}
}
- return iDmdtsPtr;
+ return dmdtPtr;
}
template
-Foam::autoPtr
+Foam::autoPtr
Foam::InterfaceCompositionPhaseChangePhaseSystem::
-iDmidts() const
+dmidtfs() const
{
- autoPtr iDmidtsPtr(new phaseSystem::dmidtTable);
-
- phaseSystem::dmidtTable& iDmidts = iDmidtsPtr();
+ autoPtr dmidtfsPtr(new phaseSystem::dmidtfTable);
+ phaseSystem::dmidtfTable& dmidtfs = dmidtfsPtr();
forAllConstIter
(
@@ -114,9 +113,9 @@ iDmidts() const
const phasePair& pair =
this->phasePairs_[interfaceCompositionModelIter.key()];
- if (!iDmidts.found(pair))
+ if (!dmidtfs.found(pair))
{
- iDmidts.insert(pair, new HashPtrTable());
+ dmidtfs.insert(pair, new HashPtrTable());
}
forAllConstIter(phasePair, pair, pairIter)
@@ -135,32 +134,34 @@ iDmidts() const
(
hashedWordList,
compositionModel.species(),
- memberIter
+ specieIter
)
{
- const word& member = *memberIter;
+ const word& specie = *specieIter;
- const label dmidtSign = pairIter.index() == 0 ? +1 : -1;
- tmp dmidt
+ tmp dmidtf
(
- *(*iDmdtSu_[pair])[member]
- + *(*iDmdtSp_[pair])[member]*phase.Y(member)
+ (pairIter.index() == 0 ? +1 : -1)
+ *(
+ *(*dmidtfSus_[pair])[specie]
+ + *(*dmidtfSps_[pair])[specie]*phase.Y(specie)
+ )
);
- if (iDmidts[pair]->found(member))
+ if (dmidtfs[pair]->found(specie))
{
- *(*iDmidts[pair])[member] += dmidtSign*dmidt;
+ *(*dmidtfs[pair])[specie] += dmidtf;
}
else
{
- iDmidts[pair]->insert(member, (dmidtSign*dmidt).ptr());
+ dmidtfs[pair]->insert(specie, dmidtf.ptr());
}
}
}
}
- return iDmidtsPtr;
+ return dmidtfsPtr;
}
@@ -255,8 +256,8 @@ InterfaceCompositionPhaseChangePhaseSystem
const phasePair& pair =
this->phasePairs_[interfaceCompositionModelIter.key()];
- iDmdtSu_.insert(pair, new HashPtrTable());
- iDmdtSp_.insert(pair, new HashPtrTable());
+ dmidtfSus_.insert(pair, new HashPtrTable());
+ dmidtfSps_.insert(pair, new HashPtrTable());
forAllConstIter(phasePair, pair, pairIter)
{
@@ -272,23 +273,57 @@ InterfaceCompositionPhaseChangePhaseSystem
(
hashedWordList,
compositionModel.species(),
- memberIter
+ specieIter
)
{
- const word& member = *memberIter;
+ const word& specie = *specieIter;
- iDmdtSu_[pair]->insert
+ dmidtfSus_[pair]->insert
(
- member,
- zeroVolField(pair, "iDmdtSu", dimDensity/dimTime)
- .ptr()
+ specie,
+ new volScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName
+ (
+ IOobject::groupName
+ (
+ "interfaceCompositionPhaseChange:dmidtfSu",
+ specie
+ ),
+ pair.name()
+ ),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(dimDensity/dimTime, 0)
+ )
);
- iDmdtSp_[pair]->insert
+ dmidtfSps_[pair]->insert
(
- member,
- zeroVolField(pair, "iDmdtSp", dimDensity/dimTime)
- .ptr()
+ specie,
+ new volScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName
+ (
+ IOobject::groupName
+ (
+ "interfaceCompositionPhaseChange:dmidtfSp",
+ specie
+ ),
+ pair.name()
+ ),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(dimDensity/dimTime, 0)
+ )
);
}
}
@@ -306,24 +341,71 @@ Foam::InterfaceCompositionPhaseChangePhaseSystem::
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+template
+Foam::tmp
+Foam::InterfaceCompositionPhaseChangePhaseSystem::dmdtf
+(
+ const phasePairKey& key
+) const
+{
+ tmp tDmdtf = BasePhaseSystem::dmdtf(key);
+
+ if (interfaceCompositionModels_.found(key))
+ {
+ const phasePair& pair = this->phasePairs_[key];
+
+ forAllConstIter(phasePair, pair, pairIter)
+ {
+ const autoPtr& compositionModelPtr =
+ interfaceCompositionModels_[key][pairIter.index()];
+
+ if (!compositionModelPtr.valid()) continue;
+
+ const interfaceCompositionModel& compositionModel =
+ compositionModelPtr();
+
+ const phaseModel& phase = *pairIter;
+
+ forAllConstIter
+ (
+ hashedWordList,
+ compositionModel.species(),
+ specieIter
+ )
+ {
+ const word& specie = *specieIter;
+
+ tDmdtf.ref() +=
+ Pair::compare(pair, key)
+ *(
+ *(*dmidtfSus_[pair])[specie]
+ - *(*dmidtfSps_[pair])[specie]*phase.Y(specie)
+ );
+ }
+ }
+ }
+
+ return tDmdtf;
+}
+
+
template
Foam::PtrList
Foam::InterfaceCompositionPhaseChangePhaseSystem::dmdts() const
{
PtrList dmdts(BasePhaseSystem::dmdts());
- autoPtr iDmdtsPtr = this->iDmdts();
+ autoPtr dmdtfsPtr = this->dmdtfs();
+ const phaseSystem::dmdtfTable& dmdtfs = dmdtfsPtr();
- const phaseSystem::dmdtTable& iDmdts = iDmdtsPtr();
-
- forAllConstIter(phaseSystem::dmdtTable, iDmdts, iDmdtIter)
+ forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfsIter)
{
- const phasePair& pair = this->phasePairs_[iDmdtIter.key()];
+ const phasePair& pair = this->phasePairs_[dmdtfsIter.key()];
const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2();
- addField(phase, "dmdt", *iDmdtIter(), dmdts);
- addField(otherPhase, "dmdt", - *iDmdtIter(), dmdts);
+ addField(phase, "dmdt", *dmdtfsIter(), dmdts);
+ addField(otherPhase, "dmdt", - *dmdtfsIter(), dmdts);
}
return dmdts;
@@ -340,7 +422,7 @@ momentumTransfer()
phaseSystem::momentumTransferTable& eqns = eqnsPtr();
- this->addDmdtU(iDmdts(), eqns);
+ this->addDmdtUfs(dmdtfs(), eqns);
return eqnsPtr;
}
@@ -356,7 +438,7 @@ momentumTransferf()
phaseSystem::momentumTransferTable& eqns = eqnsPtr();
- this->addDmdtU(iDmdts(), eqns);
+ this->addDmdtUfs(dmdtfs(), eqns);
return eqnsPtr;
}
@@ -372,7 +454,7 @@ heatTransfer() const
phaseSystem::heatTransferTable& eqns = eqnsPtr();
- this->addDmidtHe(iDmidts(), eqns);
+ this->addDmidtHef(dmidtfs(), eqns);
return eqnsPtr;
}
@@ -390,7 +472,7 @@ specieTransfer() const
// Explicit
/*
- this->addDmidtY(iDmidts(), eqns);
+ this->addDmidtYf(dmidtfs(), eqns);
*/
// Semi-implicit
@@ -421,22 +503,22 @@ specieTransfer() const
(
hashedWordList,
compositionModel.species(),
- memberIter
+ specieIter
)
{
- const word& member = *memberIter;
+ const word& specie = *specieIter;
// Implicit transport through this phase
- *eqns[phase.Y(member).name()] +=
- *(*iDmdtSu_[pair])[member]
- + fvm::Sp(*(*iDmdtSp_[pair])[member], phase.Y(member));
+ *eqns[phase.Y(specie).name()] +=
+ *(*dmidtfSus_[pair])[specie]
+ + fvm::Sp(*(*dmidtfSps_[pair])[specie], phase.Y(specie));
// Explicit transport out of the other phase
- if (eqns.found(IOobject::groupName(member, otherPhase.name())))
+ if (eqns.found(IOobject::groupName(specie, otherPhase.name())))
{
- *eqns[otherPhase.Y(member).name()] -=
- *(*iDmdtSu_[pair])[member]
- + *(*iDmdtSp_[pair])[member]*phase.Y(member);
+ *eqns[otherPhase.Y(specie).name()] -=
+ *(*dmidtfSus_[pair])[specie]
+ + *(*dmidtfSps_[pair])[specie]*phase.Y(specie);
}
}
}
@@ -486,16 +568,16 @@ correct()
(
hashedWordList,
compositionModel.species(),
- memberIter
+ specieIter
)
{
- const word& member = *memberIter;
+ const word& specie = *specieIter;
- const volScalarField KD(K*compositionModel.D(member));
- const volScalarField Yf(compositionModel.Yf(member, Tf));
+ const volScalarField KD(K*compositionModel.D(specie));
+ const volScalarField Yf(compositionModel.Yf(specie, Tf));
- *(*iDmdtSu_[pair])[member] = phase.rho()*KD*Yf;
- *(*iDmdtSp_[pair])[member] = - phase.rho()*KD;
+ *(*dmidtfSus_[pair])[specie] = phase.rho()*KD*Yf;
+ *(*dmidtfSps_[pair])[specie] = - phase.rho()*KD;
}
}
}
@@ -546,40 +628,40 @@ correctInterfaceThermo()
for (label i = 0; i < nInterfaceCorrectors_; ++ i)
{
- tmp mDotL =
- zeroVolField
+ tmp dmdtLf =
+ volScalarField::New
(
- pair,
- "mDotL",
- dimEnergy/dimVolume/dimTime
+ IOobject::groupName("dmdtLf", pair.name()),
+ this->mesh(),
+ dimensionedScalar(dimEnergy/dimVolume/dimTime, 0)
);
- tmp mDotLPrime =
- zeroVolField
+ tmp dmdtLfPrime =
+ volScalarField::New
(
- pair,
- "mDotLPrime",
- mDotL().dimensions()/dimTemperature
+ IOobject::groupName("dmdtLfPrime", pair.name()),
+ this->mesh(),
+ dimensionedScalar(dmdtLf().dimensions()/dimTemperature, 0)
);
// Add latent heats from forward and backward models
if (this->interfaceCompositionModels_[pair].first().valid())
{
- this->interfaceCompositionModels_[pair].first()->addMDotL
+ this->interfaceCompositionModels_[pair].first()->addDmdtL
(
diffusiveMassTransferModels_[pair].first()->K(),
Tf,
- mDotL.ref(),
- mDotLPrime.ref()
+ dmdtLf.ref(),
+ dmdtLfPrime.ref()
);
}
if (this->interfaceCompositionModels_[pair].second().valid())
{
- this->interfaceCompositionModels_[pair].second()->addMDotL
+ this->interfaceCompositionModels_[pair].second()->addDmdtL
(
- diffusiveMassTransferModels_[pair].second()->K(),
Tf,
- mDotL.ref(),
- mDotLPrime.ref()
+ dmdtLf.ref(),
+ dmdtLfPrime.ref()
);
}
@@ -589,10 +671,10 @@ correctInterfaceThermo()
(
H1*(Tf - pair.phase1().thermo().T())
+ H2*(Tf - pair.phase2().thermo().T())
- - mDotL
+ - dmdtLf
)
/(
- max(H1 + H2 - mDotLPrime, HSmall)
+ max(H1 + H2 - dmdtLfPrime, HSmall)
);
Tf.correctBoundaryConditions();
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H
index 6f9c4572b4..ac2948be07 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H
@@ -59,8 +59,6 @@ class InterfaceCompositionPhaseChangePhaseSystem
:
public BasePhaseSystem
{
-private:
-
// Private typedefs
typedef HashTable
@@ -92,19 +90,19 @@ private:
interfaceCompositionModelTable interfaceCompositionModels_;
//- The explicit part of the interfacial mass transfer rates
- phaseSystem::dmidtTable iDmdtSu_;
+ phaseSystem::dmidtfTable dmidtfSus_;
//- The implicit part of the interfacial mass transfer rates
- phaseSystem::dmidtTable iDmdtSp_;
+ phaseSystem::dmidtfTable dmidtfSps_;
// Private member functions
- //- Return the bulk mass transfers across each interface
- autoPtr iDmdts() const;
+ //- Return mass transfers across each interface
+ autoPtr dmdtfs() const;
- //- Return the species mass transfers across each interface
- autoPtr iDmidts() const;
+ //- Return species mass transfers across each interface
+ autoPtr dmidtfs() const;
public:
@@ -121,6 +119,9 @@ public:
// Member Functions
+ //- Return the mass transfer rate for an interface
+ virtual tmp dmdtf(const phasePairKey& key) const;
+
//- Return the mass transfer rates for each phase
virtual PtrList dmdts() const;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
index 2384017eff..cd9ee83a50 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
@@ -119,18 +119,18 @@ Foam::MomentumTransferPhaseSystem::Vm
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
-void Foam::MomentumTransferPhaseSystem::addDmdtU
+void Foam::MomentumTransferPhaseSystem::addDmdtUfs
(
- const phaseSystem::dmdtTable& dmdts,
+ const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::momentumTransferTable& eqns
)
{
- forAllConstIter(phaseSystem::dmdtTable, dmdts, dmdtIter)
+ forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
- const phasePairKey& key = dmdtIter.key();
+ const phasePairKey& key = dmdtfIter.key();
const phasePair& pair(this->phasePairs_[key]);
- const volScalarField dmdt(Pair::compare(pair, key)**dmdtIter());
+ const volScalarField dmdtf(Pair::compare(pair, key)**dmdtfIter());
phaseModel& phase1 = this->phases()[pair.phase1().name()];
phaseModel& phase2 = this->phases()[pair.phase2().name()];
@@ -150,18 +150,18 @@ void Foam::MomentumTransferPhaseSystem::addDmdtU
if (!phase1.stationary())
{
- const volScalarField dmdt21(posPart(dmdt));
+ const volScalarField dmdtf21(posPart(dmdtf));
*eqns[phase1.name()] +=
- dmdt21*phase2.U() - fvm::Sp(dmdt21, phase1.URef());
+ dmdtf21*phase2.U() - fvm::Sp(dmdtf21, phase1.URef());
}
if (!phase2.stationary())
{
- const volScalarField dmdt12(negPart(dmdt));
+ const volScalarField dmdtf12(negPart(dmdtf));
*eqns[phase2.name()] -=
- dmdt12*phase1.U() - fvm::Sp(dmdt12, phase2.URef());
+ dmdtf12*phase1.U() - fvm::Sp(dmdtf12, phase2.URef());
}
}
}
@@ -220,13 +220,33 @@ MomentumTransferPhaseSystem
Kds_.insert
(
pair,
- zeroVolField(pair, "Kd", dragModel::dimK).ptr()
+ new volScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName("Kd", pair.name()),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(dragModel::dimK, 0)
+ )
);
Kdfs_.insert
(
pair,
- zeroSurfaceField(pair, "Kdf", dragModel::dimK).ptr()
+ new surfaceScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName("Kdf", pair.name()),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(dragModel::dimK, 0)
+ )
);
}
@@ -242,13 +262,33 @@ MomentumTransferPhaseSystem
Vms_.insert
(
pair,
- zeroVolField(pair, "Vm", virtualMassModel::dimK).ptr()
+ new volScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName("Vm", pair.name()),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(virtualMassModel::dimK, 0)
+ )
);
Vmfs_.insert
(
pair,
- zeroSurfaceField(pair, "Vmf", virtualMassModel::dimK).ptr()
+ new surfaceScalarField
+ (
+ IOobject
+ (
+ IOobject::groupName("Vmf", pair.name()),
+ this->mesh().time().timeName(),
+ this->mesh()
+ ),
+ this->mesh(),
+ dimensionedScalar(virtualMassModel::dimK, 0)
+ )
);
}
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H
index 18912b4425..1514f7bf47 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H
@@ -192,9 +192,9 @@ protected:
// Protected Member Functions
//- Add momentum transfer terms which result from bulk mass transfers
- void addDmdtU
+ void addDmdtUfs
(
- const phaseSystem::dmdtTable& dmdts,
+ const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::momentumTransferTable& eqns
);
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C
index 8986ad5e98..7828a3b963 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C
@@ -32,20 +32,19 @@ License
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
-void Foam::OneResistanceHeatTransferPhaseSystem::addDmdtHe
+void Foam::OneResistanceHeatTransferPhaseSystem::addDmdtHefs
(
- const phaseSystem::dmdtTable& dmdts,
+ const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::heatTransferTable& eqns
) const
{
- forAllConstIter(phaseSystem::dmdtTable, dmdts, dmdtIter)
+ forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
- const phasePairKey& key = dmdtIter.key();
+ const phasePairKey& key = dmdtfIter.key();
const phasePair& pair(this->phasePairs_[key]);
-
- const volScalarField dmdt(Pair::compare(pair, key)**dmdtIter());
- const volScalarField dmdt21(posPart(dmdt));
- const volScalarField dmdt12(negPart(dmdt));
+ const volScalarField dmdtf(Pair::compare(pair, key)**dmdtfIter());
+ const volScalarField dmdtf21(posPart(dmdtf));
+ const volScalarField dmdtf12(negPart(dmdtf));
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
@@ -57,30 +56,30 @@ void Foam::OneResistanceHeatTransferPhaseSystem::addDmdtHe
const volScalarField K2(phase2.K());
// Note that the phase EEqn contains a continuity error term. See
- // MomentumTransferPhaseSystem::addDmdtU for an explanation of the
+ // MomentumTransferPhaseSystem::addDmdtUfs for an explanation of the
// fvm::Sp terms below.
// Transfer of energy from bulk to bulk
- *eqns[phase1.name()] += dmdt21*he2 - fvm::Sp(dmdt21, he1);
- *eqns[phase2.name()] -= dmdt12*he1 - fvm::Sp(dmdt12, he2);
+ *eqns[phase1.name()] += dmdtf21*he2 - fvm::Sp(dmdtf21, he1);
+ *eqns[phase2.name()] -= dmdtf12*he1 - fvm::Sp(dmdtf12, he2);
// Transfer of kinetic energy
- *eqns[phase1.name()] += dmdt21*(K2 - K1);
- *eqns[phase2.name()] -= dmdt12*(K1 - K2);
+ *eqns[phase1.name()] += dmdtf21*(K2 - K1);
+ *eqns[phase2.name()] -= dmdtf12*(K1 - K2);
}
}
template
-void Foam::OneResistanceHeatTransferPhaseSystem::addDmidtHe
+void Foam::OneResistanceHeatTransferPhaseSystem::addDmidtHef
(
- const phaseSystem::dmidtTable& dmidts,
+ const phaseSystem::dmidtfTable& dmidtfs,
phaseSystem::heatTransferTable& eqns
) const
{
- forAllConstIter(phaseSystem::dmidtTable, dmidts, dmidtIter)
+ forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter)
{
- const phasePairKey& key = dmidtIter.key();
+ const phasePairKey& key = dmidtfIter.key();
const phasePair& pair(this->phasePairs_[key]);
const phaseModel& phase1 = pair.phase1();
@@ -93,19 +92,19 @@ void Foam::OneResistanceHeatTransferPhaseSystem::addDmidtHe
const volScalarField K2(phase2.K());
// Note that the phase EEqn contains a continuity error term. See
- // MomentumTransferPhaseSystem::addDmdtU for an explanation of the
+ // MomentumTransferPhaseSystem::addDmdtUfs for an explanation of the
// fvm::Sp terms below.
- forAllConstIter(HashPtrTable, *dmidtIter(), dmidtJter)
+ forAllConstIter(HashPtrTable, *dmidtfIter(), dmidtfJter)
{
- const word& member = dmidtJter.key();
+ const word& member = dmidtfJter.key();
- const volScalarField dmidt
+ const volScalarField dmidtf
(
- Pair::compare(pair, key)**dmidtJter()
+ Pair::compare(pair, key)**dmidtfJter()
);
- const volScalarField dmidt21(posPart(dmidt));
- const volScalarField dmidt12(negPart(dmidt));
+ const volScalarField dmidtf21(posPart(dmidtf));
+ const volScalarField dmidtf12(negPart(dmidtf));
// Create the energies for the transferring specie
volScalarField hei1(he1);
@@ -136,12 +135,12 @@ void Foam::OneResistanceHeatTransferPhaseSystem::addDmidtHe
}
// Transfer of energy from bulk to bulk
- *eqns[phase1.name()] += dmidt21*hei2 - fvm::Sp(dmidt21, he1);
- *eqns[phase2.name()] -= dmidt12*hei1 - fvm::Sp(dmidt12, he2);
+ *eqns[phase1.name()] += dmidtf21*hei2 - fvm::Sp(dmidtf21, he1);
+ *eqns[phase2.name()] -= dmidtf12*hei1 - fvm::Sp(dmidtf12, he2);
// Transfer of kinetic energy
- *eqns[phase1.name()] += dmidt21*(K2 - K1);
- *eqns[phase2.name()] -= dmidt12*(K1 - K2);
+ *eqns[phase1.name()] += dmidtf21*(K2 - K1);
+ *eqns[phase2.name()] -= dmidtf12*(K1 - K2);
}
}
}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H
index 3dba5f064a..451d142ba0 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H
@@ -82,16 +82,16 @@ protected:
// Protected Member Functions
//- Add energy transfer terms which result from bulk mass transfers
- void addDmdtHe
+ void addDmdtHefs
(
- const phaseSystem::dmdtTable& dmdts,
+ const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from specie mass transfers
- void addDmidtHe
+ void addDmidtHef
(
- const phaseSystem::dmidtTable& dmidts,
+ const phaseSystem::dmidtfTable& dmidtfs,
phaseSystem::heatTransferTable& eqns
) const;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C
index 9be7d5ea04..922f278a83 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C
@@ -30,66 +30,14 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template
-void Foam::PhaseTransferPhaseSystem::addToSpeciesDmdt
-(
- const phasePair& pair,
- const wordList species
-)
+Foam::autoPtr
+Foam::PhaseTransferPhaseSystem::totalDmdtfs() const
{
- if (species.empty())
- {
- return;
- }
-
- if (!specieDmdt_.found(pair))
- {
- specieDmdt_.insert(pair, new HashPtrTable());
- }
-
- forAllConstIter
+ autoPtr totalDmdtfsPtr
(
- wordList,
- species,
- sIter
- )
- {
- const word specieName(*sIter);
- if (!specieDmdt_[pair]->found(specieName))
- {
- specieDmdt_[pair]->insert
- (
- specieName,
- new volScalarField
- (
- IOobject
- (
- IOobject::groupName
- (
- specieName+":dmdt",
- pair.name()
- ),
- this->mesh().time().timeName(),
- this->mesh(),
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- this->mesh(),
- dimensionedScalar(Foam::phaseTransferModel::dimDmdt, 0)
- )
- );
- }
- }
-}
-
-
-template
-Foam::autoPtr
-Foam::PhaseTransferPhaseSystem::
-sumDmdts() const
-{
- autoPtr sumDmdtsPtr(new phaseSystem::dmdtTable);
-
- phaseSystem::dmdtTable& sumDmdts = sumDmdtsPtr();
+ new phaseSystem::dmdtfTable
+ );
+ phaseSystem::dmdtfTable& totalDmdtfs = totalDmdtfsPtr();
forAllConstIter
(
@@ -101,52 +49,45 @@ sumDmdts() const
const phasePair& pair =
this->phasePairs_[phaseTransferModelIter.key()];
- sumDmdts.insert
- (
- pair,
- zeroVolField