solvers: multiphaseEuler: Boiling on the surface of a stationary phase

A new wallBoiling heat transfer model has been added for use with the
thermalPhaseChangeMultiphaseSystem. This model operates similarly to the
alphatWallBoilingWallFunction. The difference is that the boiling generated by
the wallBoiling heat transfer model occurs on the surface of a third stationary
phase, within the volume of the simulation, rather than on a wall patch. This
can be used to model boiling within a packed bed or similar.

The wallBoiling heat transfer model and the alphatWallBoilingWallFunction share
underlying sub-models, so their specification is very similar. For example, in
constant/phaseProperties:

heatTransfer
{
    ...

    bed_dispersedIn_liquid_inThe_liquid
    {
        type            wallBoiling;

        liquidPhase     liquid;
        vapourPhase     gas;

        heatTransferModel
        {
            type            Gunn;
        }

        partitioningModel
        {
            type            Lavieville; // phaseFraction, linear, cosine
            alphaCrit       0.2;
        }
        nucleationSiteModel
        {
            type            LemmertChawla; // KocamustafaogullariIshii
        }
        departureDiameterModel
        {
            type            TolubinskiKostanchuk; // KocamustafaogullariIshii
        }
        departureFrequencyModel
        {
            type            KocamustafaogullariIshii; // Cole
            Cf              1.18;
        }
    }

    bed_dispersedIn_liquid_inThe_bed
    {
        type            spherical;
    }

    ...
}

Based on a patch contributed by Juho Peltola, VTT.
This commit is contained in:
Will Bainbridge
2023-03-02 14:48:18 +00:00
parent b9711e593b
commit 32edc48db2
63 changed files with 2377 additions and 251 deletions

View File

@ -42,6 +42,7 @@ heatTransferModels/constantNu/constantNuHeatTransfer.C
heatTransferModels/RanzMarshall/RanzMarshall.C
heatTransferModels/Gunn/Gunn.C
heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C
heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.C
heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C
virtualMassModels/virtualMassModel/virtualMassModel.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,10 +43,11 @@ namespace heatTransferModels
Foam::heatTransferModels::Gunn::Gunn
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict, interface),
heatTransferModel(dict, interface, registerObject),
interface_
(
interface.modelCast<heatTransferModel, dispersedPhaseInterface>()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,7 +78,8 @@ public:
Gunn
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,10 +43,11 @@ namespace heatTransferModels
Foam::heatTransferModels::RanzMarshall::RanzMarshall
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict, interface),
heatTransferModel(dict, interface, registerObject),
interface_
(
interface.modelCast<heatTransferModel, dispersedPhaseInterface>()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,8 @@ public:
RanzMarshall
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,10 +48,11 @@ namespace heatTransferModels
Foam::heatTransferModels::constantNuHeatTransfer::constantNuHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict, interface),
heatTransferModel(dict, interface, registerObject),
interface_
(
interface.modelCast<heatTransferModel, dispersedPhaseInterface>()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,8 @@ public:
constantNuHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,9 +43,22 @@ const Foam::dimensionSet Foam::heatTransferModel::dimK(1, -1, -3, -1, 0);
Foam::heatTransferModel::heatTransferModel
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
regIOobject
(
IOobject
(
IOobject::groupName(typeName, interface.name()),
interface.mesh().time().name(),
interface.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
registerObject
)
),
residualAlpha_
(
"residualAlpha",
@ -78,6 +91,12 @@ Foam::heatTransferModel::K() const
}
bool Foam::heatTransferModel::writeData(Ostream& os) const
{
return os.good();
}
Foam::tmp<Foam::volScalarField> Foam::blendedHeatTransferModel::K() const
{
tmp<volScalarField> (heatTransferModel::*k)() const =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,6 +51,8 @@ namespace Foam
\*---------------------------------------------------------------------------*/
class heatTransferModel
:
public regIOobject
{
protected:
@ -75,9 +77,10 @@ public:
dictionary,
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
),
(dict, interface)
(dict, interface, registerObject)
);
@ -96,7 +99,8 @@ public:
heatTransferModel
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);
@ -110,7 +114,8 @@ public:
(
const dictionary& dict,
const phaseInterface& interface,
const bool outer=true
const bool outer=true,
const bool registerObject=true
);
@ -126,6 +131,9 @@ public:
// ddt(alpha2*rho2*hb) + ... = ... K*(Tb - Ta)
// with a specified residual volume fraction
virtual tmp<volScalarField> K(const scalar residualAlpha) const = 0;
//- Dummy write for regIOobject
bool writeData(Ostream& os) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,8 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
(
const dictionary& dict,
const phaseInterface& interface,
const bool outer
const bool outer,
const bool registerObject
)
{
const dictionary& modelDict =
@ -56,7 +57,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
<< exit(FatalError);
}
return cstrIter()(modelDict, interface);
return cstrIter()(modelDict, interface, registerObject);
}

View File

