multiphaseEulerFoam: Make aspect ratio models sub-models of force models

These models are quite configuration specific. It makes sense to make
them sub-models of the force (drag or lift) models that use them, rather
than making them fundamental properties of the phase system.
This commit is contained in:
Will Bainbridge
2021-12-14 11:19:23 +00:00
parent d9be4381f5
commit 3761c48e1c
48 changed files with 100 additions and 451 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
#include "TomiyamaAnalytic.H"
#include "phasePair.H"
#include "aspectRatioModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -51,7 +52,8 @@ Foam::dragModels::TomiyamaAnalytic::TomiyamaAnalytic
dragModel(dict, pair, registerObject),
residualRe_("residualRe", dimless, dict),
residualEo_("residualEo", dimless, dict),
residualE_("residualE", dimless, dict)
residualE_("residualE", dimless, dict),
aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair))
{}
@ -67,7 +69,7 @@ Foam::tmp<Foam::volScalarField>
Foam::dragModels::TomiyamaAnalytic::CdRe() const
{
const volScalarField Eo(max(pair_.Eo(), residualEo_));
const volScalarField E(max(pair_.E(), residualE_));
const volScalarField E(max(aspectRatio_->E(), residualE_));
const volScalarField OmEsq(max(1 - sqr(E), sqr(residualE_)));
const volScalarField rtOmEsq(sqrt(OmEsq));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,6 +49,9 @@ SourceFiles
namespace Foam
{
class aspectRatioModel;
namespace dragModels
{
@ -71,6 +74,9 @@ class TomiyamaAnalytic
//- Residual aspect ratio
const dimensionedScalar residualE_;
//- The aspect ratio model
autoPtr<aspectRatioModel> aspectRatio_;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
#include "TomiyamaLift.H"
#include "phasePair.H"
#include "aspectRatioModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -47,7 +48,8 @@ Foam::liftModels::TomiyamaLift::TomiyamaLift
const phasePair& pair
)
:
liftModel(dict, pair)
liftModel(dict, pair),
aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair))
{}
@ -61,7 +63,10 @@ Foam::liftModels::TomiyamaLift::~TomiyamaLift()
Foam::tmp<Foam::volScalarField> Foam::liftModels::TomiyamaLift::Cl() const
{
const volScalarField EoH(pair_.EoH2());
const volScalarField EoH
(
pair_.Eo(pair_.dispersed().d()/cbrt(aspectRatio_->E()))
);
const volScalarField f
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,6 +54,7 @@ namespace Foam
{
class phasePair;
class aspectRatioModel;
namespace liftModels
{
@ -66,6 +67,14 @@ class TomiyamaLift
:
public liftModel
{
private:
//- Private Data
//- The aspect ratio model
autoPtr<aspectRatioModel> aspectRatio_;
public:
//- Runtime type information

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
#include "Lamb.H"
#include "phasePair.H"
#include "aspectRatioModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -53,7 +54,8 @@ Foam::virtualMassModels::Lamb::Lamb
const bool registerObject
)
:
virtualMassModel(dict, pair, registerObject)
virtualMassModel(dict, pair, registerObject),
aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair))
{}
@ -67,7 +69,7 @@ Foam::virtualMassModels::Lamb::~Lamb()
Foam::tmp<Foam::volScalarField> Foam::virtualMassModels::Lamb::Cvm() const
{
volScalarField E(min(max(pair_.E(), small), 1 - small));
volScalarField E(min(max(aspectRatio_->E(), small), 1 - small));
volScalarField rtOmEsq(sqrt(1 - sqr(E)));
return

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,6 +50,7 @@ namespace Foam
{
class phasePair;
class aspectRatioModel;
namespace virtualMassModels
{
@ -62,6 +63,14 @@ class Lamb
:
public virtualMassModel
{
private:
//- Private Data
//- The aspect ratio model
autoPtr<aspectRatioModel> aspectRatio_;
public:
//- Runtime type information

View File

@ -36,7 +36,6 @@ SourceFiles
#include "blendingMethod.H"
#include "phasePair.H"
#include "orderedPhasePair.H"
#include "HashPtrTable.H"
#include "hashedWordList.H"
#include "geometricZeroField.H"

View File

@ -27,20 +27,6 @@ License
#include "phaseSystem.H"
#include "surfaceTensionModel.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH
(
const volScalarField& d
) const
{
return
mag(dispersed().rho() - continuous().rho())
*mag(g())
*sqr(d)
/sigma();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -138,29 +124,20 @@ Foam::tmp<Foam::volScalarField> Foam::phasePair::Pr() const
Foam::tmp<Foam::volScalarField> Foam::phasePair::Eo() const
{
return EoH(dispersed().d());
return Eo(dispersed().d());
}
Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH1() const
Foam::tmp<Foam::volScalarField> Foam::phasePair::Eo
(
const volScalarField& d
) const
{
return
EoH
(
dispersed().d()
*cbrt(1 + 0.163*pow(Eo(), 0.757))
);
}
Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH2() const
{
return
EoH
(
dispersed().d()
/cbrt(E())
);
mag(dispersed().rho() - continuous().rho())
*mag(g())
*sqr(d)
/sigma();
}
@ -194,10 +171,4 @@ Foam::tmp<Foam::volScalarField> Foam::phasePair::Ta() const
}
Foam::tmp<Foam::volScalarField> Foam::phasePair::E() const
{
return dispersed().fluid().E(*this);
}
// ************************************************************************* //

View File

@ -65,12 +65,6 @@ private:
const uniformDimensionedVectorField& g_;
// Private Member Functions
// Etvos number for given diameter
tmp<volScalarField> EoH(const volScalarField& d) const;
public:
// Constructors
@ -120,11 +114,8 @@ public:
//- Eotvos number
tmp<volScalarField> Eo() const;
//- Eotvos number based on hydraulic diameter type 1
tmp<volScalarField> EoH1() const;
//- Eotvos number based on hydraulic diameter type 2
tmp<volScalarField> EoH2() const;
//- Eotvos number for given diameter
tmp<volScalarField> Eo(const volScalarField& d) const;
//- Surface tension coefficient
tmp<volScalarField> sigma() const;
@ -135,8 +126,6 @@ public:
//- Takahashi Number
tmp<volScalarField> Ta() const;
//- Aspect ratio
tmp<volScalarField> E() const;
// Access

View File

@ -473,7 +473,6 @@ Foam::phaseSystem::phaseSystem
// Sub-models
generatePairsAndSubModels("surfaceTension", surfaceTensionModels_);
generatePairsAndSubModels("aspectRatio", aspectRatioModels_);
// Update motion fields
correctKinematics();
@ -565,25 +564,6 @@ Foam::tmp<Foam::volVectorField> Foam::phaseSystem::U() const
}
Foam::tmp<Foam::volScalarField>
Foam::phaseSystem::E(const phasePairKey& key) const
{
if (aspectRatioModels_.found(key))
{
return aspectRatioModels_[key]->E();
}
else
{
return volScalarField::New
(
aspectRatioModel::typeName + ":E",
mesh_,
dimensionedScalar(dimless, 1)
);
}
}
Foam::tmp<Foam::volScalarField>
Foam::phaseSystem::sigma(const phasePairKey& key) const
{

View File

@ -60,7 +60,6 @@ namespace Foam
class blendingMethod;
template<class modelType> class BlendedInterfacialModel;
class surfaceTensionModel;
class aspectRatioModel;
class pressureReference;
class nonOrthogonalSolutionControl;
@ -126,15 +125,6 @@ protected:
>
surfaceTensionModelTable;
typedef
HashTable
<
autoPtr<aspectRatioModel>,
phasePairKey,
phasePairKey::hash
>
aspectRatioModelTable;
typedef HashTable<scalar, phasePairKey, phasePairKey::hash>
cAlphaTable;
@ -190,9 +180,6 @@ protected:
//- Surface tension models
surfaceTensionModelTable surfaceTensionModels_;
//- Aspect ratio models
aspectRatioModelTable aspectRatioModels_;
//- Flag to indicate that returned lists of fields are "complete"; i.e.,
// that an absence of force is returned as a constructed list of zeros,

View File

@ -314,33 +314,16 @@ bool Foam::phaseSystem::foundSubModel(const phasePair& key) const
if (key.ordered())
{
if (mesh().foundObject<modelType>(name))
{
return true;
}
else
{
return false;
}
return mesh().foundObject<modelType>(name);
}
else
{
if
(
return
mesh().foundObject<modelType>(name)
||
mesh().foundObject<modelType>
|| mesh().foundObject<modelType>
(
IOobject::groupName(modelType::typeName, key.otherName())
)
)
{
return true;
}
else
{
return false;
}
);
}
}

View File

@ -56,21 +56,6 @@ surfaceTension
}
);
aspectRatio
(
(gas in liquid)
{
type constant;
E0 1.0;
}
(liquid in gas)
{
type constant;
E0 1.0;
}
);
drag
(
);

View File

@ -55,21 +55,6 @@ surfaceTension
}
);
aspectRatio
(
(gas in liquid)
{
type constant;
E0 1.0;
}
(liquid in gas)
{
type constant;
E0 1.0;
}
);
drag
(
);

