diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files index ee88bf056c..3428d0d562 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files @@ -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 diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C index d63b91af48..bbf6f17dd0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.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"); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H index f447cec10d..6c70ea4151 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H @@ -120,9 +120,6 @@ public: //- Return the phase mean diameter field virtual tmp d() const = 0; - //- Correct the diameter field - virtual void correct(); - //- Read phaseProperties dictionary virtual bool read(const dictionary& phaseProperties) = 0; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C index 6cc41f4830..cc8ce61e4d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C @@ -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::diameterModels::isothermal::d() const { - const volScalarField& p = phase_.db().lookupObject - ( - "p" - ); + const volScalarField& p = phase_.db().lookupObject("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_; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H index 768ad080a5..ba9c84e109 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H @@ -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 d() const; - //- Correct the diameter field - virtual void correct(); - //- Read phaseProperties dictionary virtual bool read(const dictionary& phaseProperties); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C new file mode 100644 index 0000000000..e543453398 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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::diameterModels::linearTsub::d() const +{ + // Lookup the fluid model + const phaseSystem& fluid = + refCast + ( + phase_.mesh().lookupObject("phaseProperties") + ); + + const phaseModel& liquid(fluid.phases()[liquidPhaseName_]); + + if (phase_.mesh().foundObject("saturationModel")) + { + const saturationModel& satModel = + phase_.mesh().lookupObject("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; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H new file mode 100644 index 0000000000..2739e4db4c --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H @@ -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 . + +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 d() const; + + //- Read phaseProperties dictionary + virtual bool read(const dictionary& phaseProperties); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index 93f7842458..bdd02059f1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -138,9 +138,7 @@ const Foam::autoPtr& Foam::phaseModel::dPtr() const void Foam::phaseModel::correct() -{ - diameterModel_->correct(); -} +{} void Foam::phaseModel::correctKinematics()