diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/Make/files b/applications/solvers/modules/multiphaseEuler/interfacialModels/Make/files index 34547fec68..8970e35504 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/Make/files +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/Make/files @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.C index 609df7a317..3e9691f695 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.C @@ -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() diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.H index 6959144056..be34b55c1b 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/Gunn/Gunn.H @@ -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 ); diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C index e3140250d4..441873924e 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C @@ -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() diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H index 13eadde6ec..df56197e98 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H @@ -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 ); diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C index e6f15d52df..0ebdbb237d 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C @@ -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() diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H index 206c3f7e56..16f189d101 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H @@ -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 ); diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index ccbd44fd73..96290820d4 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -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::blendedHeatTransferModel::K() const { tmp (heatTransferModel::*k)() const = diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H index 8b130b390e..4964fbcf05 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H @@ -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 K(const scalar residualAlpha) const = 0; + + //- Dummy write for regIOobject + bool writeData(Ostream& os) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C index 75c8739c79..de79418cfd 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C @@ -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::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::New << exit(FatalError); } - return cstrIter()(modelDict, interface); + return cstrIter()(modelDict, interface, registerObject); } diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.C new file mode 100644 index 0000000000..2712aebdd8 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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::heatTransferModels::nonSphericalHeatTransfer::K +( + const scalar residualAlpha +) const +{ + return factor_*sphericalHeatTransfer::K(residualAlpha); +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.H new file mode 100644 index 0000000000..464c42f9c6 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/nonSphericalHeatTransfer/nonSphericalHeatTransfer.H @@ -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 . + +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 K(const scalar residualAlpha) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace heatTransferModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C index 0d2e2aaa3e..20713b17ff 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C @@ -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() diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H index 699ed4dfd2..208081086e 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H @@ -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 ); diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C index 2569ca6d9d..2786c3b021 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C @@ -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() diff --git a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H index b51dd77338..208d04fba5 100644 --- a/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H +++ b/applications/solvers/modules/multiphaseEuler/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H @@ -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 ); diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseSystems/Make/options b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseSystems/Make/options index 8e02fd2079..26ecab9351 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseSystems/Make/options +++ b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseSystems/Make/options @@ -21,4 +21,5 @@ EXE_INC = \ LIB_LIBS = \ -lcombustionModels \ - -lphaseSystem + -lphaseSystem \ + -leulerianInterfacialModels diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files index 4c5e3be992..45dac52cdb 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options index 19c5d6f542..3c7bdd7ae8 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options @@ -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 \ diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.C new file mode 100644 index 0000000000..e8444c6755 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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() + ), + otherInterface_ + ( + interface + .modelCast() + .otherInterface() + ), + vapourPhaseName_(dict.lookup("vapourPhase")), + liquidPhaseName_(dict.lookup("liquidPhase")), + heatTransferModel_ + ( + heatTransferModel::New + ( + dict.subDict("heatTransferModel"), + interface, + false, + false + ) + ), + relax_(dict.lookupOrDefault("relax", scalar(1))), + seedFraction_(dict.lookupOrDefault("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::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(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 tlrho(lThermo.rho()); + const volScalarField& lrho = tlrho(); + const tmp 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(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.H new file mode 100644 index 0000000000..f8af72ce33 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/heatTransferModels/wallBoiling/wallBoilingHeatTransfer.H @@ -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 . + +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 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_; + + //- Relaxation factor + const scalar relax_; + + //- Bulk nucleation seed phase fraction + const scalar seedFraction_; + + //- Run-time selected heat flux partitioning model + autoPtr + partitioningModel_; + + //- Run-time selected nucleation site density model + autoPtr + nucleationSiteModel_; + + //- Run-time selected bubble departure diameter model + autoPtr + departureDiamModel_; + + //- Run-time selected bubble departure frequency model + autoPtr + 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 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 + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C similarity index 64% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C index 45251bb63b..e002ca553c 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C @@ -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 +Foam::tmp +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::value + ( + mesh.lookupObject("g") + ); + + auto phi = coefficient::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("phi")) + phi_("phi", dimless, dict) {} @@ -98,23 +125,43 @@ KocamustafaogullariIshiiDepartureDiameter::dDeparture const scalarField& L ) const { - // Gravitational acceleration - const uniformDimensionedVectorField& g = - liquid.mesh().lookupObject("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::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))() + ); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H similarity index 77% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H index 9dabba747f..edff8bdf4c 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.H @@ -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 + tmp 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 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 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; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C similarity index 68% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C index 738d7440ba..843abf0a83 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C @@ -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 +Foam::tmp +Foam::wallBoilingModels::departureDiameterModels::TolubinskiKostanchuk:: +calculate +( + const ScalarFieldType& Tl, + const ScalarFieldType& Tsatw +) const +{ + auto dRef = coefficient::value(dRef_); + auto dMax = coefficient::value(dMax_); + auto dMin = coefficient::value(dMin_); + + const dimensionedScalar T45_(dimTemperature, 45); + + auto T45 = coefficient::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("dRef", 6e-4)), - dMax_(dict.lookupOrDefault("dMax", 0.0014)), - dMin_(dict.lookupOrDefault("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::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_); diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H similarity index 79% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H index cffbc40348..8f79e4cd05 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H @@ -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 + tmp 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 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 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; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C index 8231a04fde..551c0efd09 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C @@ -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()); } + // ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H similarity index 86% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H index a611b88846..0f9cd137a9 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H @@ -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 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 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; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C index 690ee9db76..f56c4fb05a 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModelNew.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C similarity index 64% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C index 85e03f4cce..9f4d3ba58a 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C @@ -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 +Foam::tmp +Foam::wallBoilingModels::departureFrequencyModels::Cole::calculate +( + const fvMesh& mesh, + const ScalarFieldType& dDep, + const ScalarFieldType& rhoLiquid, + const ScalarFieldType& rhoVapour +) const +{ + auto g = coefficient::value + ( + mesh.lookupObject("g") + ); + + const dimensionedScalar dRhoMin_(dimDensity, 0.1); + auto dRhoMin = coefficient::value(dRhoMin_); + + return + sqrt + ( + 4*mag(g)*max(rhoLiquid - rhoVapour, dRhoMin)/(3*dDep*rhoLiquid) + ); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::wallBoilingModels::departureFrequencyModels::Cole::Cole @@ -89,19 +115,37 @@ Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture const scalarField& dDep ) const { - // Gravitational acceleration - const uniformDimensionedVectorField& g = - liquid.mesh().lookupObject("g"); + return + calculate + ( + liquid.mesh(), + dDep, + liquid.thermo().rho(patchi)(), + vapour.thermo().rho(patchi)() + ); +} - const scalarField rhoLiquid(liquid.thermo().rho(patchi)); - const scalarField rhoVapor(vapour.thermo().rho(patchi)); - return sqrt - ( - 4*mag(g).value() - *max(rhoLiquid - rhoVapor, scalar(0.1)) - /(3*dDep*rhoLiquid) - ); +Foam::tmp +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()() + ); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H similarity index 80% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H index 5cdf19322b..32e7bcfbca 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H @@ -62,6 +62,19 @@ class Cole : public departureFrequencyModel { + // Private Member Functions + + //- Calculate and return the bubble departure frequency + template + tmp 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 fDeparture + ( + const phaseModel& liquid, + const phaseModel& vapour, + const phaseModel& solid, + const volScalarField& Tf, + const volScalarField& Tsatw, + const volScalarField& L, + const volScalarField& dDep + ) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C similarity index 64% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C index a7c65b8d86..2d1422f968 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C @@ -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 +Foam::tmp +Foam::wallBoilingModels::departureFrequencyModels:: +KocamustafaogullariIshiiDepartureFrequency::calculate +( + const fvMesh& mesh, + const ScalarFieldType& dDep, + const ScalarFieldType& rhoLiquid, + const ScalarFieldType& rhoVapour, + const ScalarFieldType& sigma +) const +{ + auto g = coefficient::value + ( + mesh.lookupObject("g") + ); + + auto Cf = coefficient::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("Cf", 1.18)) + Cf_(dimensionedScalar::lookupOrDefault("Cf", dict, dimless, 1.18)) {} @@ -96,25 +123,40 @@ KocamustafaogullariIshiiDepartureFrequency::fDeparture const scalarField& dDep ) const { - // Gravitational acceleration - const uniformDimensionedVectorField& g = - liquid.mesh().lookupObject("g"); + return + calculate + ( + liquid.mesh(), + dDep, + liquid.thermo().rho(patchi)(), + vapour.thermo().rho(patchi)(), + liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)() + ); +} - const scalarField rhoLiquid(liquid.thermo().rho(patchi)); - const scalarField rhoVapor(min(vapour.thermo().rho(patchi), rhoLiquid)); - const tmp tsigma - ( - liquid.fluid().sigma(phaseInterface(liquid, vapour)) - ); - - const volScalarField& sigma = tsigma(); - const fvPatchScalarField& sigmaw = sigma.boundaryField()[patchi]; - - return (Cf_/dDep)*pow025 - ( - sigmaw*mag(g.value())*(rhoLiquid - rhoVapor)/sqr(rhoLiquid) - ); +Foam::tmp +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 + ( + liquid.mesh(), + dDep, + liquid.thermo().rho()(), + vapour.thermo().rho()(), + liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))() + ); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H similarity index 81% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H index 63053212ed..794d03b290 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.H @@ -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 + tmp 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 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; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C index 8716f998df..68b5dcc605 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H index deb4654ed0..3eb0f6cfd9 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H @@ -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 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; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C index 53c0413858..04430d9569 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModelNew.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C similarity index 61% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C index d281bedc20..257590925e 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C @@ -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 +Foam::tmp +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::value(zeroT_); + + auto Cn = coefficient::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("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); + return + calculate + ( + Tsatw, + L, + dDep, + Tw, + liquid.thermo().rho(patchi)(), + vapour.thermo().rho(patchi)(), + liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)() + ); +} - const scalarField sigmaw + +Foam::tmp +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 ( - liquid.fluid().sigma(phaseInterface(liquid, vapour), patchi) + Tsatw, + L, + dDep, + Tf, + liquid.thermo().rho()(), + vapour.thermo().rho()(), + liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))() ); - - //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; } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H similarity index 78% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H index 81af28f2e0..9679a92397 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.H @@ -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 + tmp 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 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; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C similarity index 67% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C index 3d098a388b..17d7a92adc 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C @@ -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 +Foam::tmp +Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::calculate +( + const ScalarFieldType& Tsatw, + const ScalarFieldType& Tw +) const +{ + auto Cn = coefficient::value(Cn_); + auto NRef = coefficient::value(NRef_); + auto deltaTRef = coefficient::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("Cn", 1)), - NRef_(dict.lookupOrDefault("NRef", 9.922e5)), - deltaTRef_(dict.lookupOrDefault("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::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); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H similarity index 79% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H index a25cd9414a..518723beb2 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H @@ -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 + tmp 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 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; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C index 1eeac037b9..1b5153be34 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H index fe1bd70177..146cc8aa7c 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H @@ -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 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; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C index 3e02c62d44..462ac98d4d 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModelNew.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C similarity index 85% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C index b90d6e2aba..58cf1a84eb 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C @@ -46,6 +46,27 @@ namespace partitioningModels } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +Foam::tmp +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::wallBoilingModels::partitioningModels::Lavieville::wetFraction +( + const volScalarField& alphaLiquid +) const +{ + return calculate(alphaLiquid); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H index 371c48c19e..b976bd1005 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H @@ -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 + tmp calculate + ( + const ScalarFieldType& alphaLiquid + ) const; public: @@ -104,7 +114,13 @@ public: const scalarField& alphaLiquid ) const; - //- Write + //- Return the wet fraction + virtual tmp wetFraction + ( + const volScalarField& alphaLiquid + ) const; + + //- Write to stream virtual void write(Ostream& os) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.C similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.C index 4af2510e64..a747c398eb 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.C @@ -46,6 +46,35 @@ namespace partitioningModels } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +Foam::tmp +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::wallBoilingModels::partitioningModels::cosine::wetFraction +( + const volScalarField& alphaLiquid +) const +{ + return calculate(alphaLiquid); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.H similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.H index 82aa93f095..88e90044f6 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/cosine/cosine.H @@ -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 + tmp calculate + ( + const ScalarFieldType& alphaLiquid + ) const; public: @@ -108,7 +118,13 @@ public: const scalarField& alphaLiquid ) const; - //- Write + //- Return the wet fraction + virtual tmp wetFraction + ( + const volScalarField& alphaLiquid + ) const; + + //- Write to stream virtual void write(Ostream& os) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.C similarity index 86% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.C index ba194818f0..112fec0476 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.C @@ -46,6 +46,28 @@ namespace partitioningModels } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +Foam::tmp +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::wallBoilingModels::partitioningModels::linear::wetFraction +( + const volScalarField& alphaLiquid +) const +{ + return calculate(alphaLiquid); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.H similarity index 87% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.H index 72f950e9c1..18c59b9ebd 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/linear/linear.H @@ -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 + tmp calculate + ( + const ScalarFieldType& alphaLiquid + ) const; public: @@ -109,7 +119,13 @@ public: const scalarField& alphaLiquid ) const; - //- Write + //- Return the wet fraction + virtual tmp wetFraction + ( + const volScalarField& alphaLiquid + ) const; + + //- Write to stream virtual void write(Ostream& os) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C index 6eb4b60a49..9e415a7169 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H similarity index 93% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H index 94a3d8095a..b2d82d67c3 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H @@ -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 wetFraction + ( + const volScalarField& alphaLiquid + ) const = 0; + + //- Write to stream virtual void write(Ostream& os) const; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C similarity index 97% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C index 2a98ba6fa9..270e97fd88 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModelNew.C @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C similarity index 92% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C index c21ee8455b..b50d7d88c8 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C @@ -84,4 +84,14 @@ Foam::wallBoilingModels::partitioningModels::phaseFraction::wetFraction } +Foam::tmp +Foam::wallBoilingModels::partitioningModels::phaseFraction::wetFraction +( + const volScalarField& alphaLiquid +) const +{ + return tmp(alphaLiquid); +} + + // ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H similarity index 94% rename from applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H rename to applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H index a06a884234..30aff82892 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H @@ -87,6 +87,12 @@ public: ( const scalarField& alphaLiquid ) const; + + //- Return the wet fraction + virtual tmp wetFraction + ( + const volScalarField& alphaLiquid + ) const; }; diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/wallBoilingModelsCoefficient.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/wallBoilingModelsCoefficient.H new file mode 100644 index 0000000000..b463727a31 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/wallBoilingSubModels/wallBoilingModelsCoefficient.H @@ -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 . + +Namespace + Foam::wallBoilingModels + +\*---------------------------------------------------------------------------*/ + +#ifndef wallBoilingModelsCoefficient_H +#define wallBoilingModelsCoefficient_H + +#include "dimensionedTypes.H" +#include "volFieldsFwd.H" +#include "UniformDimensionedField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +template +struct coefficient; + +template +struct coefficient> +{ + template + static const Type2& value(const dimensioned& v) + { + return v.value(); + } + + template + static const Type2& value(const UniformDimensionedField& v) + { + return v.value(); + } +}; + +template +struct coefficient> +{ + template + static const dimensioned& value(const dimensioned& v) + { + return v; + } + + template + static const dimensioned& value + ( + const UniformDimensionedField& v + ) + { + return v; + } +}; + +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/Make/files b/applications/solvers/modules/multiphaseEuler/phaseSystems/Make/files index 2637e32327..52dc70c7f0 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/Make/files +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/Make/files @@ -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 diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C index 5096230044..7669f74d89 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C @@ -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::heatTransfer() const this->addDmidtHefs ( dmidtfs, - Tfs_, + //Tfs_, + Tsats_, latentHeatScheme::upwind, latentHeatTransfer::mass, eqns @@ -399,7 +425,8 @@ Foam::ThermalPhaseChangePhaseSystem::heatTransfer() const this->addDmdtHefs ( dmdtfs_, - Tfs_, + //Tfs_, + Tsats_, latentHeatScheme::upwind, latentHeatTransfer::mass, eqns @@ -513,6 +540,18 @@ template void Foam::ThermalPhaseChangePhaseSystem::correctInterfaceThermo() { + typedef + Foam::heatTransferModels::wallBoilingHeatTransfer + wallBoilingHeatTransferModel; + + HashTable + wallBoilingHeatTransferModels = + this->mesh().template lookupClass(); + + typedef + compressible::alphatPhaseChangeWallFunctionBase + alphatPhaseChangeWallFunction; + forAllConstIter ( saturationModelTable, @@ -536,7 +575,8 @@ Foam::ThermalPhaseChangePhaseSystem::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::correctInterfaceThermo() interface, volatile_, dmdtf, - Tf, + Tsat, latentHeatScheme::symmetric ) : this->L ( interface, dmdtf, - Tf, + Tsat, latentHeatScheme::symmetric ) ); @@ -561,7 +601,7 @@ Foam::ThermalPhaseChangePhaseSystem::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::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::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::correctInterfaceThermo() // Nucleation mass transfer update { - typedef - compressible::alphatPhaseChangeWallFunctionBase - alphatWallFunction; - volScalarField& nDmdtf(*this->nDmdtfs_[interface]); nDmdtf = Zero; bool wallBoilingActive = false; + forAllConstIter + ( + HashTable, + 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::correctInterfaceThermo() const fvPatchScalarField& alphatp = alphat.boundaryField()[patchi]; - if (!isA(alphatp)) continue; + if (!isA(alphatp)) continue; - const alphatWallFunction& alphatw = - refCast(alphatp); + const alphatPhaseChangeWallFunction& alphatw = + refCast(alphatp); if (!alphatw.activeInterface(interface)) continue; diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H index 2663abcc85..a07cc008ae 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H @@ -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_; diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.C new file mode 100644 index 0000000000..e03e73f86e --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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::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::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("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 + ( + "residualAvbyAlpha", + rootSmall + ) + ); + } + + return true; +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.H new file mode 100644 index 0000000000..5b7fa66a04 --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/fixedInterfacialAreaDiameter/fixedInterfacialAreaDiameter.H @@ -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 . + +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 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 d() const; + + //- Get the surface area per unit volume field + virtual tmp Av() const; + + //- Read diameterProperties dictionary + virtual bool read(const dictionary& diameterProperties); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.C new file mode 100644 index 0000000000..33603d24ee --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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::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; +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.H new file mode 100644 index 0000000000..84127e844e --- /dev/null +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/diameterModels/residualDiameter/residualDiameter.H @@ -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 . + +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 d() const; + + //- Read diameterProperties dictionary + virtual bool read(const dictionary& diameterProperties); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C index 2e57f05e37..68975cfc8f 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C @@ -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::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) + ); +} + + // ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.H index 92970ea7d4..8668931a4c 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.H @@ -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 otherInterface() const; };