View File

@ -158,9 +158,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -159,9 +159,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -201,9 +201,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -124,9 +124,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -128,9 +128,6 @@ populationBalanceCoeffs
}
}
aspectRatio
();
blending
{
default

View File

@ -124,9 +124,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -164,9 +164,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
();
drag
();

View File

@ -65,21 +65,6 @@ saturation
}
);
aspectRatio
(
(steam in water)
{
type constant;
E0 1.0;
}
(water in steam)
{
type constant;
E0 1.0;
}
);
drag
(
);

View File

@ -73,21 +73,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -83,6 +83,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -122,9 +128,6 @@ blending
}
}
aspectRatio
();
surfaceTension
(
(gas and liquid)

View File

@ -63,10 +63,6 @@ surfaceTension
}
);
aspectRatio
(
);
drag
(
(solids in gas)

View File

@ -73,21 +73,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -78,21 +78,6 @@ surfaceTension
}
);
aspectRatio
(
(gas in liquid)
{
type constant;
E0 1.0;
}
(liquid in gas)
{
type constant;
E0 1.0;
}
);
drag
(
(gas in liquid)

View File

@ -141,19 +141,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
(
(air1 in water)
{
type Wellek;
}
(air2 in water)
{
type Wellek;
}
);
drag
(
(air1 in water)
@ -216,9 +203,9 @@ lift
{
type Tomiyama;
swarmCorrection
aspectRatio
{
type none;
type Wellek;
}
}
}
@ -237,9 +224,9 @@ lift
{
type Tomiyama;
swarmCorrection
aspectRatio
{
type none;
type Wellek;
}
}
}

