mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Merged all multiphase developments in OpenFOAM-1.7.x
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
phase/phase.C
|
||||
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
||||
multiphaseMixture.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmultiphaseInterFoam
|
||||
@ -0,0 +1,11 @@
|
||||
EXE_INC = \
|
||||
-IalphaContactAngle \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
@ -23,7 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "multiphaseAlphaContactAngleFvPatchScalarField.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
@ -32,8 +32,7 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps::
|
||||
interfaceThetaProps
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
|
||||
(
|
||||
Istream& is
|
||||
)
|
||||
@ -48,10 +47,10 @@ interfaceThetaProps
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
return is;
|
||||
}
|
||||
|
||||
@ -59,7 +58,7 @@ Istream& operator>>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
os << tp.theta0_ << token::SPACE
|
||||
@ -73,8 +72,7 @@ Ostream& operator<<
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
@ -84,10 +82,9 @@ multiphaseAlphaContactAngleFvPatchScalarField
|
||||
{}
|
||||
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
@ -98,8 +95,7 @@ multiphaseAlphaContactAngleFvPatchScalarField
|
||||
{}
|
||||
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
@ -113,10 +109,9 @@ multiphaseAlphaContactAngleFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
@ -127,7 +122,7 @@ multiphaseAlphaContactAngleFvPatchScalarField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void multiphaseAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchScalarField::write(os);
|
||||
os.writeKeyword("thetaProperties")
|
||||
@ -138,11 +133,7 @@ void multiphaseAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
);
|
||||
makePatchTypeField(fvPatchScalarField, alphaContactAngleFvPatchScalarField);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -22,19 +22,19 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::multiphaseAlphaContactAngleFvPatchScalarField
|
||||
Foam::alphaContactAngleFvPatchScalarField
|
||||
|
||||
Description
|
||||
Contact-angle boundary condition for multi-phase interface-capturing
|
||||
simulations. Used in conjuction with multiphaseMixture.
|
||||
|
||||
SourceFiles
|
||||
multiphaseAlphaContactAngleFvPatchScalarField.C
|
||||
alphaContactAngleFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef multiphaseAlphaContactAngleFvPatchScalarField_H
|
||||
#define multiphaseAlphaContactAngleFvPatchScalarField_H
|
||||
#ifndef alphaContactAngleFvPatchScalarField_H
|
||||
#define alphaContactAngleFvPatchScalarField_H
|
||||
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "multiphaseMixture.H"
|
||||
@ -45,10 +45,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseAlphaContactAngleFvPatch Declaration
|
||||
Class alphaContactAngleFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiphaseAlphaContactAngleFvPatchScalarField
|
||||
class alphaContactAngleFvPatchScalarField
|
||||
:
|
||||
public zeroGradientFvPatchScalarField
|
||||
{
|
||||
@ -132,32 +132,31 @@ private:
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("multiphaseAlphaContactAngle");
|
||||
TypeName("alphaContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// multiphaseAlphaContactAngleFvPatchScalarField onto a new
|
||||
// patch
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
//- Construct by mapping given alphaContactAngleFvPatchScalarField
|
||||
// onto a new patch
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField&,
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
@ -168,14 +167,14 @@ public:
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new multiphaseAlphaContactAngleFvPatchScalarField(*this)
|
||||
new alphaContactAngleFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
multiphaseAlphaContactAngleFvPatchScalarField
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField&,
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
@ -187,7 +186,7 @@ public:
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new multiphaseAlphaContactAngleFvPatchScalarField(*this, iF)
|
||||
new alphaContactAngleFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
@ -24,11 +24,10 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "multiphaseMixture.H"
|
||||
#include "multiphaseAlphaContactAngleFvPatchScalarField.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "Time.H"
|
||||
#include "subCycle.H"
|
||||
#include "fvCFD.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
|
||||
|
||||
@ -237,7 +236,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::correct()
|
||||
void Foam::multiphaseMixture::solve()
|
||||
{
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
@ -296,6 +295,10 @@ void Foam::multiphaseMixture::correct()
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::correct()
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
@ -351,11 +354,10 @@ void Foam::multiphaseMixture::correctContactAngle
|
||||
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
if (isA<multiphaseAlphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
{
|
||||
const multiphaseAlphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const multiphaseAlphaContactAngleFvPatchScalarField>
|
||||
(gbf[patchi]);
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||
|
||||
vectorField& nHatPatch = nHatb[patchi];
|
||||
|
||||
@ -363,7 +365,7 @@ void Foam::multiphaseMixture::correctContactAngle
|
||||
mesh_.Sf().boundaryField()[patchi]
|
||||
/mesh_.magSf().boundaryField()[patchi];
|
||||
|
||||
multiphaseAlphaContactAngleFvPatchScalarField::thetaPropsTable::
|
||||
alphaContactAngleFvPatchScalarField::thetaPropsTable::
|
||||
const_iterator tp =
|
||||
acap.thetaProps().find(interfacePair(alpha1, alpha2));
|
||||
|
||||
@ -455,6 +457,34 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::multiphaseMixture::nearInterface() const
|
||||
{
|
||||
tmp<surfaceScalarField> tnearInt
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nearInterface",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("nearInterface", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
forAllConstIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
surfaceScalarField alphaf = fvc::interpolate(iter());
|
||||
tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
|
||||
}
|
||||
|
||||
return tnearInt;
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::solveAlphas
|
||||
(
|
||||
const label nAlphaCorr,
|
||||
@ -466,7 +496,7 @@ void Foam::multiphaseMixture::solveAlphas
|
||||
nSolves++;
|
||||
|
||||
word alphaScheme("div(phi,alpha)");
|
||||
word alphacScheme("div(phic,alpha)");
|
||||
word alphacScheme("div(phirb,alpha)");
|
||||
|
||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
(
|
||||
|
||||
@ -164,7 +164,7 @@ private:
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable alphaTable_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
// Private member functions
|
||||
|
||||
void calcAlphas();
|
||||
|
||||
@ -256,6 +256,13 @@ public:
|
||||
|
||||
tmp<surfaceScalarField> surfaceTensionForce() const;
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<surfaceScalarField> nearInterface() const;
|
||||
|
||||
//- Solve for the mixture phase-fractions
|
||||
void solve();
|
||||
|
||||
//- Correct the mixture properties
|
||||
void correct();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user