Skip to content

Commit

Permalink
driftFluxFoam: Added MRF centrifugal acceleration effect to the relat…
Browse files Browse the repository at this point in the history
…iveVelocityModels

This required changing the formulation of the relative velocity in terms of a
scalar velocity coefficient Vc rather than the velocity V0 such that

    V0 = Vc*g

where g is the acceleration due to gravity.  With MRF rotation

    V0 = Vc*(g + <MRF centrifugal acceleration>)
  • Loading branch information
Henry Weller committed Mar 17, 2022
1 parent 05cfe84 commit fbf7374
Show file tree
Hide file tree
Showing 15 changed files with 208 additions and 98 deletions.
29 changes: 16 additions & 13 deletions applications/solvers/multiphase/driftFluxFoam/createFields.H
Expand Up @@ -63,15 +63,9 @@ surfaceScalarField rhoPhi
);


// Relative Velocity
autoPtr<relativeVelocityModel> UdmModelPtr
(
relativeVelocityModel::New
(
mixture,
mixture
)
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"


// Construct compressible turbulence model
Expand All @@ -81,10 +75,6 @@ autoPtr<compressible::momentumTransportModel> turbulence
);


#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"


volScalarField p
(
Expand Down Expand Up @@ -120,5 +110,18 @@ mesh.setFluxRequired(alpha1.name());
tmp<surfaceScalarField> talphaPhiCorr0;

#include "createMRF.H"

// Relative Velocity
autoPtr<relativeVelocityModel> UdmModelPtr
(
relativeVelocityModel::New
(
mixture,
mixture,
g,
MRF
)
);

#include "createFvModels.H"
#include "createFvConstraints.H"
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -43,13 +43,15 @@ namespace relativeVelocityModels
Foam::relativeVelocityModels::general::general
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
)
:
relativeVelocityModel(dict, mixture),
relativeVelocityModel(dict, mixture, g, MRF),
a_("a", dimless, dict),
a1_("a1", dimless, dict),
V0_("V0", dimVelocity, dict),
Vc_("Vc", dimTime, dict),
residualAlpha_("residualAlpha", dimless, dict)
{}

Expand All @@ -66,7 +68,8 @@ void Foam::relativeVelocityModels::general::correct()
{
Udm_ =
(rhoc_/rho())
*V0_
*Vc_
*(g_ + MRF_.centrifugalAcceleration())
*(
exp(-a_*max(alphad_ - residualAlpha_, scalar(0)))
- exp(-a1_*max(alphad_ - residualAlpha_, scalar(0)))
Expand Down
Expand Up @@ -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-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -60,8 +60,8 @@ class general
//- a1 coefficient
dimensionedScalar a1_;

//- Drift velocity
dimensionedVector V0_;
//- Drift velocity coefficient
dimensionedScalar Vc_;

//- Residual phase fraction
dimensionedScalar residualAlpha_;
Expand All @@ -79,7 +79,9 @@ public:
general
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
);


Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -70,14 +70,18 @@ Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
Foam::relativeVelocityModel::relativeVelocityModel
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
)
:
mixture_(mixture),
alphac_(mixture.alpha2()),
alphad_(mixture.alpha1()),
rhoc_(mixture.rhoc()),
rhod_(mixture.rhod()),
g_(g),
MRF_(MRF),

Udm_
(
Expand All @@ -101,7 +105,9 @@ Foam::relativeVelocityModel::relativeVelocityModel
Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
)
{
word modelType(dict.lookup(typeName));
Expand All @@ -127,7 +133,9 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
cstrIter()
(
dict.optionalSubDict(modelType + "Coeffs"),
mixture
mixture,
g,
MRF
)
);
}
Expand All @@ -141,19 +149,19 @@ Foam::relativeVelocityModel::~relativeVelocityModel()

// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //

tmp<volScalarField> Foam::relativeVelocityModel::rho() const
Foam::tmp<Foam::volScalarField> Foam::relativeVelocityModel::rho() const
{
return alphac_*rhoc_ + alphad_*rhod_;
}


tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
Foam::tmp<Foam::volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
{
volScalarField betac(alphac_*rhoc_);
volScalarField betad(alphad_*rhod_);
const volScalarField betac(alphac_*rhoc_);
const volScalarField betad(alphad_*rhod_);

// Calculate the relative velocity of the continuous phase w.r.t the mean
volVectorField Ucm(betad*Udm_/betac);
const volVectorField Ucm(betad*Udm_/betac);

return volSymmTensorField::New
(
Expand Down
Expand Up @@ -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-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -34,9 +34,9 @@ SourceFiles
#ifndef relativeVelocityModel_H
#define relativeVelocityModel_H

#include "fvCFD.H"
#include "dictionary.H"
#include "incompressibleTwoPhaseInteractingMixture.H"
#include "uniformDimensionedFields.H"
#include "MRFZoneList.H"
#include "runTimeSelectionTables.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand Down Expand Up @@ -78,10 +78,15 @@ protected:
//- Dispersed density
const dimensionedScalar& rhod_;

//- Acceleration due to gravity
const uniformDimensionedVectorField& g_;

//- MRF zones
const MRFZoneList& MRF_;

//- Dispersed diffusion velocity
mutable volVectorField Udm_;


public:

//- Runtime type information
Expand All @@ -93,9 +98,13 @@ public:
autoPtr,
relativeVelocityModel,
dictionary,
(const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture),
(dict, mixture)
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
),
(dict, mixture, g, MRF)
);


Expand All @@ -105,7 +114,9 @@ public:
relativeVelocityModel
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
);

//- Disallow default bitwise copy construction
Expand All @@ -116,7 +127,9 @@ public:
static autoPtr<relativeVelocityModel> New
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
);


Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -43,12 +43,14 @@ namespace relativeVelocityModels
Foam::relativeVelocityModels::simple::simple
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
)
:
relativeVelocityModel(dict, mixture),
relativeVelocityModel(dict, mixture, g, MRF),
a_("a", dimless, dict),
V0_("V0", dimVelocity, dict),
Vc_("Vc", dimTime, dict),
residualAlpha_("residualAlpha", dimless, dict)
{}

Expand All @@ -63,7 +65,10 @@ Foam::relativeVelocityModels::simple::~simple()

void Foam::relativeVelocityModels::simple::correct()
{
Udm_ = (rhoc_/rho())*V0_*pow(scalar(10), -a_*max(alphad_, scalar(0)));
Udm_ =
(rhoc_/rho())
*Vc_*(g_ + MRF_.centrifugalAcceleration())
*pow(scalar(10), -a_*max(alphad_, scalar(0)));
}


Expand Down
Expand Up @@ -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-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -57,8 +57,8 @@ class simple
//- A coefficient
dimensionedScalar a_;

//- Drift velocity
dimensionedVector V0_;
//- Drift velocity coefficient
dimensionedScalar Vc_;

//- Residual phase fraction
dimensionedScalar residualAlpha_;
Expand All @@ -76,7 +76,9 @@ public:
simple
(
const dictionary& dict,
const incompressibleTwoPhaseInteractingMixture& mixture
const incompressibleTwoPhaseInteractingMixture& mixture,
const uniformDimensionedVectorField& g,
const MRFZoneList& MRF
);


Expand Down

0 comments on commit fbf7374

Please sign in to comment.