Merge branch 'master' of /home/dm4/OpenFOAM/repositories/OpenFOAM-dev

This commit is contained in:
andy
2014-01-24 09:54:39 +00:00
203 changed files with 9079 additions and 2095 deletions

View File

@ -8,30 +8,36 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
volScalarField dragCoeff(fluid.dragCoeff()); volScalarField dragCoeff(fluid.dragCoeff());
{ {
volVectorField liftForce(fluid.liftForce(U)); volScalarField virtualMassCoeff(fluid.virtualMassCoeff());
volVectorField liftForce(fluid.liftForce());
volVectorField wallLubricationForce(fluid.wallLubricationForce());
volVectorField turbulentDispersionForce(fluid.turbulentDispersionForce());
{ {
U1Eqn = U1Eqn =
( (
fvm::ddt(alpha1, U1) fvm::ddt(alpha1, U1)
+ fvm::div(alphaPhi1, U1) + fvm::div(alphaPhi1, U1)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1)
+ fluid.Cvm()*rho2*alpha1*alpha2/rho1*
(
fvm::ddt(U1)
+ fvm::div(phi1, U1)
- fvm::Sp(fvc::div(phi1), U1)
)
+ phase1.turbulence().divDevReff(U1) + phase1.turbulence().divDevReff(U1)
== ==
- fvm::Sp(dragCoeff/rho1, U1) - fvm::Sp(dragCoeff/rho1, U1)
- alpha1*alpha2/rho1*(liftForce - fluid.Cvm()*rho2*DDtU2) - alpha1*alpha2/rho1
*(
liftForce
+ wallLubricationForce
+ turbulentDispersionForce
)
- virtualMassCoeff/rho1
*(
fvm::ddt(U1)
+ fvm::div(phi1, U1)
- fvm::Sp(fvc::div(phi1), U1)
- DDtU2
)
); );
mrfZones.addCoriolis(alpha1*(1 + fluid.Cvm()*rho2*alpha2/rho1), U1Eqn); mrfZones.addCoriolis(alpha1 + virtualMassCoeff/rho1, U1Eqn);
U1Eqn.relax(); U1Eqn.relax();
} }
@ -40,22 +46,25 @@ volScalarField dragCoeff(fluid.dragCoeff());
( (
fvm::ddt(alpha2, U2) fvm::ddt(alpha2, U2)
+ fvm::div(alphaPhi2, U2) + fvm::div(alphaPhi2, U2)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2) - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2)
+ fluid.Cvm()*rho2*alpha1*alpha2/rho2*
(
fvm::ddt(U2)
+ fvm::div(phi2, U2)
- fvm::Sp(fvc::div(phi2), U2)
)
+ phase2.turbulence().divDevReff(U2) + phase2.turbulence().divDevReff(U2)
== ==
- fvm::Sp(dragCoeff/rho2, U2) - fvm::Sp(dragCoeff/rho2, U2)
+ alpha1*alpha2/rho2*(liftForce + fluid.Cvm()*rho2*DDtU1) + alpha1*alpha2/rho2
*(
liftForce
+ wallLubricationForce
+ turbulentDispersionForce
)
- virtualMassCoeff/rho2
*(
fvm::ddt(U2)
+ fvm::div(phi2, U2)
- fvm::Sp(fvc::div(phi2), U2)
- DDtU1
)
); );
mrfZones.addCoriolis(alpha2*(1 + fluid.Cvm()*rho2*alpha1/rho2), U2Eqn); mrfZones.addCoriolis(alpha2 + virtualMassCoeff/rho2, U2Eqn);
U2Eqn.relax(); U2Eqn.relax();
} }
} }

View File

@ -1,6 +1,6 @@
Info<< "Creating twoPhaseSystem\n" << endl; Info<< "Creating twoPhaseSystem\n" << endl;
twoPhaseSystem fluid(mesh); twoPhaseSystem fluid(mesh, g);
phaseModel& phase1 = fluid.phase1(); phaseModel& phase1 = fluid.phase1();
phaseModel& phase2 = fluid.phase2(); phaseModel& phase2 = fluid.phase2();

View File

@ -1,20 +1,53 @@
dragModels/dragModel/dragModel.C dragModels/dragModel/dragModel.C
dragModels/dragModel/newDragModel.C dragModels/dragModel/newDragModel.C
dragModels/noDrag/noDrag.C
dragModels/segregated/segregated.C
dragModels/Ergun/Ergun.C dragModels/Ergun/Ergun.C
dragModels/Gibilaro/Gibilaro.C
dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
dragModels/SchillerNaumann/SchillerNaumann.C dragModels/SchillerNaumann/SchillerNaumann.C
dragModels/Gibilaro/Gibilaro.C
dragModels/WenYu/WenYu.C
dragModels/SyamlalOBrien/SyamlalOBrien.C dragModels/SyamlalOBrien/SyamlalOBrien.C
dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C
dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C
dragModels/WenYu/WenYu.C
heatTransferModels/heatTransferModel/heatTransferModel.C swarmCorrections/swarmCorrection/swarmCorrection.C
heatTransferModels/heatTransferModel/newHeatTransferModel.C swarmCorrections/swarmCorrection/newSwarmCorrection.C
heatTransferModels/RanzMarshall/RanzMarshall.C swarmCorrections/noSwarm/noSwarm.C
swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C
liftModels/liftModel/liftModel.C liftModels/liftModel/liftModel.C
liftModels/liftModel/newLiftModel.C liftModels/liftModel/newLiftModel.C
liftModels/noLift/noLift.C liftModels/noLift/noLift.C
liftModels/constantCoefficient/constantCoefficient.C liftModels/constantLiftCoefficient/constantLiftCoefficient.C
liftModels/TomiyamaLift/TomiyamaLift.C
heatTransferModels/heatTransferModel/heatTransferModel.C
heatTransferModels/heatTransferModel/newHeatTransferModel.C
heatTransferModels/noHeatTransfer/noHeatTransfer.C
heatTransferModels/RanzMarshall/RanzMarshall.C
virtualMassModels/virtualMassModel/virtualMassModel.C
virtualMassModels/virtualMassModel/newVirtualMassModel.C
virtualMassModels/noVirtualMass/noVirtualMass.C
virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C
virtualMassModels/Lamb/Lamb.C
wallLubricationModels/wallLubricationModel/wallLubricationModel.C
wallLubricationModels/wallLubricationModel/newWallLubricationModel.C
wallLubricationModels/noWallLubrication/noWallLubrication.C
wallLubricationModels/Antal/Antal.C
turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C
turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C
turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C
turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C
turbulentDispersionModels/Gosman/Gosman.C
aspectRatioModels/aspectRatioModel/aspectRatioModel.C
aspectRatioModels/aspectRatioModel/newAspectRatioModel.C
aspectRatioModels/constantAspectRatio/constantAspectRatio.C
aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C
LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels

View File

@ -1,7 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/transportModel \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
-I../twoPhaseSystem/lnInclude -I../twoPhaseSystem/lnInclude
LIB_LIBS = \ LIB_LIBS = \

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "VakhrushevEfremov.H"
#include "orderedPhasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(VakhrushevEfremov, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
VakhrushevEfremov,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov
(
const dictionary& dict,
const orderedPhasePair& pair
)
:
aspectRatioModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::VakhrushevEfremov::~VakhrushevEfremov()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::VakhrushevEfremov::E() const
{
volScalarField Ta(pair_.Ta());
return
neg(Ta - scalar(1))*scalar(1)
+ pos(Ta - scalar(1))*neg(Ta - scalar(39.8))
*pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1)))))
+ pos(Ta - scalar(39.8))*0.24;
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::VakhrushevEfremov
Description
Aspect ratio model of Vakhrushev and Efremov.
Reference:
\verbatim
"Interpolation formula for computing the velocities of single gas
bubbles in liquids"
I A Vakhrushev and G I Efremov
Chemistry and Technology of Fuels and Oils
Volume 6, Issue 5, Pages 376-379, May 1970
\endverbatim
SourceFiles
VakhrushevEfremov.C
\*---------------------------------------------------------------------------*/
#ifndef VakhrushevEfremov_H
#define VakhrushevEfremov_H
#include "aspectRatioModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class VakhrushevEfremov Declaration
\*---------------------------------------------------------------------------*/
class VakhrushevEfremov
:
public aspectRatioModel
{
public:
//- Runtime type information
TypeName("VakhrushevEfremov");
// Constructors
//- Construct from a dictionary and an ordered phase pair
VakhrushevEfremov
(
const dictionary& dict,
const orderedPhasePair& pair
);
//- Destructor
virtual ~VakhrushevEfremov();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "orderedPhasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(aspectRatioModel, 0);
defineRunTimeSelectionTable(aspectRatioModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModel::aspectRatioModel
(
const dictionary& dict,
const orderedPhasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModel::~aspectRatioModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::aspectRatioModel
Description
SourceFiles
aspectRatioModel.C
newAspectRatioModel.C
\*---------------------------------------------------------------------------*/
#ifndef aspectRatioModel_H
#define aspectRatioModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class orderedPhasePair;
/*---------------------------------------------------------------------------*\
Class aspectRatioModel Declaration
\*---------------------------------------------------------------------------*/
class aspectRatioModel
{
protected:
// Protected data
//- Phase pair
const orderedPhasePair& pair_;
public:
//- Runtime type information
TypeName("aspectRatioModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
aspectRatioModel,
dictionary,
(
const dictionary& dict,
const orderedPhasePair& pair
),
(dict, pair)
);
// Constructors
//- Construct from a dictionary and an ordered phase pair
aspectRatioModel
(
const dictionary& dict,
const orderedPhasePair& pair
);
//- Destructor
virtual ~aspectRatioModel();
// Selectors
static autoPtr<aspectRatioModel> New
(
const dictionary& dict,
const orderedPhasePair& pair
);
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "orderedPhasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::aspectRatioModel >
Foam::aspectRatioModel::New
(
const dictionary& dict,
const orderedPhasePair& pair
)
{
word aspectRatioModelType(dict.lookup("type"));
Info<< "Selecting aspectRatioModel for "
<< pair << ": " << aspectRatioModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(aspectRatioModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("aspectRatioModel::New")
<< "Unknown aspectRatioModelType type "
<< aspectRatioModelType << endl << endl
<< "Valid aspectRatioModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "constantAspectRatio.H"
#include "orderedPhasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(constantAspectRatio, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
constantAspectRatio,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
)
:
aspectRatioModel(dict, pair),
E0_("E0", dimless, dict.lookup("E0"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::constantAspectRatio::E() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
E0_
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::constantAspectRatio
Description
Constant value aspect ratio model.
SourceFiles
constantAspectRatio.C
\*---------------------------------------------------------------------------*/
#ifndef constantAspectRatio_H
#define constantAspectRatio_H
#include "aspectRatioModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class constantAspectRatio Declaration
\*---------------------------------------------------------------------------*/
class constantAspectRatio
:
public aspectRatioModel
{
// Private data
//- Constant aspect ratio value
const dimensionedScalar E0_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from a dictionary and an ordered phase pair
constantAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
);
//- Destructor
virtual ~constantAspectRatio();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Ergun.H" #include "Ergun.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(Ergun, 0); defineTypeNameAndDebug(Ergun, 0);
addToRunTimeSelectionTable(dragModel, Ergun, dictionary);
addToRunTimeSelectionTable
(
dragModel,
Ergun,
dictionary
);
} }
} }
@ -48,13 +43,11 @@ namespace dragModels
Foam::dragModels::Ergun::Ergun Foam::dragModels::Ergun::Ergun
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair)
{} {}
@ -66,17 +59,21 @@ Foam::dragModels::Ergun::~Ergun()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::K Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::Cd() const
(
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6)));
return return
150.0*alpha1_*phase2_.nu()*phase2_.rho() (4/3)
/sqr(alpha2*phase1_.d()) *(
+ 1.75*phase2_.rho()*Ur/(alpha2*phase1_.d()); 150
*max(pair_.dispersed(), residualAlpha_)
*pair_.continuous().nu()
/(
max(scalar(1) - pair_.dispersed(), residualAlpha_)
*pair_.dispersed().d()
*max(pair_.magUr(), residualSlip_)
)
+ 1.75
);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,6 +44,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -55,7 +58,6 @@ class Ergun
: :
public dragModel public dragModel
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -64,13 +66,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
Ergun Ergun
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -80,7 +80,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Gibilaro.H" #include "Gibilaro.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(Gibilaro, 0); defineTypeNameAndDebug(Gibilaro, 0);
addToRunTimeSelectionTable(dragModel, Gibilaro, dictionary);
addToRunTimeSelectionTable
(
dragModel,
Gibilaro,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace dragModels
Foam::dragModels::Gibilaro::Gibilaro Foam::dragModels::Gibilaro::Gibilaro
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,16 +60,15 @@ Foam::dragModels::Gibilaro::~Gibilaro()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::K Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::Cd() const
(
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField bp(pow(alpha2, -2.8));
volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
return (17.3/Re + scalar(0.336))*phase2_.rho()*Ur*bp/phase1_.d(); return
(4/3)
*(17.3/(alpha2*max(pair_.Re(), residualRe_)) + scalar(0.336))
*max(pair_.continuous(), residualAlpha_)
*pow(alpha2, -2.8);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,6 +44,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -55,6 +58,13 @@ class Gibilaro
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -64,13 +74,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
Gibilaro Gibilaro
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -80,7 +88,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,9 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "GidaspowErgunWenYu.H" #include "GidaspowErgunWenYu.H"
#include "phasePair.H"
#include "Ergun.H"
#include "WenYu.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +36,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(GidaspowErgunWenYu, 0); defineTypeNameAndDebug(GidaspowErgunWenYu, 0);
addToRunTimeSelectionTable(dragModel, GidaspowErgunWenYu, dictionary);
addToRunTimeSelectionTable
(
dragModel,
GidaspowErgunWenYu,
dictionary
);
} }
} }
@ -48,13 +45,28 @@ namespace dragModels
Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
Ergun_
(
new Ergun
(
dict,
pair
)
),
WenYu_
(
new WenYu
(
dict,
pair
)
),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,33 +78,12 @@ Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowErgunWenYu::K Foam::tmp<Foam::volScalarField>
( Foam::dragModels::GidaspowErgunWenYu::Cd() const
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6)));
volScalarField d(phase1_.d());
volScalarField bp(pow(alpha2, -2.65));
volScalarField Re(max(Ur*d/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
);
// Wen and Yu (1966)
return return
( pos(pair_.continuous() - 0.8)*WenYu_->Cd()
pos(alpha2 - 0.8) + neg(pair_.continuous() - 0.8)*Ergun_->Cd();
*(0.75*Cds*phase2_.rho()*Ur*bp/d)
+ neg(alpha2 - 0.8)
*(
150.0*alpha1_*phase2_.nu()*phase2_.rho()/(sqr(alpha2*d))
+ 1.75*phase2_.rho()*Ur/(alpha2*d)
)
);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,9 +42,15 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
class Ergun;
class WenYu;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class GidaspowErgunWenYu Declaration Class GidaspowErgunWenYu Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -53,6 +59,19 @@ class GidaspowErgunWenYu
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Ergun drag model
autoPtr<Ergun> Ergun_;
//- Wen Yu drag model
autoPtr<WenYu> WenYu_;
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -62,13 +81,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and an ordered phase pair
GidaspowErgunWenYu GidaspowErgunWenYu
( (
const dictionary& interfaceDict, const dictionary& interfaceDict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -78,7 +95,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "GidaspowSchillerNaumann.H" #include "GidaspowSchillerNaumann.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(GidaspowSchillerNaumann, 0); defineTypeNameAndDebug(GidaspowSchillerNaumann, 0);
addToRunTimeSelectionTable(dragModel, GidaspowSchillerNaumann, dictionary);
addToRunTimeSelectionTable
(
dragModel,
GidaspowSchillerNaumann,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace dragModels
Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,22 +60,21 @@ Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowSchillerNaumann::K Foam::tmp<Foam::volScalarField>
( Foam::dragModels::GidaspowSchillerNaumann::Cd() const
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1e-6))); volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField bp(pow(alpha2, -2.65)); volScalarField Re(max(alpha2*pair_.Re(), residualRe_));
volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds volScalarField Cds
( (
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44 + pos(Re - 1000)*0.44
); );
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); return
Cds
*pow(alpha2, -2.65)
*max(pair_.continuous(), residualAlpha_);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,6 +51,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -62,6 +65,13 @@ class GidaspowSchillerNaumann
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -71,13 +81,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
GidaspowSchillerNaumann GidaspowSchillerNaumann
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -87,7 +95,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "SchillerNaumann.H" #include "SchillerNaumann.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(SchillerNaumann, 0); defineTypeNameAndDebug(SchillerNaumann, 0);
addToRunTimeSelectionTable(dragModel, SchillerNaumann, dictionary);
addToRunTimeSelectionTable
(
dragModel,
SchillerNaumann,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace dragModels
Foam::dragModels::SchillerNaumann::SchillerNaumann Foam::dragModels::SchillerNaumann::SchillerNaumann
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,19 +60,13 @@ Foam::dragModels::SchillerNaumann::~SchillerNaumann()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::K Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::Cd() const
(
const volScalarField& Ur
) const
{ {
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); volScalarField Re(pair_.Re() + residualRe_);
volScalarField Cds
(
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44
);
return 0.75*Cds*phase2_.rho()*Ur/phase1_.d(); return
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,6 +40,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -51,6 +54,13 @@ class SchillerNaumann
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -60,13 +70,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
SchillerNaumann SchillerNaumann
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -76,7 +84,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "SyamlalOBrien.H" #include "SyamlalOBrien.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(SyamlalOBrien, 0); defineTypeNameAndDebug(SyamlalOBrien, 0);
addToRunTimeSelectionTable(dragModel, SyamlalOBrien, dictionary);
addToRunTimeSelectionTable
(
dragModel,
SyamlalOBrien,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace dragModels
Foam::dragModels::SyamlalOBrien::SyamlalOBrien Foam::dragModels::SyamlalOBrien::SyamlalOBrien
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,32 +60,30 @@ Foam::dragModels::SyamlalOBrien::~SyamlalOBrien()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::K Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::Cd() const
(
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField magUr(max(pair_.magUr(), residualSlip_));
volScalarField A(pow(alpha2, 4.14)); volScalarField A(pow(alpha2, 4.14));
volScalarField B volScalarField B
( (
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28)) neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
+ pos(alpha2 - 0.85)*(pow(alpha2, 2.65)) + pos(alpha2 - 0.85)*(pow(alpha2, 2.65))
); );
volScalarField Re(max(pair_.Re(), residualRe_));
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Vr volScalarField Vr
( (
0.5* 0.5
( *(
A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A))
) )
); );
volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re)));
return 0.75*Cds*phase2_.rho()*Ur/(phase1_.d()*sqr(Vr)); return
Cds
*max(pair_.continuous(), residualAlpha_)
/sqr(Vr);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -54,6 +57,13 @@ class SyamlalOBrien
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -63,13 +73,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
SyamlalOBrien SyamlalOBrien
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -79,7 +87,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "TomiyamaAnalytic.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(TomiyamaAnalytic, 0);
addToRunTimeSelectionTable(dragModel, TomiyamaAnalytic, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::TomiyamaAnalytic::TomiyamaAnalytic
(
const dictionary& dict,
const phasePair& pair
)
:
dragModel(dict, pair),
residualEo_("residualEo", dimless, dict.lookup("residualEo")),
residualE_("residualE", dimless, dict.lookup("residualE"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::TomiyamaAnalytic::~TomiyamaAnalytic()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::TomiyamaAnalytic::Cd() const
{
volScalarField Eo(max(pair_.Eo(), residualEo_));
volScalarField E(max(pair_.E(), residualE_));
volScalarField OmEsq(max(scalar(1) - sqr(E), residualE_));
volScalarField rtOmEsq(sqrt(OmEsq));
volScalarField F((asin(rtOmEsq) - E*rtOmEsq)/OmEsq);
return
(8.0/3.0)*Eo
/(
Eo*pow(E, 2.0/3.0)/OmEsq
+ 16*pow(E, 0.75)
)
/sqr(F);
}
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::dragModels::TomiyamaAnalytic
Description
Analytic drag model of Tomiyama et al.
Reference:
\verbatim
"Drag Coefficients of Bubbles. 1st Report. Drag Coefficients of a
Single Bubble in a Stagnant Liquid."
A Tomiyama, I Kataoka, and T Sakaguchi
Nippon Kikai Gakkai Ronbunshu
Volume 61, Issue 587, Pages 2357-2364, 1995
\endverbatim
SourceFiles
TomiyamaAnalytic.C
\*---------------------------------------------------------------------------*/
#ifndef TomiyamaAnalytic_H
#define TomiyamaAnalytic_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class TomiyamaAnalytic Declaration
\*---------------------------------------------------------------------------*/
class TomiyamaAnalytic
:
public dragModel
{
private:
// Private data
//- Residual Eotvos number
const dimensionedScalar residualEo_;
//- Residual aspect ratio
const dimensionedScalar residualE_;
public:
//- Runtime type information
TypeName("TomiyamaAnalytic");
// Constructors
//- Construct from a dictionary and a phase pair
TomiyamaAnalytic
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~TomiyamaAnalytic();
// Member Functions
// Drag coefficient
virtual tmp<volScalarField> Cd() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "TomiyamaCorrelated.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(TomiyamaCorrelated, 0);
addToRunTimeSelectionTable(dragModel, TomiyamaCorrelated, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::TomiyamaCorrelated::TomiyamaCorrelated
(
const dictionary& dict,
const phasePair& pair
)
:
dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe")),
A_("A", dimless, dict.lookup("A"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::TomiyamaCorrelated::~TomiyamaCorrelated()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::dragModels::TomiyamaCorrelated::Cd() const
{
volScalarField Re(pair_.Re() + residualRe_);
volScalarField Eo(pair_.Eo());
return
max
(
A_/Re
*min
(
(1 + 0.15*pow(Re, 0.687)),
scalar(3)
),
8*Eo/(3*Eo + 12)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::dragModels::TomiyamaCorrelated
Description
Correlation of Tomiyama et al.
Reference:
\verbatim
"Terminal velocity of single bubbles in surface tension force dominant
regime"
A Tomiyama, G P Celata, S Hosokawa, S Yoshida
International Journal of Multiphase Flow
Volume 28, Issue 9, Pages 1497-1519, September 2002
\endverbatim
SourceFiles
TomiyamaCorrelated.C
\*---------------------------------------------------------------------------*/
#ifndef TomiyamaCorrelated_H
#define TomiyamaCorrelated_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class TomiyamaCorrelated Declaration
\*---------------------------------------------------------------------------*/
class TomiyamaCorrelated
:
public dragModel
{
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
//- Coefficient
const dimensionedScalar A_;
public:
//- Runtime type information
TypeName("TomiyamaCorrelated");
// Constructors
//- Construct from a dictionary and a phase pair
TomiyamaCorrelated
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~TomiyamaCorrelated();
// Member Functions
//- Drag coefficient
virtual tmp<volScalarField> Cd() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "WenYu.H" #include "WenYu.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace dragModels namespace dragModels
{ {
defineTypeNameAndDebug(WenYu, 0); defineTypeNameAndDebug(WenYu, 0);
addToRunTimeSelectionTable(dragModel, WenYu, dictionary);
addToRunTimeSelectionTable
(
dragModel,
WenYu,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace dragModels
Foam::dragModels::WenYu::WenYu Foam::dragModels::WenYu::WenYu
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dragModel(interfaceDict, alpha1, phase1, phase2) dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,22 +60,20 @@ Foam::dragModels::WenYu::~WenYu()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::K Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::Cd() const
(
const volScalarField& Ur
) const
{ {
volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField bp(pow(alpha2, -2.65)); volScalarField Re(max(pair_.Re(), residualRe_));
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds volScalarField Cds
( (
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
+ pos(Re - 1000)*0.44 + pos(Re - 1000)*0.44
); );
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); return
Cds
*pow(alpha2, -2.65)
*max(pair_.continuous(), residualAlpha_);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -54,6 +54,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace dragModels namespace dragModels
{ {
@ -65,6 +68,13 @@ class WenYu
: :
public dragModel public dragModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -74,13 +84,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
WenYu WenYu
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -90,7 +98,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- Drag coefficient
virtual tmp<volScalarField> Cd() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "dragModel.H" #include "dragModel.H"
#include "phasePair.H"
#include "swarmCorrection.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,21 +35,55 @@ namespace Foam
defineRunTimeSelectionTable(dragModel, dictionary); defineRunTimeSelectionTable(dragModel, dictionary);
} }
const Foam::dimensionSet Foam::dragModel::dimK(1, -3, -1, 0, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModel::dragModel Foam::dragModel::dragModel
( (
const dictionary& interfaceDict, const phasePair& pair
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
interfaceDict_(interfaceDict), regIOobject
alpha1_(alpha1), (
phase1_(phase1), IOobject
phase2_(phase2) (
IOobject::groupName(typeName, pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
)
),
pair_(pair)
{}
Foam::dragModel::dragModel
(
const dictionary& dict,
const phasePair& pair
)
:
regIOobject
(
IOobject
(
IOobject::groupName(typeName, pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
)
),
pair_(pair),
swarmCorrection_
(
swarmCorrection::New
(
dict.subDict("swarmCorrection"),
pair
)
),
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha")),
residualSlip_("residualSlip", dimVelocity, dict.lookup("residualSlip"))
{} {}
@ -57,4 +93,27 @@ Foam::dragModel::~dragModel()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModel::K() const
{
return
0.75
*Cd()
*swarmCorrection_->Cs()
*pair_.continuous().rho()
/(
max(pair_.continuous(), residualAlpha_)
*pair_.dispersed().d()
)
*max(pair_.magUr(), residualSlip_);
}
bool Foam::dragModel::writeData(Ostream& os) const
{
return os.good();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,27 +37,39 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
namespace Foam namespace Foam
{ {
class phasePair;
class swarmCorrection;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class dragModel Declaration Class dragModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class dragModel class dragModel
:
public regIOobject
{ {
protected: protected:
// Protected data // Protected data
const dictionary& interfaceDict_; //- Phase pair
const volScalarField& alpha1_; const phasePair& pair_;
const phaseModel& phase1_;
const phaseModel& phase2_; //- Swarm correction
autoPtr<swarmCorrection> swarmCorrection_;
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
//- Residual slip velocity
const dimensionedScalar residualSlip_;
public: public:
@ -74,23 +86,32 @@ public:
dragModel, dragModel,
dictionary, dictionary,
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
), ),
(interfaceDict, alpha1, phase1, phase2) (dict, pair)
); );
// Static data members
//- Coefficient dimensions
static const dimensionSet dimK;
// Constructors // Constructors
// Construct without residual constants
dragModel dragModel
( (
const dictionary& interfaceDict, const phasePair& pair
const volScalarField& alpha1, );
const phaseModel& phase1,
const phaseModel& phase2 // Construct with residual constants
dragModel
(
const dictionary& dict,
const phasePair& pair
); );
@ -102,25 +123,28 @@ public:
static autoPtr<dragModel> New static autoPtr<dragModel> New
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
// Member Functions // Member Functions
//- the dragfunction K used in the momentum eq. //- Drag coefficient
virtual tmp<volScalarField> Cd() const = 0;
//- The drag function K used in the momentum equation
// ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2) // ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2)
// ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1) // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1)
// ********************************** NB! ***************************** // ********************************** NB! *****************************
// for numerical reasons alpha1 and alpha2 has been // for numerical reasons alpha1 and alpha2 has been extracted from the
// extracted from the dragFunction K, // drag function K, so you MUST divide K by alpha1*alpha2 when
// so you MUST divide K by alpha1*alpha2 when implemnting the drag // implemnting the drag function
// function
// ********************************** NB! ***************************** // ********************************** NB! *****************************
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0; virtual tmp<volScalarField> K() const;
//- Dummy write for regIOobject
bool writeData(Ostream& os) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,26 +24,20 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "dragModel.H" #include "dragModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::dragModel> Foam::dragModel::New Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
{ {
word dragModelType word dragModelType(dict.lookup("type"));
(
interfaceDict.lookup(phase1.name())
);
Info << "Selecting dragModel for phase " Info<< "Selecting dragModel for "
<< phase1.name() << pair << ": " << dragModelType << endl;
<< ": "
<< dragModelType << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType); dictionaryConstructorTablePtr_->find(dragModelType);
@ -58,7 +52,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
<< exit(FatalError); << exit(FatalError);
} }
return cstrIter()(interfaceDict, alpha1, phase1, phase2); return cstrIter()(dict, pair);
} }

View File

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noDrag.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(noDrag, 0);
addToRunTimeSelectionTable(dragModel, noDrag, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::noDrag::noDrag
(
const dictionary& dict,
const phasePair& pair
)
:
dragModel(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::noDrag::~noDrag()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::noDrag::Cd() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"Cd",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar("Cd", dimless, 0)
)
);
}
Foam::tmp<Foam::volScalarField> Foam::dragModels::noDrag::K() const
{
return Cd()*dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0);
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::dragModels::noDrag
Description
SourceFiles
noDrag.C
\*---------------------------------------------------------------------------*/
#ifndef noDrag_H
#define noDrag_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class noDrag Declaration
\*---------------------------------------------------------------------------*/
class noDrag
:
public dragModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and a phase pair
noDrag
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noDrag();
// Member Functions
//- Drag coefficient
virtual tmp<volScalarField> Cd() const;
//- The drag function used in the momentum equation
virtual tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "segregated.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
#include "fvc.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(segregated, 0);
addToRunTimeSelectionTable(dragModel, segregated, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::segregated::segregated
(
const dictionary& dict,
const phasePair& pair
)
:
dragModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe")),
m_("m", dimless, dict.lookup("m")),
n_("n", dimless, dict.lookup("n"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::segregated::~segregated()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::Cd() const
{
FatalErrorIn("Foam::dragModels::segregated::Cd() const")
<< "Not implemented."
<< "Drag coefficient not defined for the segregated model."
<< exit(FatalError);
return pair_.phase1();
}
Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
{
const fvMesh& mesh(pair_.phase1().mesh());
const volScalarField& alpha1(pair_.phase1());
const volScalarField& alpha2(pair_.phase2());
const volScalarField& rho1(pair_.phase1().rho());
const volScalarField& rho2(pair_.phase2().rho());
tmp<volScalarField> tnu1(pair_.phase1().nu());
tmp<volScalarField> tnu2(pair_.phase2().nu());
const volScalarField& nu1(tnu1());
const volScalarField& nu2(tnu2());
volScalarField L
(
IOobject
(
"L",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar("L", dimLength, 0),
zeroGradientFvPatchField<scalar>::typeName
);
L.internalField() = cbrt(mesh.V());
L.correctBoundaryConditions();
volScalarField I
(
alpha1
/max
(
alpha1 + alpha2,
residualAlpha_
)
);
volScalarField magGradI
(
max
(
mag(fvc::grad(I)),
residualAlpha_/L
)
);
volScalarField muI
(
rho1*nu1*rho2*nu2
/(rho1*nu1 + rho2*nu2)
);
volScalarField muAlphaI
(
alpha1*rho1*nu1*alpha2*rho2*nu2
/(alpha1*rho1*nu1 + alpha2*rho2*nu2)
);
volScalarField ReI
(
max
(
pair_.rho()
*pair_.magUr()
/(
magGradI
*max(alpha1*alpha2, sqr(residualAlpha_))
*muI
),
residualRe_
)
);
volScalarField lambda(m_*ReI + n_*muAlphaI/muI);
return lambda*sqr(magGradI)*muI;
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::dragModels::segregated
Description
Segregated drag model for use in regions with no obvious dispersed phase.
Reference:
\verbatim
"Towards the Numerical Simulation of Multi-scale Two-phase Flows"
H Marschall
PhD Thesis, TU München, 2011
\endverbatim
SourceFiles
segregated.C
\*---------------------------------------------------------------------------*/
#ifndef segregated_H
#define segregated_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class segregated Declaration
\*---------------------------------------------------------------------------*/
class segregated
:
public dragModel
{
private:
// Private data
//- Residual reynolds number
const dimensionedScalar residualRe_;
//- M coefficient
const dimensionedScalar m_;
//- N coefficient
const dimensionedScalar n_;
public:
//- Runtime type information
TypeName("segregated");
// Constructors
//- Construct from components
segregated
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~segregated();
// Member Functions
//- Drag coefficient
virtual tmp<volScalarField> Cd() const;
//- The drag function used in the momentum equation
virtual tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "RanzMarshall.H" #include "RanzMarshall.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace heatTransferModels namespace heatTransferModels
{ {
defineTypeNameAndDebug(RanzMarshall, 0); defineTypeNameAndDebug(RanzMarshall, 0);
addToRunTimeSelectionTable(heatTransferModel, RanzMarshall, dictionary);
addToRunTimeSelectionTable
(
heatTransferModel,
RanzMarshall,
dictionary
);
} }
} }
@ -48,13 +43,12 @@ namespace heatTransferModels
Foam::heatTransferModels::RanzMarshall::RanzMarshall Foam::heatTransferModels::RanzMarshall::RanzMarshall
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
heatTransferModel(interfaceDict, alpha1, phase1, phase2) heatTransferModel(dict, pair),
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
{} {}
@ -66,16 +60,13 @@ Foam::heatTransferModels::RanzMarshall::~RanzMarshall()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::heatTransferModels::RanzMarshall::K Foam::tmp<Foam::volScalarField>
( Foam::heatTransferModels::RanzMarshall::K() const
const volScalarField& Ur
) const
{ {
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); volScalarField Re(pair_.Re() + residualRe_);
volScalarField Prb(phase2_.rho()*phase2_.nu()*phase2_.Cp()/phase2_.kappa()); volScalarField Nu(scalar(2) + 0.6*sqrt(Re)*cbrt(pair_.Pr()));
volScalarField Nu(scalar(2) + 0.6*sqrt(Re)*cbrt(Prb));
return 6.0*phase2_.kappa()*Nu/sqr(phase1_.d()); return 6.0*pair_.continuous().kappa()*Nu/sqr(pair_.dispersed().d());
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,6 +40,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace heatTransferModels namespace heatTransferModels
{ {
@ -51,6 +54,13 @@ class RanzMarshall
: :
public heatTransferModel public heatTransferModel
{ {
private:
// Private data
//- Residual Reynolds number
const dimensionedScalar residualRe_;
public: public:
@ -63,10 +73,8 @@ public:
//- Construct from components //- Construct from components
RanzMarshall RanzMarshall
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -76,7 +84,8 @@ public:
// Member Functions // Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const; //- The heat transfer function K used in the enthalpy equation
tmp<volScalarField> K() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "heatTransferModel.H" #include "heatTransferModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,21 +34,18 @@ namespace Foam
defineRunTimeSelectionTable(heatTransferModel, dictionary); defineRunTimeSelectionTable(heatTransferModel, dictionary);
} }
const Foam::dimensionSet Foam::heatTransferModel::dimK(1, -1, -3, -1, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModel::heatTransferModel Foam::heatTransferModel::heatTransferModel
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
interfaceDict_(interfaceDict), pair_(pair)
alpha1_(alpha1),
phase1_(phase1),
phase2_(phase2)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,7 +28,6 @@ Description
SourceFiles SourceFiles
heatTransferModel.C heatTransferModel.C
newHeatTransferModel.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -37,13 +36,15 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
namespace Foam namespace Foam
{ {
class phasePair;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class heatTransferModel Declaration Class heatTransferModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -54,10 +55,8 @@ protected:
// Protected data // Protected data
const dictionary& interfaceDict_; //- Phase pair
const volScalarField& alpha1_; const phasePair& pair_;
const phaseModel& phase1_;
const phaseModel& phase2_;
public: public:
@ -74,23 +73,26 @@ public:
heatTransferModel, heatTransferModel,
dictionary, dictionary,
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
), ),
(interfaceDict, alpha1, phase1, phase2) (dict, pair)
); );
// Static data members
//- Coefficient dimensions
static const dimensionSet dimK;
// Constructors // Constructors
//- Construct froma dictionary and a phase pair
heatTransferModel heatTransferModel
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -102,25 +104,22 @@ public:
static autoPtr<heatTransferModel> New static autoPtr<heatTransferModel> New
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
// Member Functions // Member Functions
//- the heat-transfer function K used in the enthalpy eq. //- The heat transfer function K used in the enthalpy equation
// ddt(alpha1*rho1*ha) + ... = ... alpha1*alpha2*K*(Ta - Tb) // ddt(alpha1*rho1*ha) + ... = ... alpha1*alpha2*K*(Ta - Tb)
// ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta) // ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta)
// ********************************** NB!***************************** // ********************************** NB!*****************************
// for numerical reasons alpha1 and alpha2 has been // for numerical reasons alpha1 and alpha2 has been extracted from the
// extracted from the heat-transfer function K, // heat transfer function K, so you MUST divide K by alpha1*alpha2 when
// so you MUST divide K by alpha1*alpha2 when implementing the // implementing the heat transfer function
// heat-transfer function
// ********************************** NB!***************************** // ********************************** NB!*****************************
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0; virtual tmp<volScalarField> K() const = 0;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,26 +24,20 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "heatTransferModel.H" #include "heatTransferModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
( (
const dictionary& interfaceDict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
{ {
word heatTransferModelType word heatTransferModelType(dict.lookup("type"));
(
interfaceDict.lookup(phase1.name())
);
Info<< "Selecting heatTransferModel for phase " Info<< "Selecting heatTransferModel for "
<< phase1.name() << pair << ": " << heatTransferModelType << endl;
<< ": "
<< heatTransferModelType << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(heatTransferModelType); dictionaryConstructorTablePtr_->find(heatTransferModelType);
@ -58,7 +52,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
<< exit(FatalError); << exit(FatalError);
} }
return cstrIter()(interfaceDict, alpha1, phase1, phase2); return cstrIter()(dict, pair);
} }

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noHeatTransfer.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
defineTypeNameAndDebug(noHeatTransfer, 0);
addToRunTimeSelectionTable(heatTransferModel, noHeatTransfer, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModels::noHeatTransfer::noHeatTransfer
(
const dictionary& dict,
const phasePair& pair
)
:
heatTransferModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferModels::noHeatTransfer::~noHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::heatTransferModels::noHeatTransfer::K() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -1, -3, -1, 0), 0)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::heatTransferModels::noHeatTransfer
Description
SourceFiles
noHeatTransfer.C
\*---------------------------------------------------------------------------*/
#ifndef noHeatTransfer_H
#define noHeatTransfer_H
#include "heatTransferModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace heatTransferModels
{
/*---------------------------------------------------------------------------*\
Class noHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
class noHeatTransfer
:
public heatTransferModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and a phase pair
noHeatTransfer
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noHeatTransfer();
// Member Functions
//- The heat transfer function K used in the enthalpy equation
tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace heatTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "TomiyamaLift.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
defineTypeNameAndDebug(TomiyamaLift, 0);
addToRunTimeSelectionTable(liftModel, TomiyamaLift, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModels::TomiyamaLift::TomiyamaLift
(
const dictionary& dict,
const phasePair& pair
)
:
liftModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModels::TomiyamaLift::~TomiyamaLift()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::liftModels::TomiyamaLift::Cl() const
{
volScalarField EoH(pair_.EoH2());
volScalarField f(0.00105*pow3(EoH) - 0.0159*sqr(EoH) - 0.0204*EoH + 0.474);
return
neg(EoH - scalar(4))*min(0.288*tanh(0.121*pair_.Re()), f)
+ pos(EoH - scalar(4))*neg(EoH - scalar(10))*f
+ pos(EoH - scalar(10))*(-0.29);
}
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::liftModels::TomiyamaLift
Description
Lift model of Tomiyama et al.
Reference:
\verbatim
"Transverse migration of single bubbles in simple shear flows"
A Tomiyama, H Tamai, I Zun, S Hosokawa
Chemical Engineering Science
Volume 57, Issue 11, Pages 1849-1858, June 2002
\endverbatim
SourceFiles
TomiyamaLift.C
\*---------------------------------------------------------------------------*/
#ifndef TomiyamaLift_H
#define TomiyamaLift_H
#include "liftModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace liftModels
{
/*---------------------------------------------------------------------------*\
Class TomiyamaLift Declaration
\*---------------------------------------------------------------------------*/
class TomiyamaLift
:
public liftModel
{
public:
//- Runtime type information
TypeName("Tomiyama");
// Constructors
//- Construct from a dictionary and a phase pair
TomiyamaLift
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~TomiyamaLift();
// Member Functions
//- Lift coefficient
virtual tmp<volScalarField> Cl() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace liftModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "constantLiftCoefficient.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
defineTypeNameAndDebug(constantLiftCoefficient, 0);
addToRunTimeSelectionTable(liftModel, constantLiftCoefficient, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModels::constantLiftCoefficient::constantLiftCoefficient
(
const dictionary& dict,
const phasePair& pair
)
:
liftModel(dict, pair),
Cl_("Cl", dimless, dict.lookup("Cl"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModels::constantLiftCoefficient::~constantLiftCoefficient()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::liftModels::constantLiftCoefficient::Cl() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
Cl_
)
);
}
// ************************************************************************* //

View File

@ -22,17 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::liftModels::constantCoefficient Foam::liftModels::constantLiftCoefficient
Description Description
Constant coefficient lift model.
SourceFiles SourceFiles
constantCoefficient.C constantLiftCoefficient.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef constantCoefficient_H #ifndef constantLiftCoefficient_H
#define constantCoefficient_H #define constantLiftCoefficient_H
#include "liftModel.H" #include "liftModel.H"
@ -40,24 +41,24 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace liftModels namespace liftModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class constantCoefficient Declaration Class constantLiftCoefficient Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class constantCoefficient class constantLiftCoefficient
: :
public liftModel public liftModel
{ {
// Private data // Private data
//- Coefficient dictionary
const dictionary& coeffDict_;
//- Constant lift coefficient //- Constant lift coefficient
dimensionedScalar Cl_; const dimensionedScalar Cl_;
public: public:
@ -68,24 +69,22 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
constantCoefficient constantLiftCoefficient
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
//- Destructor //- Destructor
virtual ~constantCoefficient(); virtual ~constantLiftCoefficient();
// Member Functions // Member Functions
//- Lift force //- Lift coefficient
tmp<volVectorField> F(const volVectorField& U) const; virtual tmp<volScalarField> Cl() const;
}; };

View File

@ -24,6 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "liftModel.H" #include "liftModel.H"
#include "phasePair.H"
#include "fvc.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,21 +35,18 @@ namespace Foam
defineRunTimeSelectionTable(liftModel, dictionary); defineRunTimeSelectionTable(liftModel, dictionary);
} }
const Foam::dimensionSet Foam::liftModel::dimF(1, -2, -2, 0, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModel::liftModel Foam::liftModel::liftModel
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
dict_(dict), pair_(pair)
alpha1_(alpha1),
phase1_(phase1),
phase2_(phase2)
{} {}
@ -57,4 +56,17 @@ Foam::liftModel::~liftModel()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::liftModel::F() const
{
return
Cl()
*pair_.continuous().rho()
*(
pair_.Ur() ^ fvc::curl(pair_.continuous().U())
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,15 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
namespace Foam namespace Foam
{ {
class phasePair;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class liftModel Declaration Class liftModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -54,10 +56,8 @@ protected:
// Protected data // Protected data
const dictionary& dict_; //- Phase pair
const volScalarField& alpha1_; const phasePair& pair_;
const phaseModel& phase1_;
const phaseModel& phase2_;
public: public:
@ -75,26 +75,25 @@ public:
dictionary, dictionary,
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
), ),
(dict, alpha1, phase1, phase2) (dict, pair)
); );
// Static data members
//- Force dimensions
static const dimensionSet dimF;
// Constructors // Constructors
//- Construct null //- Construct from a dictionary and a phase pair
liftModel();
//- Construct from components
liftModel liftModel
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -107,16 +106,17 @@ public:
static autoPtr<liftModel> New static autoPtr<liftModel> New
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
// Member Functions // Member Functions
//- Lift coefficient
virtual tmp<volScalarField> Cl() const = 0;
//- Lift force //- Lift force
virtual tmp<volVectorField> F(const volVectorField& U) const = 0; virtual tmp<volVectorField> F() const;
}; };

View File

@ -24,26 +24,20 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "liftModel.H" #include "liftModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::liftModel> Foam::liftModel::New Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
{ {
word liftModelType word liftModelType(dict.lookup("type"));
(
dict.subDict(phase1.name()).lookup("type")
);
Info << "Selecting liftModel for phase " Info<< "Selecting liftModel for "
<< phase1.name() << pair << ": " << liftModelType << endl;
<< ": "
<< liftModelType << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(liftModelType); dictionaryConstructorTablePtr_->find(liftModelType);
@ -58,14 +52,7 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
<< exit(FatalError); << exit(FatalError);
} }
return return cstrIter()(dict, pair);
cstrIter()
(
dict.subDict(phase1.name()),
alpha1,
phase1,
phase2
);
} }

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "noLift.H" #include "noLift.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,13 +34,7 @@ namespace Foam
namespace liftModels namespace liftModels
{ {
defineTypeNameAndDebug(noLift, 0); defineTypeNameAndDebug(noLift, 0);
addToRunTimeSelectionTable(liftModel, noLift, dictionary);
addToRunTimeSelectionTable
(
liftModel,
noLift,
dictionary
);
} }
} }
@ -49,12 +44,10 @@ namespace liftModels
Foam::liftModels::noLift::noLift Foam::liftModels::noLift::noLift
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
liftModel(dict, alpha1, phase1, phase2) liftModel(dict, pair)
{} {}
@ -66,32 +59,39 @@ Foam::liftModels::noLift::~noLift()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const
(
const volVectorField& U
) const
{ {
const fvMesh& mesh(this->pair_.phase1().mesh());
return return
tmp<volVectorField> tmp<volScalarField>
( (
new volVectorField new volScalarField
( (
IOobject IOobject
( (
"zero", "Cl",
U.time().timeName(), mesh.time().timeName(),
U.mesh() mesh
), ),
U.mesh(), mesh,
dimensionedVector dimensionedScalar("Cl", dimless, 0)
(
"zero",
dimensionSet(1, -2, -2, 0, 0, 0, 0),
vector::zero
)
) )
); );
} }
Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const
{
return
Cl()
*dimensionedVector
(
"zero",
dimensionSet(1, -2, -2, 0, 0),
vector::zero
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -40,6 +40,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
class phasePair;
namespace liftModels namespace liftModels
{ {
@ -51,12 +54,6 @@ class noLift
: :
public liftModel public liftModel
{ {
// Private data
//- Constant lift coefficient
dimensionedScalar Cl_;
public: public:
//- Runtime type information //- Runtime type information
@ -65,13 +62,11 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from a dictionary and a phase pair
noLift noLift
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
); );
@ -81,8 +76,11 @@ public:
// Member Functions // Member Functions
//- Lift coefficient
virtual tmp<volScalarField> Cl() const;
//- Lift force //- Lift force
tmp<volVectorField> F(const volVectorField& U) const; virtual tmp<volVectorField> F() const;
}; };

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "TomiyamaSwarm.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace swarmCorrections
{
defineTypeNameAndDebug(TomiyamaSwarm, 0);
addToRunTimeSelectionTable
(
swarmCorrection,
TomiyamaSwarm,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::swarmCorrections::TomiyamaSwarm::TomiyamaSwarm
(
const dictionary& dict,
const phasePair& pair
)
:
swarmCorrection(dict, pair),
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha")),
l_("l", dimless, dict.lookup("l"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::swarmCorrections::TomiyamaSwarm::~TomiyamaSwarm()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::swarmCorrections::TomiyamaSwarm::Cs() const
{
return
pow(max(this->pair_.continuous(), residualAlpha_), scalar(3) - 2*l_);
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::TomiyamaSwarm
Description
Swarm correction of Tomiyama et al.
Reference:
\verbatim
"Drag Coefficients of Bubbles. 2nd Report. Drag Coefficient for a Swarm
of Bubbles and its Applicability to Transient Flow."
A Tomiyama, I Kataoka, T Fukuda, and T Sakaguchi
Nippon Kikai Gakkai Ronbunshu
Volume 61, Issue 588, Pages 2810-2817, 1995
\endverbatim
SourceFiles
TomiyamaSwarm.C
\*---------------------------------------------------------------------------*/
#ifndef TomiyamaSwarm_H
#define TomiyamaSwarm_H
#include "swarmCorrection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace swarmCorrections
{
/*---------------------------------------------------------------------------*\
Class TomiyamaSwarm Declaration
\*---------------------------------------------------------------------------*/
class TomiyamaSwarm
:
public swarmCorrection
{
// Private data
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
//- Constant exponent
const dimensionedScalar l_;
public:
//- Runtime type information
TypeName("Tomiyama");
// Constructors
//- Construct from a dictionary and a phase pair
TomiyamaSwarm
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~TomiyamaSwarm();
// Member Functions
//- Swarm correction coefficient
virtual tmp<volScalarField> Cs() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace swarmCorrections
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noSwarm.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace swarmCorrections
{
defineTypeNameAndDebug(noSwarm, 0);
addToRunTimeSelectionTable(swarmCorrection, noSwarm, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::swarmCorrections::noSwarm::noSwarm
(
const dictionary& dict,
const phasePair& pair
)
:
swarmCorrection(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::swarmCorrections::noSwarm::~noSwarm()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::swarmCorrections::noSwarm::Cs() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"one",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar("one", dimless, 1)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::swarmCorrections::noSwarm
Description
SourceFiles
noSwarm.C
\*---------------------------------------------------------------------------*/
#ifndef noSwarm_H
#define noSwarm_H
#include "swarmCorrection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace swarmCorrections
{
/*---------------------------------------------------------------------------*\
Class noSwarm Declaration
\*---------------------------------------------------------------------------*/
class noSwarm
:
public swarmCorrection
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and a phase pair
noSwarm
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noSwarm();
// Member Functions
//- Swarm correction coefficient
tmp<volScalarField> Cs() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace swarmCorrections
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "swarmCorrection.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::swarmCorrection>
Foam::swarmCorrection::New
(
const dictionary& dict,
const phasePair& pair
)
{
word swarmCorrectionType(dict.lookup("type"));
Info<< "Selecting swarmCorrection for "
<< pair << ": " << swarmCorrectionType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(swarmCorrectionType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("swarmCorrection::New")
<< "Unknown swarmCorrectionType type "
<< swarmCorrectionType << endl << endl
<< "Valid swarmCorrection types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "swarmCorrection.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(swarmCorrection, 0);
defineRunTimeSelectionTable(swarmCorrection, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::swarmCorrection::swarmCorrection
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::swarmCorrection::~swarmCorrection()
{}
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::swarmCorrection
Description
SourceFiles
swarmCorrection.C
newSwarmCorrection.C
\*---------------------------------------------------------------------------*/
#ifndef swarmCorrection_H
#define swarmCorrection_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class swarmCorrection Declaration
\*---------------------------------------------------------------------------*/
class swarmCorrection
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("swarmCorrection");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
swarmCorrection,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Constructors
//- Construct from a dictionary and a phase pair
swarmCorrection
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~swarmCorrection();
// Selectors
static autoPtr<swarmCorrection> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Swarm correction coefficient
virtual tmp<volScalarField> Cs() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "Gosman.H"
#include "phasePair.H"
#include "fvc.H"
#include "PhaseIncompressibleTurbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
#include "dragModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace turbulentDispersionModels
{
defineTypeNameAndDebug(Gosman, 0);
addToRunTimeSelectionTable
(
turbulentDispersionModel,
Gosman,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::Gosman::Gosman
(
const dictionary& dict,
const phasePair& pair
)
:
turbulentDispersionModel(dict, pair),
sigma_("sigma", dimless, dict.lookup("sigma"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::Gosman::~Gosman()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField>
Foam::turbulentDispersionModels::Gosman::F() const
{
const fvMesh& mesh(pair_.phase1().mesh());
const dragModel&
drag
(
mesh.lookupObject<dragModel>
(
IOobject::groupName(dragModel::typeName, pair_.name())
)
);
return
- 0.75
*drag.Cd()
*pair_.continuous().turbulence().nut()
*pair_.magUr()
/(
sigma_
*pair_.dispersed().d()
)
*pair_.continuous().rho()
*fvc::grad(pair_.dispersed());
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::Gosman
Description
Turbulent dispersion model of Gosman et al.
Reference:
\verbatim
"Multidimensional modeling of turbulent two-phase flows in stirred
vessels"
A D Gosman, C Lekakou, S Politis, R I Issa and M K Looney
AIChE Journal
Volume 38, Issue 12, Pages 1946-1956, 1992
\endverbatim
SourceFiles
Gosman.C
\*---------------------------------------------------------------------------*/
#ifndef Gosman_H
#define Gosman_H
#include "turbulentDispersionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace turbulentDispersionModels
{
/*---------------------------------------------------------------------------*\
Class Gosman Declaration
\*---------------------------------------------------------------------------*/
class Gosman
:
public turbulentDispersionModel
{
// Private data
//- Schmidt number
const dimensionedScalar sigma_;
public:
//- Runtime type information
TypeName("Gosman");
// Constructors
//- Construct from a dictionary and a phase pair
Gosman
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Gosman();
// Member Functions
//- Turbulent dispersion force
virtual tmp<volVectorField> F() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulentDispersionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "constantTurbulentDispersionCoefficient.H"
#include "phasePair.H"
#include "fvc.H"
#include "PhaseIncompressibleTurbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace turbulentDispersionModels
{
defineTypeNameAndDebug(constantTurbulentDispersionCoefficient, 0);
addToRunTimeSelectionTable
(
turbulentDispersionModel,
constantTurbulentDispersionCoefficient,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient::
constantTurbulentDispersionCoefficient
(
const dictionary& dict,
const phasePair& pair
)
:
turbulentDispersionModel(dict, pair),
Ctd_("Ctd", dimless, dict.lookup("Ctd"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient::
~constantTurbulentDispersionCoefficient()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField>
Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient::
F() const
{
return
- Ctd_
*pair_.continuous().rho()
*pair_.continuous().turbulence().k()
*fvc::grad(pair_.dispersed());
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::constantTurbulentDispersionCoefficient
Description
Constant coefficient turbulent dispersion model.
SourceFiles
constantTurbulentDispersionCoefficient.C
\*---------------------------------------------------------------------------*/
#ifndef constantTurbulentDispersionCoefficient_H
#define constantTurbulentDispersionCoefficient_H
#include "turbulentDispersionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace turbulentDispersionModels
{
/*---------------------------------------------------------------------------*\
Class constantTurbulentDispersionCoefficient Declaration
\*---------------------------------------------------------------------------*/
class constantTurbulentDispersionCoefficient
:
public turbulentDispersionModel
{
// Private data
//- Constant turbulent dispersion coefficient
const dimensionedScalar Ctd_;
public:
//- Runtime type information
TypeName("constantCoefficient");
// Constructors
//- Construct from a dictionary and a phase pair
constantTurbulentDispersionCoefficient
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~constantTurbulentDispersionCoefficient();
// Member Functions
//- Turbulent dispersion force
virtual tmp<volVectorField> F() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulentDispersionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noTurbulentDispersion.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace turbulentDispersionModels
{
defineTypeNameAndDebug(noTurbulentDispersion, 0);
addToRunTimeSelectionTable
(
turbulentDispersionModel,
noTurbulentDispersion,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::noTurbulentDispersion::noTurbulentDispersion
(
const dictionary& dict,
const phasePair& pair
)
:
turbulentDispersionModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::turbulentDispersionModels::noTurbulentDispersion::
~noTurbulentDispersion()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField>
Foam::turbulentDispersionModels::noTurbulentDispersion::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volVectorField>
(
new volVectorField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedVector
(
"zero",
dimensionSet(1, -2, -2, 0, 0),
vector::zero
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::noTurbulentDispersion
Description
SourceFiles
noTurbulentDispersion.C
\*---------------------------------------------------------------------------*/
#ifndef noTurbulentDispersion_H
#define noTurbulentDispersion_H
#include "turbulentDispersionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace turbulentDispersionModels
{
/*---------------------------------------------------------------------------*\
Class noTurbulentDispersion Declaration
\*---------------------------------------------------------------------------*/
class noTurbulentDispersion
:
public turbulentDispersionModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and a phase pair
noTurbulentDispersion
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noTurbulentDispersion();
// Member Functions
//- Turbulent dispersion force
virtual tmp<volVectorField> F() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulentDispersionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "turbulentDispersionModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::turbulentDispersionModel>
Foam::turbulentDispersionModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
word turbulentDispersionModelType(dict.lookup("type"));
Info<< "Selecting turbulentDispersionModel for "
<< pair << ": " << turbulentDispersionModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(turbulentDispersionModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("turbulentDispersionModel::New")
<< "Unknown turbulentDispersionModelType type "
<< turbulentDispersionModelType << endl << endl
<< "Valid turbulentDispersionModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "turbulentDispersionModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(turbulentDispersionModel, 0);
defineRunTimeSelectionTable(turbulentDispersionModel, dictionary);
}
const Foam::dimensionSet Foam::turbulentDispersionModel::dimF(1, -2, -2, 0, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::turbulentDispersionModel::turbulentDispersionModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::turbulentDispersionModel::~turbulentDispersionModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::turbulentDispersionModel
Description
SourceFiles
turbulentDispersionModel.C
newTurbulentDispersionModel.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentDispersionModel_H
#define turbulentDispersionModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class turbulentDispersionModel Declaration
\*---------------------------------------------------------------------------*/
class turbulentDispersionModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("turbulentDispersionModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
turbulentDispersionModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Static data members
//- Force dimensions
static const dimensionSet dimF;
// Constructors
//- Construct from a dictionary and a phase pair
turbulentDispersionModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~turbulentDispersionModel();
// Selectors
static autoPtr<turbulentDispersionModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Turbulent dispersion force
virtual tmp<volVectorField> F() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,22 +23,21 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "constantCoefficient.H" #include "Lamb.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvc.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace liftModels namespace virtualMassModels
{ {
defineTypeNameAndDebug(constantCoefficient, 0); defineTypeNameAndDebug(Lamb, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
liftModel, virtualMassModel,
constantCoefficient, Lamb,
dictionary dictionary
); );
} }
@ -47,40 +46,32 @@ namespace liftModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModels::constantCoefficient::constantCoefficient Foam::virtualMassModels::Lamb::Lamb
( (
const dictionary& dict, const dictionary& dict,
const volScalarField& alpha1, const phasePair& pair
const phaseModel& phase1,
const phaseModel& phase2
) )
: :
liftModel(dict, alpha1, phase1, phase2), virtualMassModel(dict, pair)
coeffDict_(dict.subDict(typeName + "Coeffs")),
Cl_("Cl", dimless, coeffDict_.lookup("Cl"))
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModels::constantCoefficient::~constantCoefficient() Foam::virtualMassModels::Lamb::~Lamb()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::liftModels::constantCoefficient::F Foam::tmp<Foam::volScalarField> Foam::virtualMassModels::Lamb::Cvm() const
(
const volVectorField& U
) const
{ {
volScalarField E(min(max(pair_.E(), SMALL), 1 - SMALL));
volScalarField rtOmEsq(sqrt(1 - sqr(E)));
return return
Cl_ (rtOmEsq - E*acos(E))
*(phase1_*phase1_.rho() + phase2_*phase2_.rho()) /(E*acos(E) - sqr(E)*rtOmEsq);
*(
(phase1_.U() - phase2_.U())
^ fvc::curl(U)
);
} }

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::virtualMassModels::Lamb
Description
Virtual mass model of Lamb.
Reference:
\verbatim
"Hydrodynamics"
H Lamb
Cambridge University Press, 1895
\endverbatim
SourceFiles
Lamb.C
\*---------------------------------------------------------------------------*/
#ifndef Lamb_H
#define Lamb_H
#include "virtualMassModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace virtualMassModels
{
/*---------------------------------------------------------------------------*\
Class Lamb Declaration
\*---------------------------------------------------------------------------*/
class Lamb
:
public virtualMassModel
{
public:
//- Runtime type information
TypeName("Lamb");
// Constructors
//- Construct from a dictionary and a phase pair
Lamb
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Lamb();
// Member Functions
//- Virtual mass coefficient
virtual tmp<volScalarField> Cvm() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace virtualMassModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "constantVirtualMassCoefficient.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace virtualMassModels
{
defineTypeNameAndDebug(constantVirtualMassCoefficient, 0);
addToRunTimeSelectionTable
(
virtualMassModel,
constantVirtualMassCoefficient,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::virtualMassModels::constantVirtualMassCoefficient::
constantVirtualMassCoefficient
(
const dictionary& dict,
const phasePair& pair
)
:
virtualMassModel(dict, pair),
Cvm_("Cvm", dimless, dict.lookup("Cvm"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::virtualMassModels::constantVirtualMassCoefficient::
~constantVirtualMassCoefficient()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
Cvm_
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::virtualMassModels::constantVirtualMassCoefficient
Description
Constant coefficient virtual mass model.
SourceFiles
constantVirtualMassCoefficient.C
\*---------------------------------------------------------------------------*/
#ifndef constantVirtualMassCoefficient_H
#define constantVirtualMassCoefficient_H
#include "virtualMassModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace virtualMassModels
{
/*---------------------------------------------------------------------------*\
Class constantVirtualMassCoefficient Declaration
\*---------------------------------------------------------------------------*/
class constantVirtualMassCoefficient
:
public virtualMassModel
{
private:
// Private data
//- Constant virtual mass coefficient
const dimensionedScalar Cvm_;
public:
//- Runtime type information
TypeName("constantCoefficient");
// Constructors
//- Construct from a dictionary and a phase pair
constantVirtualMassCoefficient
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~constantVirtualMassCoefficient();
// Member Functions
//- Virtual mass coefficient
virtual tmp<volScalarField> Cvm() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace virtualMassModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noVirtualMass.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace virtualMassModels
{
defineTypeNameAndDebug(noVirtualMass, 0);
addToRunTimeSelectionTable(virtualMassModel, noVirtualMass, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::virtualMassModels::noVirtualMass::noVirtualMass
(
const dictionary& dict,
const phasePair& pair
)
:
virtualMassModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::virtualMassModels::noVirtualMass::~noVirtualMass()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::virtualMassModels::noVirtualMass::Cvm() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar("zero", dimless, 0)
)
);
}
Foam::tmp<Foam::volScalarField>
Foam::virtualMassModels::noVirtualMass::K() const
{
return Cvm()*dimensionedScalar("zero", dimDensity, 0);
}
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::virtualMassModels::noVirtualMass
Description
SourceFiles
noVirtualMass.C
\*---------------------------------------------------------------------------*/
#ifndef noVirtualMass_H
#define noVirtualMass_H
#include "virtualMassModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace virtualMassModels
{
/*---------------------------------------------------------------------------*\
Class noVirtualMass Declaration
\*---------------------------------------------------------------------------*/
class noVirtualMass
:
public virtualMassModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and a phase pair
noVirtualMass
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noVirtualMass();
// Member Functions
//- Virtual mass coefficient
virtual tmp<volScalarField> Cvm() const;
virtual tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace virtualMassModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "virtualMassModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
word virtualMassModelType(dict.lookup("type"));
Info<< "Selecting virtualMassModel for "
<< pair << ": " << virtualMassModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(virtualMassModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("virtualMassModel::New")
<< "Unknown virtualMassModelType type "
<< virtualMassModelType << endl << endl
<< "Valid virtualMassModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,81 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "virtualMassModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(virtualMassModel, 0);
defineRunTimeSelectionTable(virtualMassModel, dictionary);
}
const Foam::dimensionSet Foam::virtualMassModel::dimK(dimDensity);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::virtualMassModel::virtualMassModel
(
const dictionary& dict,
const phasePair& pair
)
:
regIOobject
(
IOobject
(
IOobject::groupName(typeName, pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
)
),
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::virtualMassModel::~virtualMassModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::virtualMassModel::K() const
{
return Cvm()*pair_.continuous().rho();
}
bool Foam::virtualMassModel::writeData(Ostream& os) const
{
return os.good();
}
// ************************************************************************* //

View File

@ -0,0 +1,143 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::virtualMassModel
Description
SourceFiles
virtualMassModel.C
newVirtualMassModel.C
\*---------------------------------------------------------------------------*/
#ifndef virtualMassModel_H
#define virtualMassModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class virtualMassModel Declaration
\*---------------------------------------------------------------------------*/
class virtualMassModel
:
public regIOobject
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("virtualMassModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
virtualMassModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Static data members
//- Coefficient dimensions
static const dimensionSet dimK;
// Constructors
//- Construct from a dictionary and a phase pair
virtualMassModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~virtualMassModel();
// Selectors
static autoPtr<virtualMassModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Virtual mass coefficient
virtual tmp<volScalarField> Cvm() const = 0;
//- The virtual mass function K used in the momentum equation
// ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt)
// ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt)
// ********************************** NB! *****************************
// for numerical reasons alpha1 and alpha2 has been extracted from the
// virtual mass function K, so you MUST divide K by alpha1*alpha2 when
// implemnting the virtual mass function
// ********************************** NB! *****************************
virtual tmp<volScalarField> K() const;
// Dummy write for regIOobject
bool writeData(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "Antal.H"
#include "phasePair.H"
#include "fvc.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace wallLubricationModels
{
defineTypeNameAndDebug(Antal, 0);
addToRunTimeSelectionTable
(
wallLubricationModel,
Antal,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallLubricationModels::Antal::Antal
(
const dictionary& dict,
const phasePair& pair
)
:
wallLubricationModel(dict, pair),
Cw1_("Cw1", dimless, dict.lookup("Cw1")),
Cw2_("Cw2", dimless, dict.lookup("Cw2"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::wallLubricationModels::Antal::~Antal()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Antal::F() const
{
volVectorField Ur(pair_.Ur());
volVectorField nWall(- fvc::grad(yWall_));
nWall /= mag(nWall) + SMALL;
return
max
(
dimensionedScalar("zero", dimless/dimLength, 0),
Cw1_/pair_.dispersed().d() + Cw2_/yWall_
)
*pair_.continuous().rho()
*magSqr(Ur - (Ur & nWall)*nWall)
*nWall;
}
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::wallLubricationModels::Antal
Description
Wall lubrication model of Antal et al.
Reference:
\verbatim
"Analysis of phase distribution in fully developed laminar bubbly
two-phase flow"
S P Antal, R T Lahey Jr and J E Flaherty
International Journal of Multiphase Flow
Volume 17, Issue 5, Pages 635-652, September 1991
\endverbatim
SourceFiles
Antal.C
\*---------------------------------------------------------------------------*/
#ifndef Antal_H
#define Antal_H
#include "wallLubricationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace wallLubricationModels
{
/*---------------------------------------------------------------------------*\
Class Antal Declaration
\*---------------------------------------------------------------------------*/
class Antal
:
public wallLubricationModel
{
private:
// Private data
//- Coefficient 1
const dimensionedScalar Cw1_;
//- Coefficient 2
const dimensionedScalar Cw2_;
public:
//- Runtime type information
TypeName("Antal");
// Constructors
//- Construct from components
Antal
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Antal();
// Member Functions
//- Wall lubrication force
tmp<volVectorField> F() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace wallLubricationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noWallLubrication.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace wallLubricationModels
{
defineTypeNameAndDebug(noWallLubrication, 0);
addToRunTimeSelectionTable
(
wallLubricationModel,
noWallLubrication,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallLubricationModels::noWallLubrication::noWallLubrication
(
const dictionary& dict,
const phasePair& pair
)
:
wallLubricationModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::wallLubricationModels::noWallLubrication::~noWallLubrication()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField>
Foam::wallLubricationModels::noWallLubrication::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volVectorField>
(
new volVectorField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedVector
(
"zero",
dimensionSet(1, -2, -2, 0, 0),
vector::zero
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::wallLubricationModels::noWallLubrication
Description
SourceFiles
noWallLubrication.C
\*---------------------------------------------------------------------------*/
#ifndef noWallLubrication_H
#define noWallLubrication_H
#include "wallLubricationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace wallLubricationModels
{
/*---------------------------------------------------------------------------*\
Class noWallLubrication Declaration
\*---------------------------------------------------------------------------*/
class noWallLubrication
:
public wallLubricationModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
noWallLubrication
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~noWallLubrication();
// Member Functions
//- Wall lubrication force
tmp<volVectorField> F() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace wallLubricationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "wallLubricationModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
word wallLubricationModelType(dict.lookup("type"));
Info<< "Selecting wallLubricationModel for "
<< pair << ": " << wallLubricationModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(wallLubricationModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("wallLubricationModel::New")
<< "Unknown wallLubricationModelType type "
<< wallLubricationModelType << endl << endl
<< "Valid wallLubricationModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "wallLubricationModel.H"
#include "phasePair.H"
const Foam::dimensionSet Foam::wallLubricationModel::dimF(1, -2, -2, 0, 0);
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(wallLubricationModel, 0);
defineRunTimeSelectionTable(wallLubricationModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallLubricationModel::wallLubricationModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair),
yWall_(pair.phase1().mesh().lookupObject<volScalarField>("yWall"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::wallLubricationModel::~wallLubricationModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::wallLubricationModel
Description
SourceFiles
wallLubricationModel.C
newWallLubricationModel.C
\*---------------------------------------------------------------------------*/
#ifndef wallLubricationModel_H
#define wallLubricationModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class wallLubricationModel Declaration
\*---------------------------------------------------------------------------*/
class wallLubricationModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
//- Wall distance
const volScalarField& yWall_;
public:
//- Runtime type information
TypeName("wallLubricationModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
wallLubricationModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Static data members
//- Coefficient dimensions
static const dimensionSet dimF;
// Constructors
//- Construct from components
wallLubricationModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~wallLubricationModel();
// Selectors
static autoPtr<wallLubricationModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Wall lubrication force
virtual tmp<volVectorField> F() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -100,6 +100,12 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
dimless, dimless,
this->coeffDict_.lookup("alphaMinFriction") this->coeffDict_.lookup("alphaMinFriction")
), ),
residualAlpha_
(
"residualAlpha",
dimless,
this->coeffDict_.lookup("residualAlpha")
),
Theta_ Theta_
( (
@ -384,7 +390,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
volScalarField gammaCoeff volScalarField gammaCoeff
( (
12.0*(1.0 - sqr(e_)) 12.0*(1.0 - sqr(e_))
*max(sqr(alpha), phase_.fluid().residualPhaseFraction()) *max(sqr(alpha), residualAlpha_)
*gs0*(1.0/da)*ThetaSqrt/sqrtPi *gs0*(1.0/da)*ThetaSqrt/sqrtPi
); );
@ -398,12 +404,9 @@ void Foam::RASModels::kineticTheoryModel::correct()
max max
( (
alpha*(1.0 - alpha), alpha*(1.0 - alpha),
phase_.fluid().residualPhaseFraction() residualAlpha_
) )
*phase_.fluid().drag(phase_).K *phase_.fluid().drag(phase_).K()/rho
(
magUr + phase_.fluid().residualSlip()
)/rho
); );
// Eq. 3.25, p. 50 Js = J1 - J2 // Eq. 3.25, p. 50 Js = J1 - J2
@ -412,7 +415,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
( (
0.25*sqr(alpha2Prim)*da*sqr(magUr) 0.25*sqr(alpha2Prim)*da*sqr(magUr)
/( /(
max(alpha, phase_.fluid().residualPhaseFraction()) max(alpha, residualAlpha_)
*sqrtPi*(ThetaSqrt + ThetaSmallSqrt) *sqrtPi*(ThetaSqrt + ThetaSmallSqrt)
) )
); );
@ -483,7 +486,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
volScalarField trD volScalarField trD
( (
alpha/(alpha + phase_.fluid().residualPhaseFraction()) alpha/(alpha + residualAlpha_)
*fvc::div(this->phi_) *fvc::div(this->phi_)
); );
volScalarField tr2D(sqr(trD)); volScalarField tr2D(sqr(trD));
@ -503,7 +506,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
Theta_ = sqr Theta_ = sqr
( (
(l1 + sqrt(l2 + l3)) (l1 + sqrt(l2 + l3))
/(2.0*max(alpha, phase_.fluid().residualPhaseFraction())*K4) /(2.0*max(alpha, residualAlpha_)*K4)
); );
} }

View File

@ -82,9 +82,6 @@ class kineticTheoryModel
const phaseModel& phase_; const phaseModel& phase_;
////- Drag model
//const dragModel& draga_;
// Sub-models // Sub-models
//- Run-time selected viscosity model //- Run-time selected viscosity model
@ -119,6 +116,9 @@ class kineticTheoryModel
//- Min value for which the frictional stresses are zero //- Min value for which the frictional stresses are zero
dimensionedScalar alphaMinFriction_; dimensionedScalar alphaMinFriction_;
//- Residual phase fraction
dimensionedScalar residualAlpha_;
// Kinetic Theory Model Fields // Kinetic Theory Model Fields

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "PhaseIncompressibleTurbulenceModel.H" #include "PhaseIncompressibleTurbulenceModel.H"
#include "phaseModel.H" #include "phaseModel.H"
#include "twoPhaseSystem.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H" #include "makeTurbulenceModel.H"
@ -76,12 +77,10 @@ makeLESModel(NicenoKEqn);
#include "continuousGasKEqn.H" #include "continuousGasKEqn.H"
makeLESModel(continuousGasKEqn); makeLESModel(continuousGasKEqn);
#include "kineticTheoryModel.H" #include "kineticTheoryModel.H"
makeTurbulenceModel makeTurbulenceModel
(phaseModelPhaseIncompressibleTurbulenceModel, RAS, kineticTheoryModel); (phaseModelPhaseIncompressibleTurbulenceModel, RAS, kineticTheoryModel);
#include "phasePressureModel.H" #include "phasePressureModel.H"
makeTurbulenceModel makeTurbulenceModel
(phaseModelPhaseIncompressibleTurbulenceModel, RAS, phasePressureModel); (phaseModelPhaseIncompressibleTurbulenceModel, RAS, phasePressureModel);

View File

@ -1,31 +0,0 @@
IOdictionary ppProperties
(
IOobject
(
"ppProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
scalar preAlphaExp
(
readScalar(ppProperties.lookup("preAlphaExp"))
);
scalar alphaMax
(
readScalar(ppProperties.lookup("alphaMax"))
);
scalar expMax
(
readScalar(ppProperties.lookup("expMax"))
);
dimensionedScalar g0
(
ppProperties.lookup("g0")
);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,8 +33,6 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "twoPhaseSystem.H" #include "twoPhaseSystem.H"
#include "PhaseIncompressibleTurbulenceModel.H" #include "PhaseIncompressibleTurbulenceModel.H"
#include "dragModel.H"
#include "heatTransferModel.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "IOMRFZoneList.H" #include "IOMRFZoneList.H"
#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedFluxPressureFvPatchScalarField.H"

View File

@ -0,0 +1,241 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "BlendedInterfacialModel.H"
#include "fixedValueFvsPatchFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class modelType>
template<class Type>
void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs
(
GeometricField<Type, fvPatchField, volMesh>& field
) const
{
forAll(pair_.phase1().phi().boundaryField(), patchI)
{
if
(
isA<fixedValueFvsPatchScalarField>
(
pair_.phase1().phi().boundaryField()[patchI]
)
)
{
field.boundaryField()[patchI] = pTraits<Type>::zero;
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class modelType>
Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
(
const phasePair::dictTable& modelTable,
const blendingMethod& blending,
const phasePair& pair,
const orderedPhasePair& pair1In2,
const orderedPhasePair& pair2In1
)
:
pair_(pair),
pair1In2_(pair1In2),
pair2In1_(pair2In1),
blending_(blending)
{
if (modelTable.found(pair_))
{
model_.set
(
modelType::New
(
modelTable[pair_],
pair_
).ptr()
);
}
if (modelTable.found(pair1In2_))
{
model1In2_.set
(
modelType::New
(
modelTable[pair1In2_],
pair1In2_
).ptr()
);
}
if (modelTable.found(pair2In1_))
{
model2In1_.set
(
modelType::New
(
modelTable[pair2In1_],
pair2In1_
).ptr()
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class modelType>
Foam::BlendedInterfacialModel<modelType>::~BlendedInterfacialModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class modelType>
Foam::tmp<Foam::volScalarField>
Foam::BlendedInterfacialModel<modelType>::K() const
{
tmp<volScalarField> f1, f2;
if (model_.valid() || model1In2_.valid())
{
f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed());
}
if (model_.valid() || model2In1_.valid())
{
f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed());
}
tmp<volScalarField> x
(
new volScalarField
(
IOobject
(
modelType::typeName + "Coeff",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh()
),
pair_.phase1().mesh(),
dimensionedScalar("zero", modelType::dimK, 0)
)
);
if (model_.valid())
{
x() += model_->K()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->K()*(1 - f1);
}
if (model2In1_.valid())
{
x() += model2In1_->K()*f2;
}
if (model_.valid() || model1In2_.valid() || model2In1_.valid())
{
x() *= max(pair_.phase1()*pair_.phase2(), blending_.residualAlpha());
correctFixedFluxBCs(x());
}
return x;
}
template<class modelType>
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::BlendedInterfacialModel<modelType>::F() const
{
tmp<volScalarField> f1, f2;
if (model_.valid() || model1In2_.valid())
{
f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed());
}
if (model_.valid() || model2In1_.valid())
{
f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed());
}
tmp<GeometricField<Type, fvPatchField, volMesh> > x
(
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
modelType::typeName + "Coeff",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh()
),
pair_.phase1().mesh(),
dimensioned<Type>("zero", modelType::dimF, pTraits<Type>::zero)
)
);
if (model_.valid())
{
x() += model_->F()*(f1() - f2());
}
if (model1In2_.valid())
{
x() += model1In2_->F()*(1 - f1);
}
if (model2In1_.valid())
{
x() -= model2In1_->F()*f2; // note : subtraction
}
if (model_.valid() || model1In2_.valid() || model2In1_.valid())
{
correctFixedFluxBCs(x());
}
return x;
}
template<class modelType>
const modelType& Foam::BlendedInterfacialModel<modelType>::phaseModel
(
const class phaseModel& phase
) const
{
return &phase == &(pair_.phase1()) ? model1In2_ : model2In1_;
}
// ************************************************************************* //

View File

@ -0,0 +1,144 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::BlendedInterfacialModel
Description
SourceFiles
BlendedInterfacialModel.C
\*---------------------------------------------------------------------------*/
#ifndef BlendedInterfacialModel_H
#define BlendedInterfacialModel_H
#include "blendingMethod.H"
#include "phasePair.H"
#include "orderedPhasePair.H"
#include "geometricZeroField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class BlendedInterfacialModel Declaration
\*---------------------------------------------------------------------------*/
template<class modelType>
class BlendedInterfacialModel
{
private:
// Private data
//- Unordered phase pair
const phasePair& pair_;
//- Ordered phase pair for dispersed phase 1 in continuous phase 2
const orderedPhasePair& pair1In2_;
//- Ordered phase pair for dispersed phase 2 in continuous phase 1
const orderedPhasePair& pair2In1_;
//- Model for region with no obvious dispersed phase
autoPtr<modelType> model_;
//- Model for dispersed phase 1 in continuous phase 2
autoPtr<modelType> model1In2_;
//- Model for dispersed phase 2 in continuous phase 1
autoPtr<modelType> model2In1_;
//- Blending model
const blendingMethod& blending_;
// Private Member Functions
//- Disallow default bitwise copy construct
BlendedInterfacialModel(const BlendedInterfacialModel<modelType>&);
//- Disallow default bitwise assignment
void operator=(const BlendedInterfacialModel<modelType>&);
//- Correct coeff/value on fixed flux boundary conditions
template<class Type>
void correctFixedFluxBCs
(
GeometricField<Type, fvPatchField, volMesh>& field
) const;
public:
// Constructors
//- Construct from the model table, dictionary and pairs
BlendedInterfacialModel
(
const phasePair::dictTable& modelTable,
const blendingMethod& blending,
const phasePair& pair,
const orderedPhasePair& pair1In2,
const orderedPhasePair& pair2In1
);
//- Destructor
~BlendedInterfacialModel();
// Member Functions
//- Return the implicit coefficient
tmp<volScalarField> K() const;
//- Return the explicit value
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > F() const;
//- Return the model for the supplied phase
const modelType& phaseModel(const phaseModel& phase) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "BlendedInterfacialModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "blendingMethod.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(blendingMethod, 0);
defineRunTimeSelectionTable(blendingMethod, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::blendingMethod::blendingMethod
(
const dictionary& dict
)
:
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::blendingMethod::~blendingMethod()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::dimensionedScalar& Foam::blendingMethod::residualAlpha() const
{
return residualAlpha_;
}
// ************************************************************************* //

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::blendingMethod
Description
SourceFiles
blendingMethod.C
\*---------------------------------------------------------------------------*/
#ifndef blendingMethod_H
#define blendingMethod_H
#include "dictionary.H"
#include "runTimeSelectionTables.H"
#include "phaseModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class blendingMethod Declaration
\*---------------------------------------------------------------------------*/
class blendingMethod
{
protected:
// Protected data
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
public:
//- Runtime type information
TypeName("blendingMethod");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
blendingMethod,
dictionary,
(
const dictionary& dict,
const wordList& phaseNames
),
(dict, phaseNames)
);
// Constructors
//- Construct from a dictionary
blendingMethod
(
const dictionary& dict
);
// Selector
static autoPtr<blendingMethod> New
(
const dictionary& dict,
const wordList& phaseNames
);
//- Destructor
virtual ~blendingMethod();
// Member Functions
//- Residual phase fraction
const dimensionedScalar& residualAlpha() const;
//- Factor for first phase
virtual tmp<volScalarField> f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const = 0;
//- Factor for second phase
virtual tmp<volScalarField> f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "blendingMethod.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New
(
const dictionary& dict,
const wordList& phaseNames
)
{
word blendingMethodType(dict.lookup("type"));
Info<< "Selecting " << dict.dictName() << " blending method: "
<< blendingMethodType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(blendingMethodType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("blendingMethod::New")
<< "Unknown blendingMethodType type "
<< blendingMethodType << endl << endl
<< "Valid blendingMethod types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, phaseNames);
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "hyperbolic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
defineTypeNameAndDebug(hyperbolic, 0);
addToRunTimeSelectionTable
(
blendingMethod,
hyperbolic,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::blendingMethods::hyperbolic::hyperbolic
(
const dictionary& dict,
const wordList& phaseNames
)
:
blendingMethod(dict),
transitionAlphaScale_
(
"transitionAlphaScale",
dimless,
dict.lookup("transitionAlphaScale")
)
{
forAllConstIter(wordList, phaseNames, iter)
{
const word name(IOobject::groupName("maxDispersedAlpha", *iter));
maxDispersedAlpha_.insert
(
*iter,
dimensionedScalar
(
name,
dimless,
dict.lookup(name)
)
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::blendingMethods::hyperbolic::~hyperbolic()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::hyperbolic::f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
return
(
1
+ tanh
(
(4/transitionAlphaScale_)
*(phase1 - maxDispersedAlpha_[phase1.name()])
)
)/2;
}
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::hyperbolic::f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
return
(
1
+ tanh
(
(4/transitionAlphaScale_)
*(maxDispersedAlpha_[phase2.name()] - phase2)
)
)/2;
}
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::hyperbolic
Description
SourceFiles
hyperbolic.C
\*---------------------------------------------------------------------------*/
#ifndef hyperbolic_H
#define hyperbolic_H
#include "blendingMethod.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
/*---------------------------------------------------------------------------*\
Class hyperbolic Declaration
\*---------------------------------------------------------------------------*/
class hyperbolic
:
public blendingMethod
{
// Private data
//- Maximum fraction of phases which can be considered dispersed
HashTable<dimensionedScalar, word, word::hash> maxDispersedAlpha_;
//- Width of the transition
const dimensionedScalar transitionAlphaScale_;
public:
//- Runtime type information
TypeName("hyperbolic");
// Constructors
//- Construct from a dictionary and a list of phase names
hyperbolic
(
const dictionary& dict,
const wordList& phaseNames
);
//- Destructor
~hyperbolic();
// Member Functions
//- Factor for first phase
virtual tmp<volScalarField> f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
//- Factor for second phase
virtual tmp<volScalarField> f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace blendingMethods
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,170 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "linear.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
defineTypeNameAndDebug(linear, 0);
addToRunTimeSelectionTable
(
blendingMethod,
linear,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::blendingMethods::linear::linear
(
const dictionary& dict,
const wordList& phaseNames
)
:
blendingMethod(dict)
{
forAllConstIter(wordList, phaseNames, iter)
{
const word nameFull
(
IOobject::groupName("maxFullyDispersedAlpha", *iter)
);
maxFullyDispersedAlpha_.insert
(
*iter,
dimensionedScalar
(
nameFull,
dimless,
dict.lookup(nameFull)
)
);
const word namePart
(
IOobject::groupName("maxPartlyDispersedAlpha", *iter)
);
maxPartlyDispersedAlpha_.insert
(
*iter,
dimensionedScalar
(
namePart,
dimless,
dict.lookup(namePart)
)
);
if
(
maxFullyDispersedAlpha_[*iter]
> maxPartlyDispersedAlpha_[*iter]
)
{
FatalErrorIn
(
"Foam::blendingMethods::linear::linear"
"("
"const dictionary& dict,"
"const wordList& phaseNames"
")"
) << "The supplied fully dispersed volume fraction for "
<< *iter
<< " is greater than the partly dispersed value."
<< endl << exit(FatalError);
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::blendingMethods::linear::~linear()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
const dimensionedScalar
maxFullAlpha(maxFullyDispersedAlpha_[phase1.name()]);
const dimensionedScalar
maxPartAlpha(maxPartlyDispersedAlpha_[phase1.name()]);
return
min
(
max
(
(phase1 - maxFullAlpha)
/(maxPartAlpha - maxFullAlpha + SMALL),
0.0
),
1.0
);
}
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
const dimensionedScalar
maxFullAlpha(maxFullyDispersedAlpha_[phase2.name()]);
const dimensionedScalar
maxPartAlpha(maxPartlyDispersedAlpha_[phase2.name()]);
return
min
(
max
(
(maxPartAlpha - phase2)
/(maxPartAlpha - maxFullAlpha + SMALL),
0.0
),
1.0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::linear
Description
SourceFiles
linear.C
\*---------------------------------------------------------------------------*/
#ifndef linear_H
#define linear_H
#include "blendingMethod.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
/*---------------------------------------------------------------------------*\
Class linear Declaration
\*---------------------------------------------------------------------------*/
class linear
:
public blendingMethod
{
// Private data
//- Maximum fraction of phases which can be considered fully dispersed
HashTable<dimensionedScalar, word, word::hash>
maxFullyDispersedAlpha_;
//- Maximum fraction of phases which can be considered partly dispersed
HashTable<dimensionedScalar, word, word::hash>
maxPartlyDispersedAlpha_;
public:
//- Runtime type information
TypeName("linear");
// Constructors
//- Construct from a dictionary and two phases
linear
(
const dictionary& dict,
const wordList& phaseNames
);
//- Destructor
~linear();
// Member Functions
//- Factor for primary phase
virtual tmp<volScalarField> f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
//- Factor for secondary phase
virtual tmp<volScalarField> f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace blendingMethods
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,108 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "noBlending.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
defineTypeNameAndDebug(noBlending, 0);
addToRunTimeSelectionTable
(
blendingMethod,
noBlending,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::blendingMethods::noBlending::noBlending
(
const dictionary& dict,
const wordList& phaseNames
)
:
blendingMethod(dict),
continuousPhase_(dict.lookup("continuousPhase"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::blendingMethods::noBlending::~noBlending()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
const fvMesh& mesh(phase1.mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"f",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar
(
"f",
dimless,
phase1.name() == continuousPhase_
)
)
);
}
Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
return f1(phase1, phase2);
}
// ************************************************************************* //

View File

@ -0,0 +1,107 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::noBlending
Description
SourceFiles
noBlending.C
\*---------------------------------------------------------------------------*/
#ifndef noBlending_H
#define noBlending_H
#include "blendingMethod.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace blendingMethods
{
/*---------------------------------------------------------------------------*\
Class noBlending Declaration
\*---------------------------------------------------------------------------*/
class noBlending
:
public blendingMethod
{
// Private data
//- Name of the continuous phase
const word continuousPhase_;
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from a dictionary and two phases
noBlending
(
const dictionary& dict,
const wordList& phaseNames
);
//- Destructor
~noBlending();
// Member Functions
//- Factor for primary phase
virtual tmp<volScalarField> f1
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
//- Factor for secondary phase
virtual tmp<volScalarField> f2
(
const phaseModel& phase1,
const phaseModel& phase2
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace blendingMethods
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More