View File

@ -65,9 +65,6 @@ surfaceTension
}
);
aspectRatio
();
interfaceCompression
();

View File

@ -92,6 +92,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -132,9 +138,6 @@ blending
}
}
aspectRatio
();
saturation
(
(gas and liquid)

View File

@ -132,6 +132,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -172,9 +178,6 @@ blending
}
}
aspectRatio
();
saturation
(
(gas and liquid)

View File

@ -175,6 +175,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -215,9 +221,6 @@ blending
}
}
aspectRatio
();
saturation
(
(gas and liquid)

View File

@ -232,6 +232,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -250,6 +256,12 @@ lift
{
type Tomiyama;
Cl 0.288;
aspectRatio
{
type constant;
E0 1;
}
}
wallDamping
@ -304,9 +316,6 @@ blending
}
}
aspectRatio
();
saturation
(
(gas and liquid)

View File

@ -90,45 +90,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
(air in solid)
{
type constant;
E0 1.0;
}
(solid in air)
{
type constant;
E0 1.0;
}
(water in solid)
{
type constant;
E0 1.0;
}
(solid in water)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -78,21 +78,6 @@ surfaceTension
interfaceCompression
();
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -78,21 +78,6 @@ surfaceTension
}
);
aspectRatio
(
(gas in liquid)
{
type constant;
E0 1.0;
}
(liquid in gas)
{
type constant;
E0 1.0;
}
);
drag
(
(gas in liquid)

View File

@ -78,21 +78,6 @@ surfaceTension
}
);
aspectRatio
(
(gas in liquid)
{
type constant;
E0 1.0;
}
(liquid in gas)
{
type constant;
E0 1.0;
}
);
drag
(
(gas in liquid)

View File

@ -95,21 +95,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -124,9 +124,6 @@ interfaceCompression
(oil and mercury) 1
);
aspectRatio
();
drag
(
(air and water)

View File

@ -61,9 +61,6 @@ surfaceTension
}
);
aspectRatio
();
drag
(
(particles in air)

View File

@ -73,21 +73,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
);
drag
(
(air in water)

View File

@ -139,9 +139,6 @@ interfaceCompression
(oil and mercury) 1
);
aspectRatio
();
drag
(
(air in water)

View File

@ -140,9 +140,6 @@ interfaceCompression
(oil and mercury) 1
);
aspectRatio
();
drag
(
(air in water)

View File

@ -139,9 +139,6 @@ interfaceCompression
(oil and mercury) 1
);
aspectRatio
();
drag
(
(air in water)

View File

@ -73,15 +73,6 @@ saturation
}
);
aspectRatio
(
(steam in water)
{
type constant;
E0 1.0;
}
);
drag
(
(steam in water)

View File

@ -147,9 +147,6 @@ interfaceCompression
surfaceTension
();
aspectRatio
();
drag
(
(particles in vapor)

View File

@ -159,9 +159,6 @@ interfaceCompression
surfaceTension
();
aspectRatio
();
drag
(
(particles in vapor)

View File

@ -85,45 +85,6 @@ surfaceTension
}
);
aspectRatio
(
(air in water)
{
type constant;
E0 1.0;
}
(water in air)
{
type constant;
E0 1.0;
}
(air in solid)
{
type constant;
E0 1.0;
}
(solid in air)
{
type constant;
E0 1.0;
}
(water in solid)
{
type constant;
E0 1.0;
}
(solid in water)
{
type constant;
E0 1.0;
}
);
drag
(
(air and water)