@ -0,0 +1,78 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 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 "nonSphericalHeatTransfer.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
defineTypeNameAndDebug(nonSphericalHeatTransfer, 0);
addToRunTimeSelectionTable
(
heatTransferModel,
nonSphericalHeatTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModels::nonSphericalHeatTransfer::nonSphericalHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface,
const bool registerObject
)
:
sphericalHeatTransfer(dict, interface, registerObject),
factor_("factor", dimless, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferModels::nonSphericalHeatTransfer::~nonSphericalHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::heatTransferModels::nonSphericalHeatTransfer::K
(
const scalar residualAlpha
) const
{
return factor_*sphericalHeatTransfer::K(residualAlpha);
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 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::nonSphericalHeatTransfer
Description
Model which applies an analytical solution for heat transfer from the
surface of a sphere to the matter within the sphere, modified by a
non-spherical factor.
SourceFiles
nonSphericalHeatTransfer.C
\*---------------------------------------------------------------------------*/
#ifndef nonSphericalHeatTransfer_H
#define nonSphericalHeatTransfer_H
#include "sphericalHeatTransfer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
/*---------------------------------------------------------------------------*\
Class nonSphericalHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
class nonSphericalHeatTransfer
:
public sphericalHeatTransfer
{
// Private Data
//- Non-spherical factor
const dimensionedScalar factor_;
public:
//- Runtime type information
TypeName("nonSpherical");
// Constructors
//- Construct from a dictionary and an interface
nonSphericalHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface,
const bool registerObject
);
//- Destructor
virtual ~nonSphericalHeatTransfer();
// Member Functions
//- The heat transfer function K used in the enthalpy equation
tmp<volScalarField> K(const scalar residualAlpha) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace heatTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,10 +48,11 @@ namespace heatTransferModels
Foam::heatTransferModels::sphericalHeatTransfer::sphericalHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict, interface),
heatTransferModel(dict, interface, registerObject),
interface_
(
interface.modelCast<heatTransferModel, dispersedPhaseInterface>()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,7 @@ Class
Description
Model which applies an analytical solution for heat transfer from the
surface of a sphere to the fluid within the sphere.
surface of a sphere to the matter within the sphere.
SourceFiles
sphericalHeatTransfer.C
@ -71,7 +71,8 @@ public:
sphericalHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,10 +49,16 @@ Foam::heatTransferModels::timeScaleFilteredHeatTransfer::
timeScaleFilteredHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict.subDict("heatTransferModel"), interface),
heatTransferModel
(
dict.subDict("heatTransferModel"),
interface,
registerObject
),
interface_
(
interface.modelCast<heatTransferModel, dispersedPhaseInterface>()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,7 +79,8 @@ public:
timeScaleFilteredHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface
const phaseInterface& interface,
const bool registerObject
);

View File

@ -21,4 +21,5 @@ EXE_INC = \
LIB_LIBS = \
-lcombustionModels \
-lphaseSystem
-lphaseSystem \
-leulerianInterfacialModels

View File

@ -2,29 +2,32 @@ HeatTransferPhaseSystem/heatTransferPhaseSystem.C
TwoResistanceHeatTransferPhaseSystem/twoResistanceHeatTransferPhaseSystem.C
diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C
populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C
heatTransferModels/wallBoiling/wallBoilingHeatTransfer.C
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C
wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C
wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C
wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C
wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C
wallBoilingSubModels/partitioningModels/cosine/cosine.C
wallBoilingSubModels/partitioningModels/linear/linear.C
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C
wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C
wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C
wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C
wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C
wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C
wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C
wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C
wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C
wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C
wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C
wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C
wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C
derivedFvPatchFields/alphatPhaseChangeWallFunctionBase/alphatPhaseChangeWallFunctionBase.C
derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C

View File

@ -16,7 +16,8 @@ EXE_INC = \
-I$(LIB_SRC)/ThermophysicalTransportModels/coupledThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
LIB_LIBS = \
-lphaseSystem \

View File

@ -0,0 +1,423 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2023 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 "wallBoilingHeatTransfer.H"
#include "phaseSystem.H"
#include "addToRunTimeSelectionTable.H"
#include "interfaceSaturationTemperatureModel.H"
#include "diameterModel.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
defineTypeNameAndDebug(wallBoilingHeatTransfer, 0);
addToRunTimeSelectionTable
(
heatTransferModel,
wallBoilingHeatTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModels::wallBoilingHeatTransfer::wallBoilingHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface,
const bool registerObject
)
:
heatTransferModel(dict, interface, registerObject),
interface_
(
interface.modelCast<wallBoilingHeatTransfer, dispersedPhaseInterface>()
),
otherInterface_
(
interface
.modelCast<wallBoilingHeatTransfer, sidedPhaseInterface>()
.otherInterface()
),
vapourPhaseName_(dict.lookup("vapourPhase")),
liquidPhaseName_(dict.lookup("liquidPhase")),
heatTransferModel_
(
heatTransferModel::New
(
dict.subDict("heatTransferModel"),
interface,
false,
false
)
),
relax_(dict.lookupOrDefault<scalar>("relax", scalar(1))),
seedFraction_(dict.lookupOrDefault<scalar>("nucleationSeedFraction", 1e-4)),
partitioningModel_(nullptr),
nucleationSiteModel_(nullptr),
departureDiamModel_(nullptr),
departureFreqModel_(nullptr),
wetFraction_
(
IOobject
(
IOobject::groupName("fWallBoiling", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimless,1)
),
dDep_
(
IOobject
(
IOobject::groupName("departureDiameter", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimLength, 1e-4)
),
fDep_
(
IOobject
(
IOobject::groupName("departureFrequency", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(inv(dimTime), 0)
),
nucleationSiteDensity_
(
IOobject
(
IOobject::groupName("nucleationSites", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimless/dimArea, 0)
),
dmdtf_
(
IOobject
(
IOobject::groupName(typedName("dmdtf"), interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimDensity/dimTime, 0)
),
qq_
(
IOobject
(
IOobject::groupName("qq", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimEnergy/dimTime/dimVolume, 0)
),
Tsurface_
(
IOobject
(
IOobject::groupName("Tsurface", interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
interface_.mesh(),
dimensionedScalar(dimTemperature, 0)
),
K_
(
IOobject
(
IOobject::groupName(typedName("K"), interface_.name()),
interface_.mesh().time().timeName(),
interface_.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
heatTransferModel_->K()
)
{
partitioningModel_ =
Foam::wallBoilingModels::partitioningModel::New
(
dict.subDict("partitioningModel")
);
nucleationSiteModel_ =
Foam::wallBoilingModels::nucleationSiteModel::New
(
dict.subDict("nucleationSiteModel")
);
departureDiamModel_ =
Foam::wallBoilingModels::departureDiameterModel::New
(
dict.subDict("departureDiameterModel")
);
departureFreqModel_ =
Foam::wallBoilingModels::departureFrequencyModel::New
(
dict.subDict("departureFrequencyModel")
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferModels::wallBoilingHeatTransfer::
~wallBoilingHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::heatTransferModels::wallBoilingHeatTransfer::K
(
const scalar residualAlpha
) const
{
const phaseSystem& fluid = interface_.fluid();
const phaseModel& liquid = interface_.continuous();
const phaseModel& vapour = fluid.phases()[vapourPhaseName_];
const phaseModel& solid = interface_.dispersed();
const rhoThermo& lThermo = liquid.thermo();
const rhoThermo& vThermo = vapour.thermo();
const rhoThermo& sThermo = solid.thermo();
// Estimate the surface temperature from the surrounding temperature and
// heat transfer coefficients. Note that a lagged value of K is used in
// this calculation.
{
static const dimensionedScalar smallK(dimK, rootVSmall);
const heatTransferModel& otherModel =
fluid.lookupInterfacialModel<heatTransferModel>(otherInterface_());
const volScalarField otherK(otherModel.K());
Tsurface_ =
(K_*lThermo.T() + otherK*sThermo.T())
/max(K_ + otherK, smallK);
}
const volScalarField Tsat
(
fluid.lookupInterfacialModel
<
interfaceSaturationTemperatureModel
>
(phaseInterface(liquid, vapour))
.Tsat(liquid.thermo().p())()
);
const volScalarField L
(
vThermo.ha(lThermo.p(), Tsat) - lThermo.ha()
);
// Wetted fraction
wetFraction_ =
partitioningModel_->wetFraction(liquid/max(1 - solid, small));
// Bubble departure diameter
dDep_ =
departureDiamModel_->dDeparture
(
liquid,
vapour,
solid,
Tsurface_,
Tsat,
L
);
// Bubble departure frequency
fDep_ =
departureFreqModel_->fDeparture
(
liquid,
vapour,
solid,
Tsurface_,
Tsat,
L,
dDep_
);
// Nucleation site density
nucleationSiteDensity_ =
nucleationSiteModel_->nucleationSiteDensity
(
liquid,
vapour,
solid,
Tsurface_,
Tsat,
L,
dDep_,
fDep_
);
const tmp<volScalarField> tlrho(lThermo.rho());
const volScalarField& lrho = tlrho();
const tmp<volScalarField> tvrho(vThermo.rho());
const volScalarField& vrho = tvrho();
const volScalarField& lCp = lThermo.Cp();
const volScalarField& lkappa = lThermo.kappa();
//const volScalarField lalpha(lkappa/lCp);
// Area fractions
// Del Valle & Kenning (1985)
const volScalarField Ja
(
lrho*lCp*(Tsat - min(Tsurface_, Tsat))/(lrho*L)
);
const volScalarField Al
(
wetFraction_*4.8*exp(min(-Ja/80, log(vGreat)))
);
volScalarField A2
(
min(pi*sqr(dDep_)*nucleationSiteDensity_*Al/4, scalar(1))
);
const scalarField A1(max(1 - A2, scalar(1e-4)));
volScalarField A2E
(
min(pi*sqr(dDep_)*nucleationSiteDensity_*Al/4, scalar(5))
);
const volScalarField Av(solid.dPtr()->Av());
// Volumetric mass source in due to the wall boiling and bulk nucleation
dmdtf_ =
relax_*(1.0/6.0)*A2E*dDep_*vrho*fDep_*Av
+ (1 - relax_)*dmdtf_;
const dimensionedScalar zeroT(dimTemperature, small);
const dimensionedScalar smallT(dimTemperature, small);
const dimensionedScalar smallF(dimless/dimTime, small);
// Quenching heat transfer coefficient
const volScalarField hQ
(
2*lkappa*fDep_
*sqrt((0.8/max(fDep_, smallF))/(pi*(lkappa/lCp)/lrho))
);
// Volumetric quenching heat flux
qq_ =
(1 - relax_)*qq_
+ relax_*(A2*hQ*max(Tsurface_ - lThermo.T(), zeroT))*Av;
// Heat transfer coefficient
K_ =
heatTransferModel_->K(residualAlpha)
+ (dmdtf_*L + qq_)/max(Tsurface_ - liquid.thermo().T(), smallT);
return K_;
}
bool Foam::heatTransferModels::wallBoilingHeatTransfer::
activePhaseInterface(const phaseInterfaceKey& phaseInterface) const
{
const phaseModel& liquid = interface_.continuous();
const phaseSystem& fluid = liquid.fluid();
const phaseModel& vapour(fluid.phases()[vapourPhaseName_]);
if (phaseInterface == phaseInterfaceKey(vapour, liquid))
{
return true;
}
else
{
return false;
}
}
Foam::phaseInterfaceKey Foam::heatTransferModels::wallBoilingHeatTransfer::
activePhaseInterface() const
{
const phaseModel& liquid = interface_.continuous();
const phaseSystem& fluid = liquid.fluid();
const phaseModel& vapour(fluid.phases()[vapourPhaseName_]);
return phaseInterfaceKey(vapour, liquid);
}
const Foam::volScalarField&
Foam::heatTransferModels::wallBoilingHeatTransfer::dmdtf() const
{
return dmdtf_;
}
bool Foam::heatTransferModels::wallBoilingHeatTransfer::
writeData(Ostream& os) const
{
return os.good();
}
// ************************************************************************* //

View File

@ -0,0 +1,229 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2023 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::wallBoiling
Description
A heat transfer model for simulation of sub-cooled nucleate wall boiling on
the surface of a third phase with runtime selectable sub-models. This model
should be applied to the liquid side of the liquid-third-phase interface.
Usage
Settings below are very similar to that of the
alphatWallBoilingWallFunction (refer to this model's documentation for
further details). The only differences are that an underlying heat transfer
model is also required, and the phase-identifying entries are somewhat
different; the liquid and vapour phases must be specified explicitly.
A corresponding heat transfer model on the other side of the
liquid-third-phase interface is required by this model, and is also shown
below.
Example usage:
\verbatim
bed_dispersedIn_liquid_inThe_liquid
{
type wallBoiling;
liquidPhase liquid;
vapourPhase gas;
heatTransferModel
{
type Gunn;
}
partitioningModel
{
type Lavieville; // phaseFraction, linear, cosine
alphaCrit 0.2;
}
nucleationSiteModel
{
type LemmertChawla; // KocamustafaogullariIshii
}
departureDiameterModel
{
type TolubinskiKostanchuk; // KocamustafaogullariIshii
}
departureFrequencyModel
{
type KocamustafaogullariIshii; // Cole
Cf 1.18;
}
}
bed_dispersedIn_liquid_inThe_bed
{
type spherical;
}
\endverbatim
See also
Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField
SourceFiles
wallBoiling.C
\*---------------------------------------------------------------------------*/
#ifndef wallBoilingHeatTransfer_H
#define wallBoilingHeatTransfer_H
#include "heatTransferModel.H"
#include "partitioningModel.H"
#include "nucleationSiteModel.H"
#include "departureDiameterModel.H"
#include "departureFrequencyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
/*---------------------------------------------------------------------------*\
Class wallBoilingHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
class wallBoilingHeatTransfer
:
public heatTransferModel
{
// Private Data
//- Interface
const dispersedPhaseInterface interface_;
//- Interface on the other side
autoPtr<phaseInterface> otherInterface_;
//- Name of the vapour phase
const word vapourPhaseName_;
//- Name of the liquid phase
const word liquidPhaseName_;
//- Pointer to the underlying heat transfer model
autoPtr<heatTransferModel> heatTransferModel_;
//- Relaxation factor
const scalar relax_;
//- Bulk nucleation seed phase fraction
const scalar seedFraction_;
//- Run-time selected heat flux partitioning model
autoPtr<Foam::wallBoilingModels::partitioningModel>
partitioningModel_;
//- Run-time selected nucleation site density model
autoPtr<Foam::wallBoilingModels::nucleationSiteModel>
nucleationSiteModel_;
//- Run-time selected bubble departure diameter model
autoPtr<Foam::wallBoilingModels::departureDiameterModel>
departureDiamModel_;
//- Run-time selected bubble departure frequency model
autoPtr<Foam::wallBoilingModels::departureFrequencyModel>
departureFreqModel_;
//- At wall liquid phase fraction
mutable volScalarField wetFraction_;
//- Bubble departure diameter
mutable volScalarField dDep_;
//- Bubble departre frequency
mutable volScalarField fDep_;
//- Nucleation site density
mutable volScalarField nucleationSiteDensity_;
//- Evapouration mass transfer rate
mutable volScalarField dmdtf_;
//- Quenching heat transfer rate
mutable volScalarField qq_;
//- Wall Temperature
mutable volScalarField Tsurface_;
//- Heat transfer coefficient (needed because lagging)
mutable volScalarField K_;
public:
//- Runtime type information
TypeName("wallBoiling");
// Constructors
//- Construct from components
wallBoilingHeatTransfer
(
const dictionary& dict,
const phaseInterface& interface,
const bool registerObject
);
//- Destructor
virtual ~wallBoilingHeatTransfer();
// Member Functions
//- The heat transfer function K used in the enthalpy equation
tmp<volScalarField> K(const scalar residualAlpha) const;
//- Is there phase change mass transfer for this phaseInterface
bool activePhaseInterface(const phaseInterfaceKey&) const;
//- Key for the phase change phaseInterface
phaseInterfaceKey activePhaseInterface() const;
//- Return the rate of phase-change
const volScalarField& dmdtf() const;
//- Dummy write for regIOobject
bool writeData(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace heatTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -24,11 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "KocamustafaogullariIshiiDepartureDiameter.H"
#include "addToRunTimeSelectionTable.H"
#include "uniformDimensionedFields.H"
#include "compressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "wallBoilingModelsCoefficient.H"
#include "phaseSystem.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -50,6 +48,35 @@ namespace departureDiameterModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::departureDiameterModels::
KocamustafaogullariIshiiDepartureDiameter::calculate
(
const fvMesh& mesh,
const ScalarFieldType& Tl,
const ScalarFieldType& Tsatw,
const ScalarFieldType& L,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour,
const ScalarFieldType& sigma
) const
{
auto g = coefficient<ScalarFieldType>::value
(
mesh.lookupObject<uniformDimensionedVectorField>("g")
);
auto phi = coefficient<ScalarFieldType>::value(phi_);
return
0.0012*pow((rhoLiquid - rhoVapour)/rhoVapour, 0.9)*0.0208*phi
*sqrt(sigma/(mag(g)*(rhoLiquid - rhoVapour)));
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::departureDiameterModels::
@ -60,7 +87,7 @@ KocamustafaogullariIshiiDepartureDiameter
)
:
departureDiameterModel(),
phi_(dict.lookup<scalar>("phi"))
phi_("phi", dimless, dict)
{}
@ -98,23 +125,43 @@ KocamustafaogullariIshiiDepartureDiameter::dDeparture
const scalarField& L
) const
{
// Gravitational acceleration
const uniformDimensionedVectorField& g =
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(vapour.thermo().rho(patchi));
const scalarField rhoM((rhoLiquid - rhoVapor)/rhoVapor);
const scalarField sigmaw
(
liquid.fluid().sigma(phaseInterface(liquid, vapour), patchi)
);
return
0.0012*pow(rhoM, 0.9)*0.0208*phi_
*sqrt(sigmaw/(mag(g.value())*(rhoLiquid - rhoVapor)));
calculate
(
liquid.mesh(),
Tl,
Tsatw,
L,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::departureDiameterModels::
KocamustafaogullariIshiiDepartureDiameter::dDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L
) const
{
return calculate
(
liquid.mesh(),
liquid.thermo().T(),
Tsatw,
L,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -46,6 +46,7 @@ SourceFiles
#define KocamustafaogullariIshiiDepartureDiameter_H
#include "departureDiameterModel.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,7 +68,23 @@ class KocamustafaogullariIshiiDepartureDiameter
// Private Data
//- Contact angle
scalar phi_;
const dimensionedScalar phi_;
// Private Member Functions
//- Calculate and return the bubble departure diameter
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const fvMesh& mesh,
const ScalarFieldType& Tl,
const ScalarFieldType& Tsatw,
const ScalarFieldType& L,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapor,
const ScalarFieldType& sigma
) const;
public:
@ -75,6 +92,7 @@ public:
//- Runtime type information
TypeName("KocamustafaogullariIshii");
// Constructors
//- Construct from a dictionary
@ -102,18 +120,30 @@ public:
// Member Functions
//- Calculate and return the departure diameter field
//- Calculate and return the departure diameter field for a wall patch
virtual tmp<scalarField> dDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& vapor,
const label patchi,
const scalarField& Tl,
const scalarField& Tsatw,
const scalarField& L
) const;
//- Write
//- Calculate and return the departure diameter field for a stationary
// phase and fluid interface
virtual tmp<volScalarField> dDeparture
(
const phaseModel& liquid,
const phaseModel& vapor,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "TolubinskiKostanchuk.H"
#include "wallBoilingModelsCoefficient.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -46,6 +47,29 @@ namespace departureDiameterModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::departureDiameterModels::TolubinskiKostanchuk::
calculate
(
const ScalarFieldType& Tl,
const ScalarFieldType& Tsatw
) const
{
auto dRef = coefficient<ScalarFieldType>::value(dRef_);
auto dMax = coefficient<ScalarFieldType>::value(dMax_);
auto dMin = coefficient<ScalarFieldType>::value(dMin_);
const dimensionedScalar T45_(dimTemperature, 45);
auto T45 = coefficient<ScalarFieldType>::value(T45_);
return max(min(dRef*exp(- (Tsatw - Tl)/T45), dMax), dMin);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::departureDiameterModels::TolubinskiKostanchuk::
@ -55,9 +79,9 @@ TolubinskiKostanchuk
)
:
departureDiameterModel(),
dRef_(dict.lookupOrDefault<scalar>("dRef", 6e-4)),
dMax_(dict.lookupOrDefault<scalar>("dMax", 0.0014)),
dMin_(dict.lookupOrDefault<scalar>("dMin", 1e-6))
dRef_(dimensionedScalar::lookupOrDefault("dRef", dict, dimLength, 6e-4)),
dMax_(dimensionedScalar::lookupOrDefault("dMax", dict, dimLength, 0.0014)),
dMin_(dimensionedScalar::lookupOrDefault("dMin", dict, dimLength, 1e-6))
{}
@ -95,12 +119,31 @@ dDeparture
const scalarField& L
) const
{
return max(min(dRef_*exp(-(Tsatw - Tl)/45), dMax_), dMin_);
return calculate(Tl, Tsatw);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::departureDiameterModels::
TolubinskiKostanchuk::dDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L
) const
{
return calculate(liquid.thermo().T(), Tsatw);
}
void Foam::wallBoilingModels::departureDiameterModels::TolubinskiKostanchuk::
write(Ostream& os) const
write
(
Ostream& os
) const
{
departureDiameterModel::write(os);
writeEntry(os, "dRef", dRef_);

View File

@ -65,13 +65,24 @@ class TolubinskiKostanchuk
// Private Data
//- Coefficient of the temperature term
scalar dRef_;
const dimensionedScalar dRef_;
//- Maximum diameter
scalar dMax_;
const dimensionedScalar dMax_;
//- Minimum diameter
scalar dMin_;
const dimensionedScalar dMin_;
// Private Member Functions
//- Calculate and return the bubble departure diameter
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& Tl,
const ScalarFieldType& Tsatw
) const;
public:
@ -104,7 +115,7 @@ public:
// Member Functions
//- Calculate and return the departure diameter field
//- Calculate and return the departure diameter field for a wall patch
virtual tmp<scalarField> dDeparture
(
const phaseModel& liquid,
@ -115,7 +126,19 @@ public:
const scalarField& L
) const;
//- Write
//- Calculate and return the departure diameter field for a stationary
// phase and fluid interface
virtual tmp<volScalarField> dDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,4 +63,5 @@ void Foam::wallBoilingModels::departureDiameterModel::write(Ostream& os) const
writeEntry(os, "type", this->type());
}
// ************************************************************************* //

View File

@ -36,11 +36,8 @@ SourceFiles
#ifndef departureDiameterModel_H
#define departureDiameterModel_H
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,9 +64,7 @@ public:
autoPtr,
departureDiameterModel,
dictionary,
(
const dictionary& dict
),
(const dictionary& dict),
(dict)
);
@ -98,7 +93,7 @@ public:
// Member Functions
//- Calculate and return the departure diameter field
//- Calculate and return the departure diameter field for a wall patch
virtual tmp<scalarField> dDeparture
(
const phaseModel& liquid,
@ -109,7 +104,19 @@ public:
const scalarField& L
) const = 0;
//- Write
//- Calculate and return the departure diameter field for a stationary
// phase and fluid interface
virtual tmp<volScalarField> dDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L
) const = 0;
//- Write to stream
virtual void write(Ostream& os) const;

View File

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

View File

@ -24,10 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "Cole.H"
#include "wallBoilingModelsCoefficient.H"
#include "addToRunTimeSelectionTable.H"
#include "uniformDimensionedFields.H"
#include "compressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -49,6 +47,34 @@ namespace departureFrequencyModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::departureFrequencyModels::Cole::calculate
(
const fvMesh& mesh,
const ScalarFieldType& dDep,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour
) const
{
auto g = coefficient<ScalarFieldType>::value
(
mesh.lookupObject<uniformDimensionedVectorField>("g")
);
const dimensionedScalar dRhoMin_(dimDensity, 0.1);
auto dRhoMin = coefficient<ScalarFieldType>::value(dRhoMin_);
return
sqrt
(
4*mag(g)*max(rhoLiquid - rhoVapour, dRhoMin)/(3*dDep*rhoLiquid)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::departureFrequencyModels::Cole::Cole
@ -89,18 +115,36 @@ Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture
const scalarField& dDep
) const
{
// Gravitational acceleration
const uniformDimensionedVectorField& g =
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(vapour.thermo().rho(patchi));
return sqrt
return
calculate
(
4*mag(g).value()
*max(rhoLiquid - rhoVapor, scalar(0.1))
/(3*dDep*rhoLiquid)
liquid.mesh(),
dDep,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)()
);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tl,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep
) const
{
return
calculate
(
liquid.mesh(),
dDep,
liquid.thermo().rho()(),
vapour.thermo().rho()()
);
}

View File

@ -62,6 +62,19 @@ class Cole
:
public departureFrequencyModel
{
// Private Member Functions
//- Calculate and return the bubble departure frequency
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const fvMesh& mesh,
const ScalarFieldType& dDep,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour
) const;
public:
//- Runtime type information
@ -100,6 +113,18 @@ public:
const scalarField& L,
const scalarField& dDep
) const;
//- Calculate and return the bubble departure frequency
virtual tmp<volScalarField> fDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep
) const;
};

View File

@ -24,11 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "KocamustafaogullariIshiiDepartureFrequency.H"
#include "addToRunTimeSelectionTable.H"
#include "uniformDimensionedFields.H"
#include "compressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "wallBoilingModelsCoefficient.H"
#include "phaseSystem.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -50,14 +48,43 @@ namespace departureFrequencyModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::departureFrequencyModels::
KocamustafaogullariIshiiDepartureFrequency::calculate
(
const fvMesh& mesh,
const ScalarFieldType& dDep,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour,
const ScalarFieldType& sigma
) const
{
auto g = coefficient<ScalarFieldType>::value
(
mesh.lookupObject<uniformDimensionedVectorField>("g")
);
auto Cf = coefficient<ScalarFieldType>::value(Cf_);
return
(Cf/dDep)*pow025(sigma*mag(g)*(rhoLiquid - rhoVapour)/sqr(rhoLiquid));
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::departureFrequencyModels::
KocamustafaogullariIshiiDepartureFrequency::
KocamustafaogullariIshiiDepartureFrequency(const dictionary& dict)
KocamustafaogullariIshiiDepartureFrequency
(
const dictionary& dict
)
:
departureFrequencyModel(),
Cf_(dict.lookupOrDefault<scalar>("Cf", 1.18))
Cf_(dimensionedScalar::lookupOrDefault("Cf", dict, dimless, 1.18))
{}
@ -96,24 +123,39 @@ KocamustafaogullariIshiiDepartureFrequency::fDeparture
const scalarField& dDep
) const
{
// Gravitational acceleration
const uniformDimensionedVectorField& g =
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(min(vapour.thermo().rho(patchi), rhoLiquid));
const tmp<volScalarField> tsigma
return
calculate
(
liquid.fluid().sigma(phaseInterface(liquid, vapour))
liquid.mesh(),
dDep,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
const volScalarField& sigma = tsigma();
const fvPatchScalarField& sigmaw = sigma.boundaryField()[patchi];
return (Cf_/dDep)*pow025
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::departureFrequencyModels::
KocamustafaogullariIshiiDepartureFrequency::fDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep
) const
{
return
calculate
(
sigmaw*mag(g.value())*(rhoLiquid - rhoVapor)/sqr(rhoLiquid)
liquid.mesh(),
dDep,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -66,7 +66,21 @@ class KocamustafaogullariIshiiDepartureFrequency
// Private data
//- Model parameter
scalar Cf_;
const dimensionedScalar Cf_;
// Private Member Functions
//- Calculate and return the bubble departure frequency
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const fvMesh& mesh,
const ScalarFieldType& dDep,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour,
const ScalarFieldType& sigma
) const;
public:
@ -114,7 +128,19 @@ public:
const scalarField& dDep
) const;
//- Write
//- Calculate and return the bubble departure frequency
virtual tmp<volScalarField> fDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

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

View File

@ -40,6 +40,7 @@ SourceFiles
#include "dictionary.H"
#include "runTimeSelectionTables.H"
#include "uniformDimensionedFields.H"
#include "phaseModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,9 +68,7 @@ public:
autoPtr,
departureFrequencyModel,
dictionary,
(
const dictionary& dict
),
(const dictionary& dict),
(dict)
);
@ -110,7 +109,19 @@ public:
const scalarField& dDep
) const = 0;
//- Write
//- Calculate and return the bubble departure frequency
virtual tmp<volScalarField> fDeparture
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep
) const = 0;
//- Write to stream
virtual void write(Ostream& os) const;

View File

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

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "KocamustafaogullariIshiiNucleationSite.H"
#include "wallBoilingModelsCoefficient.H"
#include "addToRunTimeSelectionTable.H"
#include "phaseSystem.H"
@ -47,6 +48,45 @@ namespace nucleationSiteModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::nucleationSiteModels::
KocamustafaogullariIshiiNucleationSite::calculate
(
const ScalarFieldType& Tsatw,
const ScalarFieldType& L,
const ScalarFieldType& dDep,
const ScalarFieldType& Tw,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour,
const ScalarFieldType& sigma
) const
{
const ScalarFieldType rhoM((rhoLiquid - rhoVapour)/rhoVapour);
const dimensionedScalar zeroT_(dimTemperature, 0);
auto zeroT = coefficient<ScalarFieldType>::value(zeroT_);
auto Cn = coefficient<ScalarFieldType>::value(Cn_);
// eq. (32)
const ScalarFieldType f
(
2.157e-7*pow(rhoM, -3.2)*pow(1 + 0.0049*rhoM, 4.13)
);
// eq. (17)
const ScalarFieldType rRc
(
dDep*max(Tw - Tsatw, zeroT)*rhoVapour*L/(4*sigma*Tsatw)
);
return Cn/sqr(dDep)*pow(rRc, 4.4)*f;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::nucleationSiteModels::
@ -56,7 +96,7 @@ KocamustafaogullariIshiiNucleationSite::KocamustafaogullariIshiiNucleationSite
)
:
nucleationSiteModel(),
Cn_(dict.lookupOrDefault<scalar>("Cn", 1))
Cn_(dimensionedScalar::lookupOrDefault("Cn", dict, dimless, 1))
{}
@ -95,25 +135,47 @@ KocamustafaogullariIshiiNucleationSite::nucleationSiteDensity
const scalarField& fDep
) const
{
const fvPatchScalarField& Tw =
const scalarField& Tw =
liquid.thermo().T().boundaryField()[patchi];
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(vapour.thermo().rho(patchi));
const scalarField rhoM((rhoLiquid - rhoVapor)/rhoVapor);
const scalarField sigmaw
return
calculate
(
liquid.fluid().sigma(phaseInterface(liquid, vapour), patchi)
Tsatw,
L,
dDep,
Tw,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
//eq. (32)
const scalarField f(2.157e-7*pow(rhoM,-3.2)*pow(1 + 0.0049*rhoM,4.13));
// eq. (17)
const scalarField rRc(max(Tw-Tsatw,scalar(0))*rhoVapor*L/(2*sigmaw*Tsatw));
return (Cn_/sqr(dDep))*pow(rRc,4.4)*f;
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::nucleationSiteModels::
KocamustafaogullariIshiiNucleationSite::nucleationSiteDensity
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep,
const volScalarField& fDep
) const
{
return calculate
(
Tsatw,
L,
dDep,
Tf,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -64,8 +64,24 @@ class KocamustafaogullariIshiiNucleationSite
{
// Private data:
//- User adjustable coefficient for nucleation density
scalar Cn_;
//- Nucleation density coefficient
const dimensionedScalar Cn_;
// Private Member Functions
//- Calculate and return the nucleation site density
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& Tsatw,
const ScalarFieldType& L,
const ScalarFieldType& dDep,
const ScalarFieldType& Tw,
const ScalarFieldType& rhoLiquid,
const ScalarFieldType& rhoVapour,
const ScalarFieldType& sigma
) const;
public:
@ -113,7 +129,20 @@ public:
const scalarField& fDep
) const;
//- Write
//- Calculate and return the nucleation-site density
virtual tmp<volScalarField> nucleationSiteDensity
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep,
const volScalarField& fDep
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

@ -25,6 +25,7 @@ License
#include "LemmertChawla.H"
#include "addToRunTimeSelectionTable.H"
#include "wallBoilingModelsCoefficient.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -46,6 +47,24 @@ namespace nucleationSiteModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::calculate
(
const ScalarFieldType& Tsatw,
const ScalarFieldType& Tw
) const
{
auto Cn = coefficient<ScalarFieldType>::value(Cn_);
auto NRef = coefficient<ScalarFieldType>::value(NRef_);
auto deltaTRef = coefficient<ScalarFieldType>::value(deltaTRef_);
return Cn*NRef*pow(max((Tw - Tsatw)/deltaTRef, scalar(0)), 1.805);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::LemmertChawla
@ -54,9 +73,27 @@ Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::LemmertChawla
)
:
nucleationSiteModel(),
Cn_(dict.lookupOrDefault<scalar>("Cn", 1)),
NRef_(dict.lookupOrDefault<scalar>("NRef", 9.922e5)),
deltaTRef_(dict.lookupOrDefault<scalar>("deltaTRef", 10))
Cn_(dimensionedScalar::lookupOrDefault("Cn", dict, dimless, 1)),
NRef_
(
dimensionedScalar::lookupOrDefault
(
"NRef",
dict,
dimless/dimArea,
9.922e5
)
),
deltaTRef_
(
dimensionedScalar::lookupOrDefault
(
"deltaTRef",
dict,
dimTemperature,
10
)
)
{}
@ -94,10 +131,28 @@ nucleationSiteDensity
const scalarField& fDep
) const
{
const fvPatchScalarField& Tw =
const scalarField& Tw =
liquid.thermo().T().boundaryField()[patchi];
return Cn_*NRef_*pow(max((Tw - Tsatw)/deltaTRef_, scalar(0)), 1.805);
return calculate(Tsatw, Tw);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::
nucleationSiteDensity
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep,
const volScalarField& fDep
) const
{
return calculate(Tsatw, Tf);
}

View File

@ -69,14 +69,25 @@ class LemmertChawla
{
// Private Data
//- Coefficient for nucleation site density
scalar Cn_;
//- Nucleation density coefficient
const dimensionedScalar Cn_;
//- Reference nucleations density
scalar NRef_;
//- Reference nucleation density
const dimensionedScalar NRef_;
//- Reference temperature difference
scalar deltaTRef_;
const dimensionedScalar deltaTRef_;
// Private Member Functions
//- Calculate and return the nucleation site density
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& Tsatw,
const ScalarFieldType& Tw
) const;
public:
@ -118,7 +129,20 @@ public:
const scalarField& fDep
) const;
//- Write
//- Calculate and return the nucleation-site density
virtual tmp<volScalarField> nucleationSiteDensity
(
const phaseModel& liquid,
const phaseModel& vapour,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep,
const volScalarField& fDep
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

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

View File

@ -67,9 +67,7 @@ public:
autoPtr,
nucleationSiteModel,
dictionary,
(
const dictionary& dict
),
(const dictionary& dict),
(dict)
);
@ -111,7 +109,20 @@ public:
const scalarField& fDep
) const = 0;
//- Write
//- Calculate and return the nucleation-site density
virtual tmp<volScalarField> nucleationSiteDensity
(
const phaseModel& liquid,
const phaseModel& vapor,
const phaseModel& solid,
const volScalarField& Tf,
const volScalarField& Tsatw,
const volScalarField& L,
const volScalarField& dDep,
const volScalarField& fDep
) const = 0;
//- Write to stream
virtual void write(Ostream& os) const;

View File

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

View File

@ -46,6 +46,27 @@ namespace partitioningModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::partitioningModels::Lavieville::calculate
(
const ScalarFieldType& alphaLiquid
) const
{
return
pos0(alphaLiquid - alphaCrit_)
*(
1 - 0.5*exp(-20*(alphaLiquid - alphaCrit_))
)
+ neg(alphaLiquid - alphaCrit_)
*(
0.5*pow(alphaLiquid/alphaCrit_, 20*alphaCrit_)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::partitioningModels::Lavieville::Lavieville
@ -82,15 +103,17 @@ Foam::wallBoilingModels::partitioningModels::Lavieville::wetFraction
const scalarField& alphaLiquid
) const
{
return
pos0(alphaLiquid - alphaCrit_)
*(
1 - 0.5*exp(-20*(alphaLiquid - alphaCrit_))
)
+ neg(alphaLiquid - alphaCrit_)
*(
0.5*pow(alphaLiquid/alphaCrit_, 20*alphaCrit_)
);
return calculate(alphaLiquid);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::partitioningModels::Lavieville::wetFraction
(
const volScalarField& alphaLiquid
) const
{
return calculate(alphaLiquid);
}

View File

@ -68,7 +68,17 @@ class Lavieville
// Private Data
//- Critical liquid fraction
scalar alphaCrit_;
const scalar alphaCrit_;
// Private Member Functions
//- Calculate and return the wet fraction
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& alphaLiquid
) const;
public:
@ -104,7 +114,13 @@ public:
const scalarField& alphaLiquid
) const;
//- Write
//- Return the wet fraction
virtual tmp<volScalarField> wetFraction
(
const volScalarField& alphaLiquid
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

@ -46,6 +46,35 @@ namespace partitioningModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::partitioningModels::cosine::calculate
(
const ScalarFieldType& alphaLiquid
) const
{
return
pos0(alphaLiquid1_ - alphaLiquid)
*(
neg(alphaLiquid0_ - alphaLiquid)
*(
0.5
*(
1 - cos
(
constant::mathematical::pi
*(alphaLiquid - alphaLiquid0_)
/(alphaLiquid1_ - alphaLiquid0_)
)
)
)
)
+ neg(alphaLiquid1_ - alphaLiquid);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::partitioningModels::cosine::cosine
@ -84,23 +113,17 @@ Foam::wallBoilingModels::partitioningModels::cosine::wetFraction
const scalarField& alphaLiquid
) const
{
return
pos0(alphaLiquid1_ - alphaLiquid)
*(
neg(alphaLiquid0_ - alphaLiquid)
*(
0.5
*(
1 - cos
(
constant::mathematical::pi
*(alphaLiquid - alphaLiquid0_)
/(alphaLiquid1_ - alphaLiquid0_)
)
)
)
)
+ neg(alphaLiquid1_ - alphaLiquid);
return calculate(alphaLiquid);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::partitioningModels::cosine::wetFraction
(
const volScalarField& alphaLiquid
) const
{
return calculate(alphaLiquid);
}

View File

@ -69,10 +69,20 @@ class cosine
// Private Data
//- Lower threshold liquid phase fraction
scalar alphaLiquid0_;
const scalar alphaLiquid0_;
//- Upper threshold liquid phase fraction
scalar alphaLiquid1_;
const scalar alphaLiquid1_;
// Private Member Functions
//- Calculate and return the wet fraction
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& alphaLiquid
) const;
public:
@ -108,7 +118,13 @@ public:
const scalarField& alphaLiquid
) const;
//- Write
//- Return the wet fraction
virtual tmp<volScalarField> wetFraction
(
const volScalarField& alphaLiquid
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

@ -46,6 +46,28 @@ namespace partitioningModels
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ScalarFieldType>
Foam::tmp<ScalarFieldType>
Foam::wallBoilingModels::partitioningModels::linear::calculate
(
const ScalarFieldType& alphaLiquid
) const
{
return
min
(
max
(
(alphaLiquid - alphaLiquid0_)/(alphaLiquid1_ - alphaLiquid0_),
scalar(0)
),
scalar(1)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallBoilingModels::partitioningModels::linear::linear
@ -84,16 +106,17 @@ Foam::wallBoilingModels::partitioningModels::linear::wetFraction
const scalarField& alphaLiquid
) const
{
return
min
(
max
(
(alphaLiquid - alphaLiquid0_)/(alphaLiquid1_ - alphaLiquid0_),
scalar(0)
),
scalar(1)
);
return calculate(alphaLiquid);
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::partitioningModels::linear::wetFraction
(
const volScalarField& alphaLiquid
) const
{
return calculate(alphaLiquid);
}

View File

@ -70,10 +70,20 @@ class linear
// Private Data
//- Lower threshold liquid phase fraction
scalar alphaLiquid0_;
const scalar alphaLiquid0_;
//- Upper threshold liquid phase fraction
scalar alphaLiquid1_;
const scalar alphaLiquid1_;
// Private Member Functions
//- Calculate and return the wet fraction
template<class ScalarFieldType>
tmp<ScalarFieldType> calculate
(
const ScalarFieldType& alphaLiquid
) const;
public:
@ -109,7 +119,13 @@ public:
const scalarField& alphaLiquid
) const;
//- Write
//- Return the wet fraction
virtual tmp<volScalarField> wetFraction
(
const volScalarField& alphaLiquid
) const;
//- Write to stream
virtual void write(Ostream& os) const;
};

View File

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

View File

@ -65,9 +65,7 @@ public:
autoPtr,
partitioningModel,
dictionary,
(
const dictionary& dict
),
(const dictionary& dict),
(dict)
);
@ -102,7 +100,13 @@ public:
const scalarField& alphaLiquid
) const = 0;
//- Write
//- Return the wet fraction
virtual tmp<volScalarField> wetFraction
(
const volScalarField& alphaLiquid
) const = 0;
//- Write to stream
virtual void write(Ostream& os) const;

View File

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

View File

@ -84,4 +84,14 @@ Foam::wallBoilingModels::partitioningModels::phaseFraction::wetFraction
}
Foam::tmp<Foam::volScalarField>
Foam::wallBoilingModels::partitioningModels::phaseFraction::wetFraction
(
const volScalarField& alphaLiquid
) const
{
return tmp<volScalarField>(alphaLiquid);
}
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 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/>.
Namespace
Foam::wallBoilingModels
\*---------------------------------------------------------------------------*/
#ifndef wallBoilingModelsCoefficient_H
#define wallBoilingModelsCoefficient_H
#include "dimensionedTypes.H"
#include "volFieldsFwd.H"
#include "UniformDimensionedField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace wallBoilingModels
{
template<class FieldType>
struct coefficient;
template<class Type>
struct coefficient<Field<Type>>
{
template<class Type2>
static const Type2& value(const dimensioned<Type2>& v)
{
return v.value();
}
template<class Type2>
static const Type2& value(const UniformDimensionedField<Type2>& v)
{
return v.value();
}
};
template<class Type>
struct coefficient<VolField<Type>>
{
template<class Type2>
static const dimensioned<Type2>& value(const dimensioned<Type2>& v)
{
return v;
}
template<class Type2>
static const dimensioned<Type2>& value
(
const UniformDimensionedField<Type2>& v
)
{
return v;
}
};
} // End namespace wallBoilingModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,6 +27,8 @@ diameterModels/constantDiameter/constantDiameter.C
diameterModels/isothermalDiameter/isothermalDiameter.C
diameterModels/linearTsubDiameter/linearTsubDiameter.C
diameterModels/noDiameter/noDiameter.C
diameterModels/residualDiameter/residualDiameter.C
diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.C
diameterModels/velocityGroup/velocityGroup.C
diameterModels/IATE/IATE.C

View File

@ -29,6 +29,7 @@ License
#include "fvcVolumeIntegrate.H"
#include "fvmSup.H"
#include "rhoMulticomponentThermo.H"
#include "wallBoilingHeatTransfer.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -185,6 +186,30 @@ ThermalPhaseChangePhaseSystem
)
);
Tsats_.insert
(
interface,
new volScalarField
(
IOobject
(
IOobject::groupName
(
"thermalPhaseChange:Tsat",
interface.name()
),
this->mesh().time().name(),
this->mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
saturationModels_[interface]->Tsat
(
interface.phase1().thermo().p()
)
)
);
nDmdtfs_.insert
(
interface,
@ -363,7 +388,8 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
this->addDmidtHefs
(
dmidtfs,
Tfs_,
//Tfs_,
Tsats_,
latentHeatScheme::upwind,
latentHeatTransfer::mass,
eqns
@ -399,7 +425,8 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
this->addDmdtHefs
(
dmdtfs_,
Tfs_,
//Tfs_,
Tsats_,
latentHeatScheme::upwind,
latentHeatTransfer::mass,
eqns
@ -513,6 +540,18 @@ template<class BasePhaseSystem>
void
Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
{
typedef
Foam::heatTransferModels::wallBoilingHeatTransfer
wallBoilingHeatTransferModel;
HashTable<const wallBoilingHeatTransferModel*>
wallBoilingHeatTransferModels =
this->mesh().template lookupClass<wallBoilingHeatTransferModel>();
typedef
compressible::alphatPhaseChangeWallFunctionBase
alphatPhaseChangeWallFunction;
forAllConstIter
(
saturationModelTable,
@ -536,7 +575,8 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
volScalarField& dmdtf(*this->dmdtfs_[interface]);
volScalarField& Tf(*this->Tfs_[interface]);
Tf = saturationModelIter()->Tsat(thermo1.p());
volScalarField& Tsat(*this->Tsats_[interface]);
Tsat = saturationModelIter()->Tsat(thermo1.p());
const volScalarField L
(
@ -546,14 +586,14 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
interface,
volatile_,
dmdtf,
Tf,
Tsat,
latentHeatScheme::symmetric
)
: this->L
(
interface,
dmdtf,
Tf,
Tsat,
latentHeatScheme::symmetric
)
);
@ -561,7 +601,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
volScalarField H1(heatTransferModel.modelInThe(phase1).K(0));
volScalarField H2(heatTransferModel.modelInThe(phase2).K(0));
volScalarField dmdtfNew((H1*(Tf - T1) + H2*(Tf - T2))/L);
volScalarField dmdtfNew((H1*(Tsat - T1) + H2*(Tsat - T2))/L);
if (volatile_ != "none")
{
@ -594,9 +634,6 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
}
}
/* Needs to be included if the code is to be compiled with
latentHeatTransfer::heat flag in heatTransfer()
H1 = heatTransferModel.modelInThe(phase1).K();
H2 = heatTransferModel.modelInThe(phase2).K();
@ -605,7 +642,12 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
H2.max(small);
Tf = (H1*T1 + H2*T2 + dmdtfNew*L)/(H1 + H2);
*/
Info<< Tsat.name()
<< ": min = " << gMin(Tsat.primitiveField())
<< ", mean = " << gAverage(Tsat.primitiveField())
<< ", max = " << gMax(Tsat.primitiveField())
<< endl;
Info<< Tf.name()
<< ": min = " << gMin(Tf.primitiveField())
@ -628,15 +670,30 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
// Nucleation mass transfer update
{
typedef
compressible::alphatPhaseChangeWallFunctionBase
alphatWallFunction;
volScalarField& nDmdtf(*this->nDmdtfs_[interface]);
nDmdtf = Zero;
bool wallBoilingActive = false;
forAllConstIter
(
HashTable<const wallBoilingHeatTransferModel*>,
wallBoilingHeatTransferModels,
wallBoilingHeatTransferModelIter
)
{
const wallBoilingHeatTransferModel& wbht =
*wallBoilingHeatTransferModelIter();
if (!wbht.activePhaseInterface(interface)) continue;
wallBoilingActive = true;
nDmdtf +=
(interface == wbht.activePhaseInterface() ? +1 : -1)
*wbht.dmdtf();
}
forAllConstIter(phaseInterface, interface, interfaceIter)
{
const phaseModel& phase = interfaceIter();
@ -655,10 +712,10 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
const fvPatchScalarField& alphatp =
alphat.boundaryField()[patchi];
if (!isA<alphatWallFunction>(alphatp)) continue;
if (!isA<alphatPhaseChangeWallFunction>(alphatp)) continue;
const alphatWallFunction& alphatw =
refCast<const alphatWallFunction>(alphatp);
const alphatPhaseChangeWallFunction& alphatw =
refCast<const alphatPhaseChangeWallFunction>(alphatp);
if (!alphatw.activeInterface(interface)) continue;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,6 +107,9 @@ class ThermalPhaseChangePhaseSystem
//- Interface temperatures
phaseSystem::dmdtfTable Tfs_;
//- Saturation temperatures
phaseSystem::dmdtfTable Tsats_;
//- Nucleate Mass transfer rates
phaseSystem::dmdtfTable nDmdtfs_;

View File

@ -0,0 +1,145 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 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 "fixedInterfacialAreaDiameter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
defineTypeNameAndDebug(fixedInterfacialArea, 0);
addToRunTimeSelectionTable(diameterModel, fixedInterfacialArea, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::fixedInterfacialArea::fixedInterfacialArea
(
const dictionary& diameterProperties,
const phaseModel& phase
)
:
diameterModel(diameterProperties, phase),
AvbyAlpha_(inv(dimLength), -1),
AvbyAlphaFieldPtr_()
{
read(diameterProperties);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::fixedInterfacialArea::~fixedInterfacialArea()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::fixedInterfacialArea::d()
const
{
if (AvbyAlphaFieldPtr_.valid())
{
const volScalarField& AvbyAlpha = AvbyAlphaFieldPtr_;
return 6/AvbyAlpha;
}
return volScalarField::New
(
IOobject::groupName("d", phase().name()),
phase().mesh(),
6/AvbyAlpha_
);
}
Foam::tmp<Foam::volScalarField> Foam::diameterModels::fixedInterfacialArea::Av()
const
{
if (AvbyAlphaFieldPtr_.valid())
{
const volScalarField& AvbyAlpha = AvbyAlphaFieldPtr_;
return phase()*AvbyAlpha;
}
return phase()*AvbyAlpha_;
}
bool Foam::diameterModels::fixedInterfacialArea::
read(const dictionary& phaseProperties)
{
diameterModel::read(phaseProperties);
AvbyAlpha_ = dimensionedScalar
(
inv(dimLength),
diameterProperties().lookupOrDefault<scalar>("AvbyAlpha", -1)
);
if (AvbyAlpha_.value() < 0 && !AvbyAlphaFieldPtr_.valid())
{
Info<< "fixedInterfacialArea: Uniform AvbyAlpha not provided. "
<< "Looking up " << IOobject::groupName("AvbyAlpha", phase().name())
<< endl;
AvbyAlphaFieldPtr_ =
new volScalarField
(
IOobject
(
IOobject::groupName
(
"AvbyAlpha",
phase().name()
),
phase().mesh().time().name(),
phase().mesh(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
phase().mesh()
);
AvbyAlphaFieldPtr_->max
(
phaseProperties.lookupOrDefault<scalar>
(
"residualAvbyAlpha",
rootSmall
)
);
}
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 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::diameterModels::fixedInterfacialArea
Description
fixedInterfacialArea dispersed-phase diameter model.
The interfacial are is set by providing phase surface area divided by phase
volume, AvbyAlpha, etiher as a constant value or as a field.
SourceFiles
fixedInterfacialAreaDiameter.C
\*---------------------------------------------------------------------------*/
#ifndef fixedInterfacialAreaDiameter_H
#define fixedInterfacialAreaDiameter_H
#include "diameterModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
/*---------------------------------------------------------------------------*\
Class fixedInterfacialArea Declaration
\*---------------------------------------------------------------------------*/
class fixedInterfacialArea
:
public diameterModel
{
// Private Data
//- Uniform fixed area by volume of the stationary phase for calculation
// of the interfacial area
dimensionedScalar AvbyAlpha_;
//- Optional area by volume field of the stationary phase for
// calculation of interfacial area
autoPtr<volScalarField> AvbyAlphaFieldPtr_;
public:
//- Runtime type information
TypeName("fixedInterfacialArea");
// Constructors
//- Construct from dictionary and phase
fixedInterfacialArea
(
const dictionary& diameterProperties,
const phaseModel& phase
);
//- Destructor
virtual ~fixedInterfacialArea();
// Member Functions
//- Get the diameter field
virtual tmp<volScalarField> d() const;
//- Get the surface area per unit volume field
virtual tmp<volScalarField> Av() const;
//- Read diameterProperties dictionary
virtual bool read(const dictionary& diameterProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 VTT Technical Research Centre of Finland Ltd
-------------------------------------------------------------------------------
License
This file is a derivative work 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 "residualDiameter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
defineTypeNameAndDebug(residualDiameter, 0);
addToRunTimeSelectionTable
(
diameterModel,
residualDiameter,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::residualDiameter::residualDiameter
(
const dictionary& diameterProperties,
const phaseModel& phase
)
:
spherical(diameterProperties, phase),
d_("d", dimLength, diameterProperties),
dResidual_("dResidual", dimLength, diameterProperties)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::residualDiameter::~residualDiameter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::residualDiameter::
d() const
{
return
pos0(phase()-phase().residualAlpha())*d_
+ neg(phase()-phase().residualAlpha())*dResidual_;
}
bool Foam::diameterModels::residualDiameter::read
(
const dictionary& phaseProperties
)
{
spherical::read(phaseProperties);
diameterProperties().lookup("d") >> d_;
diameterProperties().lookup("dResidual") >> dResidual_;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 VTT Technical Research Centre of Finland Ltd
-------------------------------------------------------------------------------
License
This file is a derivative work 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::diameterModels::residualDiameter
Description
A diameter model which switches form constant diameter to constant residual
diameter when the volume fraction of the phase is below residualAlpha.
A typical use case for this is to set a small residual diameter to prevent
excessive phase velocities in regions where the phase volume fraction is
small.
SourceFiles
residualDiameter.C
\*---------------------------------------------------------------------------*/
#ifndef residualDiameter_H
#define residualDiameter_H
#include "sphericalDiameter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
/*---------------------------------------------------------------------------*\
Class residualDiameter Declaration
\*---------------------------------------------------------------------------*/
class residualDiameter
:
public spherical
{
// Private data
//- The diameter used when the volume fraction is above residualAlpha
dimensionedScalar d_;
//- The diameter used when the volume fraction is below residualAlpha
dimensionedScalar dResidual_;
public:
//- Runtime type information
TypeName("residualDiameter");
// Constructors
residualDiameter
(
const dictionary& diameterProperties,
const phaseModel& phase
);
//- Destructor
virtual ~residualDiameter();
// Member Functions
//- Get the diameter field
virtual tmp<volScalarField> d() const;
//- Read diameterProperties dictionary
virtual bool read(const dictionary& diameterProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,6 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "phaseInterface.H"
#include "sidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
@ -102,4 +103,22 @@ const Foam::phaseModel& Foam::sidedPhaseInterface::otherPhase() const
}
Foam::autoPtr<Foam::phaseInterface>
Foam::sidedPhaseInterface::otherInterface() const
{
wordList nameParts = phaseInterface::nameToNameParts(fluid(), name());
const label i =
findIndex(nameParts, sidedPhaseInterface::separator());
nameParts[i+1] = otherPhase().name();
return phaseInterface::New
(
fluid(),
phaseInterface::namePartsToName(fluid(), nameParts)
);
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,6 +107,9 @@ public:
//- Phase on the other side of the interface
const phaseModel& otherPhase() const;
//- Interface on the other side of the interface
autoPtr<phaseInterface> otherInterface() const;
};