reactingEulerFoam::phaseSystem: Merged with multiphaseSystem

The base phaseSystem now provides all the functionality needed for
reactingMultiphaseEulerFoam and twoPhaseSystem is a specialisation, simplifying
maintenance.
This commit is contained in:
Henry Weller
2020-07-14 15:51:44 +01:00
parent 98d4937ee3
commit 1d9ad9aa8e
23 changed files with 388 additions and 551 deletions

View File

@ -7,6 +7,8 @@ phasePair/phasePair/phasePair.C
phasePair/orderedPhasePair/orderedPhasePair.C
phaseSystem/phaseSystem.C
phaseSystem/phaseSystemNew.C
phaseSystem/phaseSystemSolve.C
diameterModels/diameterModel/diameterModel.C
diameterModels/diameterModel/newDiameterModel.C
@ -85,4 +87,6 @@ BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C
BlendedInterfacialModel/blendingMethods/linear/linear.C
BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libreactingPhaseSystem

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,7 @@ Class
Description
Contact-angle boundary condition for multi-phase interface-capturing
simulations. Used in conjunction with multiphaseSystem.
simulations. Used in conjunction with phaseSystem.
SourceFiles
alphaContactAngleFvPatchScalarField.C
@ -37,7 +37,7 @@ SourceFiles
#define alphaContactAngleFvPatchScalarField_H
#include "zeroGradientFvPatchFields.H"
#include "multiphaseSystem.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,7 +29,11 @@ License
#include "surfaceInterpolate.H"
#include "fvcDdt.H"
#include "localEulerDdtScheme.H"
#include "fvcDiv.H"
#include "fvcGrad.H"
#include "fvcSnGrad.H"
#include "alphaContactAngleFvPatchScalarField.H"
#include "unitConversion.H"
#include "dragModel.H"
#include "BlendedInterfacialModel.H"
@ -38,6 +42,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(phaseSystem, 0);
defineRunTimeSelectionTable(phaseSystem, dictionary);
}
const Foam::word Foam::phaseSystem::propertiesName("phaseProperties");
@ -189,6 +194,164 @@ void Foam::phaseSystem::setMixturePhi
}
Foam::tmp<Foam::surfaceVectorField> Foam::phaseSystem::nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
/*
// Cell gradient of alpha
volVectorField gradAlpha =
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
// Interpolated face-gradient of alpha
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
*/
surfaceVectorField gradAlphaf
(
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
}
Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
// Face unit interface normal flux
return nHatfv(alpha1, alpha2) & mesh_.Sf();
}
void Foam::phaseSystem::correctContactAngle
(
const phaseModel& phase1,
const phaseModel& phase2,
surfaceVectorField::Boundary& nHatb
) const
{
const volScalarField::Boundary& gbf
= phase1.boundaryField();
const fvBoundaryMesh& boundary = mesh_.boundary();
forAll(boundary, patchi)
{
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
{
const alphaContactAngleFvPatchScalarField& acap =
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
vectorField& nHatPatch = nHatb[patchi];
vectorField AfHatPatch
(
mesh_.Sf().boundaryField()[patchi]
/mesh_.magSf().boundaryField()[patchi]
);
alphaContactAngleFvPatchScalarField::thetaPropsTable::
const_iterator tp =
acap.thetaProps()
.find(phasePairKey(phase1.name(), phase2.name()));
if (tp == acap.thetaProps().end())
{
FatalErrorInFunction
<< "Cannot find interface "
<< phasePairKey(phase1.name(), phase2.name())
<< "\n in table of theta properties for patch "
<< acap.patch().name()
<< exit(FatalError);
}
bool matched = (tp.key().first() == phase1.name());
scalar theta0 = degToRad(tp().theta0(matched));
scalarField theta(boundary[patchi].size(), theta0);
scalar uTheta = tp().uTheta();
// Calculate the dynamic contact angle if required
if (uTheta > small)
{
scalar thetaA = degToRad(tp().thetaA(matched));
scalar thetaR = degToRad(tp().thetaR(matched));
// Calculated the component of the velocity parallel to the wall
vectorField Uwall
(
phase1.U()().boundaryField()[patchi].patchInternalField()
- phase1.U()().boundaryField()[patchi]
);
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
// Find the direction of the interface parallel to the wall
vectorField nWall
(
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
);
// Normalise nWall
nWall /= (mag(nWall) + small);
// Calculate Uwall resolved normal to the interface parallel to
// the interface
scalarField uwall(nWall & Uwall);
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
}
// Reset nHatPatch to correspond to the contact angle
scalarField a12(nHatPatch & AfHatPatch);
scalarField b1(cos(theta));
scalarField b2(nHatPatch.size());
forAll(b2, facei)
{
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
}
scalarField det(1 - a12*a12);
scalarField a((b1 - a12*b2)/det);
scalarField b((b2 - a12*b1)/det);
nHatPatch = a*AfHatPatch + b*nHatPatch;
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
}
}
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::K
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseSystem::phaseSystem
@ -239,7 +402,15 @@ Foam::phaseSystem::phaseSystem
dimensionedScalar(dimPressure/dimTime, 0)
),
MRF_(mesh_)
MRF_(mesh_),
cAlphas_(lookupOrDefault("interfaceCompression", cAlphaTable())),
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
)
{
// Groupings
label movingPhasei = 0;
@ -325,6 +496,12 @@ Foam::phaseSystem::phaseSystem
}
}
}
forAll(phases(), phasei)
{
const volScalarField& alphai = phases()[phasei];
mesh_.setFluxRequired(alphai.name());
}
}
@ -445,6 +622,32 @@ Foam::phaseSystem::sigma(const phasePairKey& key, label patchi) const
}
Foam::tmp<Foam::volScalarField>
Foam::phaseSystem::nearInterface() const
{
tmp<volScalarField> tnearInt
(
volScalarField::New
(
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)
);
forAll(phases(), phasei)
{
tnearInt.ref() = max
(
tnearInt(),
pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
);
}
return tnearInt;
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::dmdtf
(
const phasePairKey& key
@ -497,12 +700,45 @@ bool Foam::phaseSystem::implicitPhasePressure() const
}
void Foam::phaseSystem::solve
Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::surfaceTension
(
const PtrList<volScalarField>& rAUs,
const PtrList<surfaceScalarField>& rAUfs
)
{}
const phaseModel& phase1
) const
{
tmp<surfaceScalarField> tSurfaceTension
(
surfaceScalarField::New
(
"surfaceTension",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
);
forAll(phases(), phasej)
{
const phaseModel& phase2 = phases()[phasej];
if (&phase2 != &phase1)
{
phasePairKey key12(phase1.name(), phase2.name());
cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
if (cAlpha != cAlphas_.end())
{
tSurfaceTension.ref() +=
fvc::interpolate(sigma(key12)*K(phase1, phase2))
*(
fvc::interpolate(phase2)*fvc::snGrad(phase1)
- fvc::interpolate(phase1)*fvc::snGrad(phase2)
);
}
}
}
return tSurfaceTension;
}
void Foam::phaseSystem::correct()

View File

@ -132,6 +132,9 @@ protected:
>
aspectRatioModelTable;
typedef HashTable<scalar, phasePairKey, phasePairKey::hash>
cAlphaTable;
// Protected data
@ -172,6 +175,12 @@ protected:
//- Blending methods
blendingMethodTable blendingMethods_;
//- Interface compression coefficients
cAlphaTable cAlphas_;
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
// Sub Models
@ -182,6 +191,12 @@ protected:
aspectRatioModelTable aspectRatioModels_;
//- Flag to indicate that returned lists of fields are "complete"; i.e.,
// that an absence of force is returned as a constructed list of zeros,
// rather than a null pointer
static const bool fillFields_ = false;
// Protected member functions
//- Calculate and return the mixture flux
@ -264,6 +279,47 @@ protected:
);
// Functions required for interface compression
//- Normal to interface between two phases
// Used for interface compression
tmp<surfaceVectorField> nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
//- Normal to interface between two phases dotted with face areas
// Used for interface compression
tmp<surfaceScalarField> nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
//- Correction for the boundary condition on the unit normal nHat on
// walls to produce the correct contact angle.
//
// The dynamic contact angle is calculated from the component of the
// velocity on the direction of the interface, parallel to the wall.
// Used for interface compression
void correctContactAngle
(
const phaseModel& alpha1,
const phaseModel& alpha2,
surfaceVectorField::Boundary& nHatb
) const;
//- Curvature of interface between two phases
// Used for interface compression
tmp<volScalarField> K
(
const phaseModel& alpha1,
const phaseModel& alpha2
) const;
// Functions required by twoPhaseSystem
//- Return the drag coefficient for phase pair
@ -288,12 +344,34 @@ public:
static const word propertiesName;
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
phaseSystem,
dictionary,
(
const fvMesh& mesh
),
(mesh)
);
// Constructors
//- Construct from fvMesh
phaseSystem(const fvMesh& mesh);
// Selectors
static autoPtr<phaseSystem> New
(
const fvMesh& mesh
);
//- Destructor
virtual ~phaseSystem();
@ -450,6 +528,10 @@ public:
label patchi
) const;
//- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface.
tmp<volScalarField> nearInterface() const;
//- Return the mass transfer rate for an interface
virtual tmp<volScalarField> dmdtf(const phasePairKey& key) const;
@ -550,6 +632,12 @@ public:
//- Return the specie transfer matrices
virtual autoPtr<specieTransferTable> specieTransfer() const = 0;
//- Return the surface tension force
tmp<surfaceScalarField> surfaceTension
(
const phaseModel& phase
) const;
// Evolution

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,16 +23,16 @@ License
\*---------------------------------------------------------------------------*/
#include "multiphaseSystem.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
Foam::autoPtr<Foam::phaseSystem> Foam::phaseSystem::New
(
const fvMesh& mesh
)
{
const word multiphaseSystemType
const word phaseSystemType
(
IOdictionary
(
@ -48,18 +48,18 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
).lookup("type")
);
Info<< "Selecting multiphaseSystem "
<< multiphaseSystemType << endl;
Info<< "Selecting phaseSystem "
<< phaseSystemType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(multiphaseSystemType);
dictionaryConstructorTablePtr_->find(phaseSystemType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown multiphaseSystemType type "
<< multiphaseSystemType << endl << endl
<< "Valid multiphaseSystem types are : " << endl
<< "Unknown phaseSystemType type "
<< phaseSystemType << endl << endl
<< "Valid phaseSystem types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
@ -67,4 +67,5 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
return cstrIter()(mesh);
}
// ************************************************************************* //

View File

@ -23,13 +23,10 @@ License
\*---------------------------------------------------------------------------*/
#include "multiphaseSystem.H"
#include "alphaContactAngleFvPatchScalarField.H"
#include "unitConversion.H"
#include "phaseSystem.H"
#include "MULES.H"
#include "subCycle.H"
#include "UniformField.H"
#include "fvcDdt.H"
#include "fvcDiv.H"
@ -42,282 +39,9 @@ License
#include "fvmLaplacian.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(multiphaseSystem, 0);
defineRunTimeSelectionTable(multiphaseSystem, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
/*
// Cell gradient of alpha
volVectorField gradAlpha =
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
// Interpolated face-gradient of alpha
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
*/
surfaceVectorField gradAlphaf
(
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
}
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
// Face unit interface normal flux
return nHatfv(alpha1, alpha2) & mesh_.Sf();
}
// Correction for the boundary condition on the unit normal nHat on
// walls to produce the correct contact angle.
// The dynamic contact angle is calculated from the component of the
// velocity on the direction of the interface, parallel to the wall.
void Foam::multiphaseSystem::correctContactAngle
(
const phaseModel& phase1,
const phaseModel& phase2,
surfaceVectorField::Boundary& nHatb
) const
{
const volScalarField::Boundary& gbf
= phase1.boundaryField();
const fvBoundaryMesh& boundary = mesh_.boundary();
forAll(boundary, patchi)
{
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
{
const alphaContactAngleFvPatchScalarField& acap =
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
vectorField& nHatPatch = nHatb[patchi];
vectorField AfHatPatch
(
mesh_.Sf().boundaryField()[patchi]
/mesh_.magSf().boundaryField()[patchi]
);
alphaContactAngleFvPatchScalarField::thetaPropsTable::
const_iterator tp =
acap.thetaProps()
.find(phasePairKey(phase1.name(), phase2.name()));
if (tp == acap.thetaProps().end())
{
FatalErrorInFunction
<< "Cannot find interface "
<< phasePairKey(phase1.name(), phase2.name())
<< "\n in table of theta properties for patch "
<< acap.patch().name()
<< exit(FatalError);
}
bool matched = (tp.key().first() == phase1.name());
scalar theta0 = degToRad(tp().theta0(matched));
scalarField theta(boundary[patchi].size(), theta0);
scalar uTheta = tp().uTheta();
// Calculate the dynamic contact angle if required
if (uTheta > small)
{
scalar thetaA = degToRad(tp().thetaA(matched));
scalar thetaR = degToRad(tp().thetaR(matched));
// Calculated the component of the velocity parallel to the wall
vectorField Uwall
(
phase1.U()().boundaryField()[patchi].patchInternalField()
- phase1.U()().boundaryField()[patchi]
);
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
// Find the direction of the interface parallel to the wall
vectorField nWall
(
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
);
// Normalise nWall
nWall /= (mag(nWall) + small);
// Calculate Uwall resolved normal to the interface parallel to
// the interface
scalarField uwall(nWall & Uwall);
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
}
// Reset nHatPatch to correspond to the contact angle
scalarField a12(nHatPatch & AfHatPatch);
scalarField b1(cos(theta));
scalarField b2(nHatPatch.size());
forAll(b2, facei)
{
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
}
scalarField det(1 - a12*a12);
scalarField a((b1 - a12*b2)/det);
scalarField b((b2 - a12*b1)/det);
nHatPatch = a*AfHatPatch + b*nHatPatch;
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
}
}
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiphaseSystem::multiphaseSystem
(
const fvMesh& mesh
)
:
phaseSystem(mesh),
cAlphas_(lookup("interfaceCompression")),
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
)
{
forAll(phases(), phasei)
{
volScalarField& alphai = phases()[phasei];
mesh_.setFluxRequired(alphai.name());
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::multiphaseSystem::~multiphaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
(
const phaseModel& phase1
) const
{
tmp<surfaceScalarField> tSurfaceTension
(
surfaceScalarField::New
(
"surfaceTension",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
);
forAll(phases(), phasej)
{
const phaseModel& phase2 = phases()[phasej];
if (&phase2 != &phase1)
{
phasePairKey key12(phase1.name(), phase2.name());
cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
if (cAlpha != cAlphas_.end())
{
tSurfaceTension.ref() +=
fvc::interpolate(sigma(key12)*K(phase1, phase2))
*(
fvc::interpolate(phase2)*fvc::snGrad(phase1)
- fvc::interpolate(phase1)*fvc::snGrad(phase2)
);
}
}
}
return tSurfaceTension;
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseSystem::nearInterface() const
{
tmp<volScalarField> tnearInt
(
volScalarField::New
(
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)
);
forAll(phases(), phasei)
{
tnearInt.ref() = max
(
tnearInt(),
pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
);
}
return tnearInt;
}
void Foam::multiphaseSystem::solve
void Foam::phaseSystem::solve
(
const PtrList<volScalarField>& rAUs,
const PtrList<surfaceScalarField>& rAUfs

View File

@ -1,7 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
wclean libso multiphaseSystem
wclean libso multiphaseSystems
wclean
#------------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType multiphaseSystem
wmake $targetType multiphaseSystems
wmake $targetType
#------------------------------------------------------------------------------

View File

@ -1,6 +1,5 @@
EXE_INC = \
-I../include \
-ImultiphaseSystem/lnInclude \
-I../phaseSystems/lnInclude \
-I../interfacialModels/lnInclude \
-I../interfacialCompositionModels/lnInclude \
@ -14,7 +13,7 @@ EXE_INC = \
EXE_LIBS = \
-lreactingPhaseSystem \
-lreactingMultiphaseSystem \
-lreactingMultiphaseSystems \
-lreactingEulerianInterfacialModels \
-lreactingEulerianInterfacialCompositionModels \
-lphaseReactingMomentumTransportModels \

View File

@ -4,12 +4,12 @@
Info<< "Creating phaseSystem\n" << endl;
autoPtr<multiphaseSystem> fluidPtr
autoPtr<phaseSystem> fluidPtr
(
multiphaseSystem::New(mesh)
phaseSystem::New(mesh)
);
multiphaseSystem& fluid = fluidPtr();
multiphaseSystem::phaseModelList& phases = fluid.phases();
phaseSystem& fluid = fluidPtr();
phaseSystem::phaseModelList& phases = fluid.phases();
dimensionedScalar pMin
(

View File

@ -1,6 +0,0 @@
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
multiphaseSystem.C
newMultiphaseSystem.C
multiphaseSystems.C
LIB = $(FOAM_LIBBIN)/libreactingMultiphaseSystem

View File

@ -1,179 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 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 <http://www.gnu.org/licenses/>.
Class
Foam::multiphaseSystem
Description
Class which solves the volume fraction equations for two phases.
SourceFiles
multiphaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef multiphaseSystem_H
#define multiphaseSystem_H
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class dragModel;
class virtualMassModel;
/*---------------------------------------------------------------------------*\
Class multiphaseSystem Declaration
\*---------------------------------------------------------------------------*/
class multiphaseSystem
:
public phaseSystem
{
// Private Typedefs
typedef HashTable<scalar, phasePairKey, phasePairKey::hash>
cAlphaTable;
// Private Data
//- Interface compression coefficients
cAlphaTable cAlphas_;
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
// Private Member Functions
tmp<surfaceVectorField> nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
tmp<surfaceScalarField> nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
void correctContactAngle
(
const phaseModel& alpha1,
const phaseModel& alpha2,
surfaceVectorField::Boundary& nHatb
) const;
tmp<volScalarField> K
(
const phaseModel& alpha1,
const phaseModel& alpha2
) const;
protected:
// Protected data
//- Flag to indicate that returned lists of fields are "complete"; i.e.,
// that an absence of force is returned as a constructed list of zeros,
// rather than a null pointer
static const bool fillFields_ = false;
public:
//- Runtime type information
TypeName("multiphaseSystem");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
multiphaseSystem,
dictionary,
(
const fvMesh& mesh
),
(mesh)
);
// Constructors
//- Construct from fvMesh
multiphaseSystem(const fvMesh&);
//- Destructor
virtual ~multiphaseSystem();
// Selectors
static autoPtr<multiphaseSystem> New
(
const fvMesh& mesh
);
// Member Functions
using phaseSystem::sigma;
using phaseSystem::dmdts;
//- Return the surface tension force
tmp<surfaceScalarField> surfaceTension(const phaseModel& phase) const;
//- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface.
tmp<volScalarField> nearInterface() const;
//- Solve for the phase fractions
virtual void solve
(
const PtrList<volScalarField>& rAUs,
const PtrList<surfaceScalarField>& rAUfs
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "multiphaseSystemI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,28 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
multiphaseSystems.C
LIB = $(FOAM_LIBBIN)/libreactingMultiphaseSystems

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,10 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "phaseSystem.H"
#include "multiphaseSystem.H"
#include "MomentumTransferPhaseSystem.H"
#include "OneResistanceHeatTransferPhaseSystem.H"
#include "TwoResistanceHeatTransferPhaseSystem.H"
@ -35,6 +32,8 @@ License
#include "PopulationBalancePhaseSystem.H"
#include "ThermalPhaseChangePhaseSystem.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -44,14 +43,14 @@ namespace Foam
<
OneResistanceHeatTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
MomentumTransferPhaseSystem<phaseSystem>
>
>
basicMultiphaseSystem;
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
phaseSystem,
basicMultiphaseSystem,
dictionary,
basicMultiphaseSystem
@ -64,7 +63,7 @@ namespace Foam
<
TwoResistanceHeatTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
MomentumTransferPhaseSystem<phaseSystem>
>
>
>
@ -72,7 +71,7 @@ namespace Foam
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
phaseSystem,
interfaceCompositionPhaseChangeMultiphaseSystem,
dictionary,
interfaceCompositionPhaseChangeMultiphaseSystem
@ -85,7 +84,7 @@ namespace Foam
<
TwoResistanceHeatTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
MomentumTransferPhaseSystem<phaseSystem>
>
>
>
@ -93,7 +92,7 @@ namespace Foam
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
phaseSystem,
thermalPhaseChangeMultiphaseSystem,
dictionary,
thermalPhaseChangeMultiphaseSystem
@ -106,7 +105,7 @@ namespace Foam
<
OneResistanceHeatTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
MomentumTransferPhaseSystem<phaseSystem>
>
>
>
@ -114,7 +113,7 @@ namespace Foam
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
phaseSystem,
populationBalanceMultiphaseSystem,
dictionary,
populationBalanceMultiphaseSystem
@ -129,7 +128,7 @@ namespace Foam
<
TwoResistanceHeatTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
MomentumTransferPhaseSystem<phaseSystem>
>
>
>
@ -138,7 +137,7 @@ namespace Foam
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
phaseSystem,
thermalPhaseChangePopulationBalanceMultiphaseSystem,
dictionary,
thermalPhaseChangePopulationBalanceMultiphaseSystem

View File

@ -34,7 +34,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "multiphaseSystem.H"
#include "phaseSystem.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "pimpleControl.H"
#include "localEulerDdtScheme.H"

View File

@ -1,5 +1,5 @@
twoPhaseSystem.C
newTwoPhaseSystem.C
twoPhaseSystemNew.C
twoPhaseSystems.C
LIB = $(FOAM_LIBBIN)/libreactingTwoPhaseSystem

View File

@ -60,10 +60,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
phaseSystem(mesh),
phase1_(phaseModels_[0]),
phase2_(phaseModels_[1])
{
volScalarField& alpha1 = phase1_;
mesh.setFluxRequired(alpha1.name());
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,9 +23,6 @@ License
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "phaseSystem.H"
#include "twoPhaseSystem.H"
#include "MomentumTransferPhaseSystem.H"
#include "OneResistanceHeatTransferPhaseSystem.H"
@ -35,6 +32,8 @@ License
#include "ThermalPhaseChangePhaseSystem.H"
#include "PopulationBalancePhaseSystem.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam