reactingEulerFoam: Added linearTsub diameter model
This is a model for the diameter of vapour bubbles. It calculates the diameter as a linear function of the liquid sub-cooling. Also removed the correct method from diameterModel, as it wasn't really doing anything except facilitating the update of diameter fields to be written out. Derived sub-models can control this locally without polluting the base interface. Based on patch contributed by by Juho Peltola, VTT.
This commit is contained in:
@ -12,6 +12,7 @@ diameterModels/diameterModel/diameterModel.C
|
||||
diameterModels/diameterModel/newDiameterModel.C
|
||||
diameterModels/constantDiameter/constantDiameter.C
|
||||
diameterModels/isothermalDiameter/isothermalDiameter.C
|
||||
diameterModels/linearTsubDiameter/linearTsubDiameter.C
|
||||
diameterModels/velocityGroup/velocityGroup.C
|
||||
|
||||
populationBalanceModel/populationBalanceModel/populationBalanceModel.C
|
||||
|
||||
@ -55,10 +55,6 @@ Foam::diameterModel::~diameterModel()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diameterModel::correct()
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::diameterModel::read(const dictionary& phaseProperties)
|
||||
{
|
||||
diameterProperties_ = phaseProperties.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
@ -120,9 +120,6 @@ public:
|
||||
//- Return the phase mean diameter field
|
||||
virtual tmp<volScalarField> d() const = 0;
|
||||
|
||||
//- Correct the diameter field
|
||||
virtual void correct();
|
||||
|
||||
//- Read phaseProperties dictionary
|
||||
virtual bool read(const dictionary& phaseProperties) = 0;
|
||||
};
|
||||
|
||||
@ -66,7 +66,7 @@ Foam::diameterModels::isothermal::isothermal
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
phase_.mesh(),
|
||||
dimensionedScalar("d", dimLength, 0.0)
|
||||
d0_
|
||||
)
|
||||
{}
|
||||
|
||||
@ -81,18 +81,11 @@ Foam::diameterModels::isothermal::~isothermal()
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
|
||||
{
|
||||
const volScalarField& p = phase_.db().lookupObject<volScalarField>
|
||||
(
|
||||
"p"
|
||||
);
|
||||
const volScalarField& p = phase_.db().lookupObject<volScalarField>("p");
|
||||
|
||||
return d0_*pow(p0_/p, 1.0/3.0);
|
||||
}
|
||||
d_ = d0_*pow(p0_/p, 1.0/3.0);
|
||||
|
||||
|
||||
void Foam::diameterModels::isothermal::correct()
|
||||
{
|
||||
d_ = d();
|
||||
return d_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ class isothermal
|
||||
dimensionedScalar p0_;
|
||||
|
||||
//- Actual diameter field
|
||||
volScalarField d_;
|
||||
mutable volScalarField d_;
|
||||
|
||||
|
||||
public:
|
||||
@ -89,9 +89,6 @@ public:
|
||||
//- Return the diameter field
|
||||
virtual tmp<volScalarField> d() const;
|
||||
|
||||
//- Correct the diameter field
|
||||
virtual void correct();
|
||||
|
||||
//- Read phaseProperties dictionary
|
||||
virtual bool read(const dictionary& phaseProperties);
|
||||
};
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "linearTsubDiameter.H"
|
||||
#include "phaseSystem.H"
|
||||
#include "saturationModel.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
defineTypeNameAndDebug(linearTsub, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
diameterModel,
|
||||
linearTsub,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::linearTsub::linearTsub
|
||||
(
|
||||
const dictionary& diameterProperties,
|
||||
const phaseModel& phase
|
||||
)
|
||||
:
|
||||
diameterModel(diameterProperties, phase),
|
||||
liquidPhaseName_(diameterProperties.lookup("liquidPhase")),
|
||||
d2_("d2", dimLength, diameterProperties.lookupOrDefault("d2", 0.0015)),
|
||||
Tsub2_
|
||||
(
|
||||
"Tsub2",
|
||||
dimTemperature,
|
||||
diameterProperties.lookupOrDefault("Tsub2", 0)
|
||||
),
|
||||
d1_
|
||||
(
|
||||
"d1",
|
||||
dimLength,
|
||||
diameterProperties.lookupOrDefault("d1", 0.00015)
|
||||
),
|
||||
Tsub1_
|
||||
(
|
||||
"Tsub1",
|
||||
dimTemperature,
|
||||
diameterProperties.lookupOrDefault("Tsub1", 13.5)
|
||||
),
|
||||
d_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("d", phase.name()),
|
||||
phase_.time().timeName(),
|
||||
phase_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
phase_.mesh(),
|
||||
d1_
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::linearTsub::~linearTsub()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::linearTsub::d() const
|
||||
{
|
||||
// Lookup the fluid model
|
||||
const phaseSystem& fluid =
|
||||
refCast<const phaseSystem>
|
||||
(
|
||||
phase_.mesh().lookupObject<phaseSystem>("phaseProperties")
|
||||
);
|
||||
|
||||
const phaseModel& liquid(fluid.phases()[liquidPhaseName_]);
|
||||
|
||||
if (phase_.mesh().foundObject<saturationModel>("saturationModel"))
|
||||
{
|
||||
const saturationModel& satModel =
|
||||
phase_.mesh().lookupObject<saturationModel>("saturationModel");
|
||||
|
||||
const volScalarField Tsub
|
||||
(
|
||||
liquid.thermo().T() - satModel.Tsat(liquid.thermo().p())
|
||||
);
|
||||
|
||||
d_ = max
|
||||
(
|
||||
d1_,
|
||||
min
|
||||
(
|
||||
d2_,
|
||||
(d1_*(Tsub - Tsub2_) + d2_*(Tsub - Tsub1_))/(Tsub2_ - Tsub1_)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return d_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::diameterModels::linearTsub::read(const dictionary& phaseProperties)
|
||||
{
|
||||
diameterModel::read(phaseProperties);
|
||||
diameterProperties_.lookup("liquidPhase") >> liquidPhaseName_;
|
||||
diameterProperties_.lookup("d2") >> d2_;
|
||||
diameterProperties_.lookup("Tsub2") >> Tsub2_;
|
||||
diameterProperties_.lookup("d1") >> d1_;
|
||||
diameterProperties_.lookup("Tsub1") >> Tsub1_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::linearTsub
|
||||
|
||||
Description
|
||||
Vapour bubble diameter model for modelling of condensation of vapour
|
||||
bubbles. Calculates bubble diameter as a function of liquid phase
|
||||
subcooling.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Anglart, H., Nylund, O., Kurul, N., & Podowski, M. Z. (1997).
|
||||
CFD prediction of flow and phase distribution in fuel assemblies with
|
||||
spacers.
|
||||
Nuclear Engineering and Design, 177(1-3), 215-228.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
linearTsub.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linearTsubDiameter_H
|
||||
#define linearTsubDiameter_H
|
||||
|
||||
#include "diameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linearTsub Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linearTsub
|
||||
:
|
||||
public diameterModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of the liquid phase that is used to determine subcooling
|
||||
// temperature
|
||||
word liquidPhaseName_;
|
||||
|
||||
//- Reference diameter for low subcooling temperature
|
||||
dimensionedScalar d2_;
|
||||
|
||||
//- Subcooling temperature where low subcooling diamter is reached
|
||||
dimensionedScalar Tsub2_;
|
||||
|
||||
//- Reference diameter for high subcooling temperature
|
||||
dimensionedScalar d1_;
|
||||
|
||||
//- Subcooling temperature where high subcooling diamter is reached
|
||||
dimensionedScalar Tsub1_;
|
||||
|
||||
//- Actual diameter field
|
||||
mutable volScalarField d_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linearTsub");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
linearTsub
|
||||
(
|
||||
const dictionary& diameterProperties,
|
||||
const phaseModel& phase
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~linearTsub();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the diameter field
|
||||
virtual tmp<volScalarField> d() const;
|
||||
|
||||
//- Read phaseProperties dictionary
|
||||
virtual bool read(const dictionary& phaseProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace diameterModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -138,9 +138,7 @@ const Foam::autoPtr<Foam::diameterModel>& Foam::phaseModel::dPtr() const
|
||||
|
||||
|
||||
void Foam::phaseModel::correct()
|
||||
{
|
||||
diameterModel_->correct();
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctKinematics()
|
||||
|
||||
Reference in New Issue
Block a user