From a7d40a4fe5fcbf9a1b44d8cfaae491fb2779b346 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 15 Nov 2022 16:56:56 +0000 Subject: [PATCH] coupledMultiphaseTemperatureFvPatchScalarField: New BC for multiphase CHT cases Class Foam::coupledMultiphaseTemperatureFvPatchScalarField Description Mixed boundary condition for the phase temperature of a phase in an Euler-Euler multiphase simulation, to be used for heat-transfer with another region in a CHT case. Optional thin wall material layer resistances can be specified through thicknessLayers and kappaLayers entries. See also Foam::coupledTemperatureFvPatchScalarField The new tutorial case tutorials/modules/CHT/multiphaseCoolingCylinder2D is a variant of the coolingCylinder2D case in which a 10% oil droplets in water mixture flows over and cools a hot cylinder. The case in run with the foamMultiRun multi-solver executor. --- .../Make/files | 1 + .../Make/options | 9 +- ...dMultiphaseTemperatureFvPatchScalarField.C | 196 ++++++++++++++ ...dMultiphaseTemperatureFvPatchScalarField.H | 161 ++++++++++++ .../coupledTemperatureFvPatchScalarField.C | 244 ++++++++++++------ .../coupledTemperatureFvPatchScalarField.H | 60 ++++- .../modules/CHT/coolingCylinder2D/0/fluid/T | 2 - .../modules/CHT/coolingCylinder2D/0/solid/T | 2 - .../CHT/coolingCylinder2D/system/controlDict | 3 +- .../coolingCylinder2D/system/fluid/fvSolution | 13 +- .../multiphaseCoolingCylinder2D/0/fluid/T.oil | 50 ++++ .../0/fluid/T.water | 50 ++++ .../multiphaseCoolingCylinder2D/0/fluid/U.oil | 48 ++++ .../0/fluid/U.water | 48 ++++ .../0/fluid/alpha.oil | 50 ++++ .../0/fluid/alpha.water | 49 ++++ .../0/fluid/alphat.oil | 49 ++++ .../0/fluid/alphat.water | 49 ++++ .../0/fluid/epsilon.oil | 50 ++++ .../0/fluid/epsilon.water | 50 ++++ .../0/fluid/epsilonm | 51 ++++ .../multiphaseCoolingCylinder2D/0/fluid/k.oil | 50 ++++ .../0/fluid/k.water | 50 ++++ .../multiphaseCoolingCylinder2D/0/fluid/km | 50 ++++ .../multiphaseCoolingCylinder2D/0/fluid/nut | 42 +++ .../0/fluid/nut.oil | 48 ++++ .../0/fluid/nut.water | 48 ++++ .../CHT/multiphaseCoolingCylinder2D/0/fluid/p | 48 ++++ .../multiphaseCoolingCylinder2D/0/fluid/p_rgh | 49 ++++ .../CHT/multiphaseCoolingCylinder2D/0/solid/T | 30 +++ .../CHT/multiphaseCoolingCylinder2D/Allrun | 16 ++ .../constant/fluid/g | 21 ++ .../constant/fluid/momentumTransport.oil | 27 ++ .../constant/fluid/momentumTransport.water | 27 ++ .../constant/fluid/phaseProperties | 143 ++++++++++ .../constant/fluid/physicalProperties.oil | 51 ++++ .../constant/fluid/physicalProperties.water | 51 ++++ .../constant/solid/physicalProperties | 37 +++ .../system/blockMeshDict | 158 ++++++++++++ .../system/controlDict | 80 ++++++ .../system/fluid/fvConstraints | 23 ++ .../system/fluid/fvSchemes | 65 +++++ .../system/fluid/fvSolution | 83 ++++++ .../system/fvSchemes | 45 ++++ .../system/fvSolution | 21 ++ .../system/solid/fvSchemes | 46 ++++ .../system/solid/fvSolution | 46 ++++ 47 files changed, 2478 insertions(+), 112 deletions(-) create mode 100644 applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.C create mode 100644 applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.H create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilonm create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/km create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p_rgh create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/solid/T create mode 100755 tutorials/modules/CHT/multiphaseCoolingCylinder2D/Allrun create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/g create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/phaseProperties create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.oil create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.water create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/solid/physicalProperties create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/blockMeshDict create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/controlDict create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvConstraints create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSchemes create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSolution create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSchemes create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSolution create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSchemes create mode 100644 tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSolution diff --git a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files index ef3380c78d..b814ff1871 100644 --- a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files +++ b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files @@ -26,5 +26,6 @@ derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWal derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C derivedFvPatchFields/fixedMultiphaseHeatFlux/fixedMultiphaseHeatFluxFvPatchScalarField.C +derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libmultiphaseThermophysicalTransportModels diff --git a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options index 289af49e9f..fca15d13c1 100644 --- a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options +++ b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options @@ -9,12 +9,15 @@ EXE_INC = \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/coupledThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -lphaseSystem \ -leulerianInterfacialModels \ -leulerianInterfacialCompositionModels \ - -lphaseCompressibleMomentumTransportModels + -lphaseCompressibleMomentumTransportModels \ + -lphaseFluidMulticomponentThermophysicalTransportModels \ + -lcoupledThermophysicalTransportModels diff --git a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.C b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.C new file mode 100644 index 0000000000..4c2b51b0f8 --- /dev/null +++ b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.C @@ -0,0 +1,196 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2022 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 "coupledMultiphaseTemperatureFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "phaseSystem.H" +#include "compressibleMomentumTransportModels.H" +#include "phaseCompressibleMomentumTransportModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void Foam::coupledMultiphaseTemperatureFvPatchScalarField::getThis +( + tmp& kappa, + tmp& sumKappaTByDelta, + tmp& sumKappaByDelta, + scalarField& sumq, + tmp& qByKappa +) const +{ + // Lookup the fluid model + const phaseSystem& fluid = + patch().boundaryMesh().mesh() + .lookupObject(phaseSystem::propertiesName); + + scalarField sumKappa(size(), scalar(0)); + scalarField sumKappaT(size(), scalar(0)); + + forAll(fluid.phases(), phasei) + { + const phaseModel& phase = fluid.phases()[phasei]; + const fluidThermo& thermo = phase.thermo(); + + const fvPatchScalarField& Tw = + thermo.T().boundaryField()[patch().index()]; + + const fvPatchScalarField& alpha = + phase.boundaryField()[patch().index()]; + + tmp kappaEff(phase.kappaEff(patch().index())); + tmp alphaKappaEff(alpha*kappaEff()); + + if (&Tw == this) + { + kappa = alphaKappaEff; + qByKappa = sumq/kappaEff; + sumq -= alpha*sumq; + } + else + { + const scalarField T = + thermo.T().boundaryField()[patch().index()] + .patchInternalField(); + + sumKappa += alphaKappaEff(); + sumKappaT += alphaKappaEff*T; + } + } + + sumKappaByDelta = sumKappa*patch().deltaCoeffs(); + sumKappaTByDelta = sumKappaT*patch().deltaCoeffs(); +} + + +void Foam::coupledMultiphaseTemperatureFvPatchScalarField::getNbr +( + tmp& sumKappaTByDeltaNbr, + tmp& sumKappaByDeltaNbr, + tmp& qNbr +) const +{ + // Lookup the fluid model + const phaseSystem& fluid = + patch().boundaryMesh().mesh() + .lookupObject(phaseSystem::propertiesName); + + scalarField sumKappa(size(), scalar(0)); + scalarField sumKappaT(size(), scalar(0)); + + forAll(fluid.phases(), phasei) + { + const phaseModel& phase = fluid.phases()[phasei]; + const fluidThermo& thermo = phase.thermo(); + + const fvPatchScalarField& alpha = + phase.boundaryField()[patch().index()]; + + const scalarField T = + thermo.T().boundaryField()[patch().index()].patchInternalField(); + + const scalarField alphaKappaEff(alpha*phase.kappaEff(patch().index())); + + sumKappa += alphaKappaEff; + sumKappaT += alphaKappaEff*T; + } + + sumKappaByDeltaNbr = sumKappa*patch().deltaCoeffs(); + sumKappaTByDeltaNbr = sumKappaT*patch().deltaCoeffs(); +} + + +void Foam::coupledMultiphaseTemperatureFvPatchScalarField::getNbr +( + tmp& TrefNbr, + tmp& qNbr +) const +{ + NotImplemented; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::coupledMultiphaseTemperatureFvPatchScalarField:: +coupledMultiphaseTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + coupledTemperatureFvPatchScalarField(p, iF) +{} + + +Foam::coupledMultiphaseTemperatureFvPatchScalarField:: +coupledMultiphaseTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + coupledTemperatureFvPatchScalarField(p, iF, dict) +{} + + +Foam::coupledMultiphaseTemperatureFvPatchScalarField:: +coupledMultiphaseTemperatureFvPatchScalarField +( + const coupledMultiphaseTemperatureFvPatchScalarField& psf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + coupledTemperatureFvPatchScalarField(psf, p, iF, mapper) +{} + + +Foam::coupledMultiphaseTemperatureFvPatchScalarField:: +coupledMultiphaseTemperatureFvPatchScalarField +( + const coupledMultiphaseTemperatureFvPatchScalarField& psf, + const DimensionedField& iF +) +: + coupledTemperatureFvPatchScalarField(psf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + coupledMultiphaseTemperatureFvPatchScalarField + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.H b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.H new file mode 100644 index 0000000000..673052e5f4 --- /dev/null +++ b/applications/solvers/modules/fluid/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/coupledMultiphaseTemperature/coupledMultiphaseTemperatureFvPatchScalarField.H @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2022 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::coupledMultiphaseTemperatureFvPatchScalarField + +Description + Mixed boundary condition for the phase temperature of a phase in an + Euler-Euler multiphase simulation, to be used for heat-transfer with another + region in a CHT case. Optional thin wall material layer resistances can be + specified through thicknessLayers and kappaLayers entries. + +See also + Foam::coupledTemperatureFvPatchScalarField + +SourceFiles + coupledMultiphaseTemperatureFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef coupledMultiphaseTemperatureFvPatchScalarField_H +#define coupledMultiphaseTemperatureFvPatchScalarField_H + +#include "coupledTemperatureFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class coupledMultiphaseTemperatureFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class coupledMultiphaseTemperatureFvPatchScalarField +: + public coupledTemperatureFvPatchScalarField +{ + +protected: + + //- Get the patch kappa, sum kappa*Tc/delta and kappa/delta for all phases + // except the phase being solved and also the phase heat-flux obtained by + // partitioning the sum heat-flux provided + virtual void getThis + ( + tmp& kappa, + tmp& sumKappaTByDelta, + tmp& sumKappaByDelta, + scalarField& sumq, + tmp& qByKappa + ) const; + + //- Get the neighbour patch sum kappa*Tc/delta and kappa/delta + // for all phases and the heat-flux correction + virtual void getNbr + ( + tmp& sumKappaTByDeltaNbr, + tmp& sumKappaByDeltaNbr, + tmp& qNbr + ) const; + + //- Get the neighbour patch wall temperature and heat-flux + // when wall thermal resistance is specified + virtual void getNbr + ( + tmp& TwNbr, + tmp& qNbr + ) const; + + +public: + + //- Runtime type information + TypeName("coupledMultiphaseTemperature"); + + + // Constructors + + //- Construct from patch and internal field + coupledMultiphaseTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + coupledMultiphaseTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // coupledMultiphaseTemperatureFvPatchScalarField + // onto a new patch + coupledMultiphaseTemperatureFvPatchScalarField + ( + const coupledMultiphaseTemperatureFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Disallow copy without setting internal field reference + coupledMultiphaseTemperatureFvPatchScalarField + ( + const coupledMultiphaseTemperatureFvPatchScalarField& + ) = delete; + + //- Copy constructor setting internal field reference + coupledMultiphaseTemperatureFvPatchScalarField + ( + const coupledMultiphaseTemperatureFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new coupledMultiphaseTemperatureFvPatchScalarField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C index 19bca7c1e9..187903c4e1 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C @@ -30,6 +30,101 @@ License #include "mappedPatchBase.H" #include "addToRunTimeSelectionTable.H" +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void Foam::coupledTemperatureFvPatchScalarField::getThis +( + tmp& kappa, + tmp& sumKappaTByDelta, + tmp& sumKappaByDeltaNbr, + scalarField& sumq, + tmp& qByKappa +) const +{ + const thermophysicalTransportModel& ttm = + patch().boundaryMesh().mesh() + .lookupType(); + + kappa = ttm.kappaEff(patch().index()); + + qByKappa = sumq/kappa; + + sumq = 0; + + tmp qCorr(ttm.qCorr(patch().index())); + + if (qCorr.valid()) + { + sumq += qCorr; + } +} + + +void Foam::coupledTemperatureFvPatchScalarField::getNbr +( + tmp& sumKappaTByDeltaNbr, + tmp& sumKappaByDeltaNbr, + tmp& qNbr +) const +{ + const thermophysicalTransportModel& ttm = + patch().boundaryMesh().mesh() + .lookupType(); + + sumKappaByDeltaNbr = ttm.kappaEff(patch().index())*patch().deltaCoeffs(); + + sumKappaTByDeltaNbr = sumKappaByDeltaNbr()*patchInternalField(); + + qNbr = ttm.qCorr(patch().index()); +} + + +void Foam::coupledTemperatureFvPatchScalarField::getNbr +( + tmp& TrefNbr, + tmp& qNbr +) const +{ + const thermophysicalTransportModel& ttm = + patch().boundaryMesh().mesh() + .lookupType(); + + const fvPatchScalarField& Tp = + patch().lookupPatchField + ( + internalField().name() + ); + + TrefNbr = Tp; + + qNbr = ttm.qCorr(patch().index()); +} + + +void Foam::coupledTemperatureFvPatchScalarField::add +( + tmp& result, + const tmp& field +) const +{ + if (result.valid()) + { + result.ref() += field; + } + else + { + if (field.isTmp()) + { + result = field; + } + else + { + result = field().clone(); + } + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::coupledTemperatureFvPatchScalarField:: @@ -46,11 +141,11 @@ coupledTemperatureFvPatchScalarField thicknessLayers_(0), kappaLayers_(0), qs_(p.size()), - contactRes_(0) + wallKappaByDelta_(0) { - this->refValue() = 0.0; - this->refGrad() = 0.0; - this->valueFraction() = 1.0; + this->refValue() = 0; + this->refGrad() = 0; + this->valueFraction() = 1; } @@ -69,7 +164,7 @@ coupledTemperatureFvPatchScalarField thicknessLayers_(0), kappaLayers_(0), qs_(p.size(), 0), - contactRes_(0.0) + wallKappaByDelta_(0) { if (!isA(this->patch().patch())) { @@ -89,11 +184,11 @@ coupledTemperatureFvPatchScalarField if (thicknessLayers_.size() > 0) { // Calculate effective thermal resistance by harmonic averaging - forAll(thicknessLayers_, iLayer) + forAll(thicknessLayers_, i) { - contactRes_ += thicknessLayers_[iLayer]/kappaLayers_[iLayer]; + wallKappaByDelta_ += thicknessLayers_[i]/kappaLayers_[i]; } - contactRes_ = 1.0/contactRes_; + wallKappaByDelta_ = 1/wallKappaByDelta_; } } @@ -130,8 +225,8 @@ coupledTemperatureFvPatchScalarField { // Start from user entered data. Assume fixedValue. refValue() = *this; - refGrad() = 0.0; - valueFraction() = 1.0; + refGrad() = 0; + valueFraction() = 1; } } @@ -152,7 +247,7 @@ coupledTemperatureFvPatchScalarField thicknessLayers_(psf.thicknessLayers_), kappaLayers_(psf.kappaLayers_), qs_(mapper(psf.qs_)), - contactRes_(psf.contactRes_) + wallKappaByDelta_(psf.wallKappaByDelta_) {} @@ -170,7 +265,7 @@ coupledTemperatureFvPatchScalarField thicknessLayers_(psf.thicknessLayers_), kappaLayers_(psf.kappaLayers_), qs_(psf.qs_), - contactRes_(psf.contactRes_) + wallKappaByDelta_(psf.wallKappaByDelta_) {} @@ -188,8 +283,6 @@ void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag + 1; - const label patchi = patch().index(); - // Get the coupling information from the mappedPatchBase const mappedPatchBase& mpp = refCast(patch().patch()); @@ -197,109 +290,93 @@ void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs() const fvPatch& patchNbr = refCast(mpp.nbrMesh()).boundary()[patchiNbr]; - // Calculate the temperature by harmonic averaging - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - typedef coupledTemperatureFvPatchScalarField thisType; - const fvPatchScalarField& TpNbr = patchNbr.lookupPatchField(TnbrName_); - if (!isA(TpNbr)) + if (!isA(TpNbr)) { FatalErrorInFunction << "Patch field for " << internalField().name() << " on " - << patch().name() << " is of type " << thisType::typeName - << endl << "The neighbouring patch field " << TnbrName_ << " on " + << this->patch().name() << " is of type " + << coupledTemperatureFvPatchScalarField::typeName + << endl << "The neighbouring patch field " + << internalField().name() << " on " << patchNbr.name() << " is required to be the same, but is " << "currently of type " << TpNbr.type() << exit(FatalError); } - const thisType& coupledTemperatureNbr = refCast(TpNbr); + const coupledTemperatureFvPatchScalarField& coupledTemperatureNbr = + refCast(TpNbr); - const scalarField TcNbr - ( - contactRes_ == 0 - ? mpp.distribute(coupledTemperatureNbr.patchInternalField()) - : mpp.distribute(coupledTemperatureNbr) - ); - - const thermophysicalTransportModel& ttm = - patch().boundaryMesh().mesh() - .lookupType(); - - const thermophysicalTransportModel& ttmNbr = - patchNbr.boundaryMesh().mesh() - .lookupType(); - - const scalarField kappa(ttm.kappaEff(patchi)); - - const scalarField kappaByDelta(kappa*patch().deltaCoeffs()); - - const scalarField kappaByDeltaNbr - ( - contactRes_ == 0 - ? mpp.distribute - ( - ttmNbr.kappaEff(patchiNbr)*patchNbr.deltaCoeffs() - ) - : tmp(new scalarField(size(), contactRes_)) - ); - - scalarField qTot(qs_); + scalarField sumq(qs_); if (qrName_ != "none") { - qTot += patch().lookupPatchField(qrName_); + sumq += patch().lookupPatchField(qrName_); } if (qrNbrName_ != "none") { - qTot += mpp.distribute + sumq += mpp.distribute ( patchNbr.lookupPatchField(qrNbrName_) ); } - tmp qCorr(ttm.qCorr(patchi)); + tmp kappa; + tmp sumKappaTByDelta; + tmp sumKappaByDelta; + tmp qByKappa; - if (qCorr.valid()) + // q = alpha.this*sumq + getThis(kappa, sumKappaTByDelta, sumKappaByDelta, sumq, qByKappa); + + // Add neighbour contributions { - qTot += qCorr; + tmp sumKappaTByDeltaNbr; + tmp sumKappaByDeltaNbr; + tmp qNbr; + + if (wallKappaByDelta_ == 0) + { + coupledTemperatureNbr.getNbr + ( + sumKappaTByDeltaNbr, + sumKappaByDeltaNbr, + qNbr + ); + + add(sumKappaTByDelta, mpp.distribute(sumKappaTByDeltaNbr)); + add(sumKappaByDelta, mpp.distribute(sumKappaByDeltaNbr)); + } + else + { + // Get the neighbour wall temperature and flux correction + tmp TwNbr; + coupledTemperatureNbr.getNbr(TwNbr, qNbr); + + add(sumKappaByDelta, scalarField(size(), wallKappaByDelta_)); + add(sumKappaTByDelta, wallKappaByDelta_*mpp.distribute(TwNbr)); + } + + if (qNbr.valid()) + { + sumq += mpp.distribute(qNbr); + } } - tmp qCorrNbr(ttmNbr.qCorr(patchiNbr)); + this->valueFraction() = + sumKappaByDelta()/(kappa()*patch().deltaCoeffs() + sumKappaByDelta()); - if (qCorrNbr.valid()) - { - qTot += mpp.distribute(qCorrNbr); - } + this->refValue() = (sumKappaTByDelta() + sumq)/sumKappaByDelta(); - // Both sides agree on - // - temperature : (kappaByDelta*fld + kappaByDeltaNbr*nbrFld) - // /(kappaByDelta + kappaByDeltaNbr) - // - gradient : (temperature - fld)*delta - // We've got a degree of freedom in how to implement this in a mixed bc. - // (what gradient, what fixedValue and mixing coefficient) - // Two reasonable choices: - // 1. specify above temperature on one side (preferentially the high side) - // and above gradient on the other. So this will switch between pure - // fixedValue and pure fixedGradient - // 2. specify gradient and temperature such that the equations are the - // same on both sides. This leads to the choice of - // - refGradient = qTot/kappa; - // - refValue = neighbour value - // - mixFraction = kappaByDeltaNbr / (kappaByDeltaNbr + kappaByDelta) - - this->valueFraction() = kappaByDeltaNbr/(kappaByDeltaNbr + kappaByDelta); - this->refValue() = TcNbr; - this->refGrad() = qTot/kappa; + this->refGrad() = qByKappa; mixedFvPatchScalarField::updateCoeffs(); if (debug) { - scalar Q = gSum(kappa*patch().magSf()*snGrad()); + const scalar Q = gSum(kappa()*patch().magSf()*snGrad()); Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' @@ -326,7 +403,6 @@ void Foam::coupledTemperatureFvPatchScalarField::write ) const { mixedFvPatchScalarField::write(os); - writeEntry(os, "Tnbr", TnbrName_); writeEntry(os, "qrNbr", qrNbrName_); writeEntry(os, "qr", qrName_); writeEntry(os, "thicknessLayers", thicknessLayers_); diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H index f842d1154f..6beda7bd84 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H @@ -26,14 +26,15 @@ Class Description Mixed boundary condition for temperature, to be used for heat-transfer - on back-to-back baffles. Optional thin thermal layer resistances can be - specified through thicknessLayers and kappaLayers entries. + with another region in a CHT case. Optional thin wall material layer + resistances can be specified through thicknessLayers and kappaLayers + entries. Specifies gradient and temperature such that the equations are the same on both sides: - refGradient = qs_/kappa - refValue = neighbour value - - mixFraction = kappaByDeltaNbr/(kappaByDeltaNbr + kappaByDelta()) + - valueFraction = kappaByDeltaNbr/(kappaByDeltaNbr + kappaByDelta) where kappaByDelta is heat-transfer coefficient kappa*deltaCoeffs and qs is the optional source heat flux. @@ -55,9 +56,8 @@ Usage { type coupledTemperature; - Tnbr T; - thicknessLayers (0.1 0.2 0.3 0.4); - kappaLayers (1 2 3 4); + thicknessLayers (0.1 0.2 0.3 0.4); // Optional wall layer thicknesses + kappaLayers (1 2 3 4); // Optional wall layer conductivities qs uniform 100; // Optional source heat flux [W/m^2] value uniform 300; } @@ -101,23 +101,61 @@ class coupledTemperatureFvPatchScalarField //- Name of field on the neighbour region const word TnbrName_; - //- Name of the radiative heat flux in the neighbor region + //- Name of the radiative heat flux in the neighbor region const word qrNbrName_; //- Name of the radiative heat flux in local region const word qrName_; - //- Thickness of layers + //- Thickness of wall layers scalarList thicknessLayers_; - //- Conductivity of layers + //- Conductivity of wall layers scalarList kappaLayers_; //- Source heat flux [W/m^2] scalarField qs_; - //- Total contact resistance - scalar contactRes_; + //- Optional wall material conductivity/thickness + scalar wallKappaByDelta_; + + +protected: + + //- Get the patch kappa, kappa*Tc/delta and kappa/delta and also the + // heat-flux obtained from the sum heat-flux provided + virtual void getThis + ( + tmp& kappa, + tmp& sumKappaTByDelta, + tmp& sumKappaByDelta, + scalarField& qTot, + tmp& qByKappa + ) const; + + //- Get the neighbour patch kappa*Tc/delta and kappa/delta + // and the heat-flux correction + virtual void getNbr + ( + tmp& sumKappaTByDeltaNbr, + tmp& sumKappaByDeltaNbr, + tmp& qNbr + ) const; + + //- Get the neighbour patch wall temperature and heat-flux + // when wall thermal resistance is specified + virtual void getNbr + ( + tmp& TwNbr, + tmp& qNbr + ) const; + + //- Add field to result which may have not been previously set + void add + ( + tmp& result, + const tmp& field + ) const; public: diff --git a/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T b/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T index b7b32a15b6..5544909339 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T +++ b/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T @@ -40,8 +40,6 @@ boundaryField wall { type coupledTemperature; - thicknessLayers (1e-3); - kappaLayers (1e-3); value $internalField; } diff --git a/tutorials/modules/CHT/coolingCylinder2D/0/solid/T b/tutorials/modules/CHT/coolingCylinder2D/0/solid/T index 6b18e7928a..00800ed4a2 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/0/solid/T +++ b/tutorials/modules/CHT/coolingCylinder2D/0/solid/T @@ -22,8 +22,6 @@ boundaryField wall { type coupledTemperature; - thicknessLayers (1e-3); - kappaLayers (1e-3); value $internalField; } } diff --git a/tutorials/modules/CHT/coolingCylinder2D/system/controlDict b/tutorials/modules/CHT/coolingCylinder2D/system/controlDict index d417baa46e..c93c4934b4 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/system/controlDict +++ b/tutorials/modules/CHT/coolingCylinder2D/system/controlDict @@ -73,8 +73,7 @@ functions patch=inlet, field=U ) - } - } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/coolingCylinder2D/system/fluid/fvSolution b/tutorials/modules/CHT/coolingCylinder2D/system/fluid/fvSolution index b7f7601d46..adf99e855c 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/system/fluid/fvSolution +++ b/tutorials/modules/CHT/coolingCylinder2D/system/fluid/fvSolution @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------*\ + /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org @@ -17,20 +17,16 @@ solvers { "(rho|rhoFinal)" { - solver PCG - preconditioner DIC; - tolerance 1e-7; - relTol 0; + solver diagonal; } p_rgh { solver GAMG; - tolerance 1e-7; - relTol 0.01; - smoother GaussSeidel; + tolerance 1e-7; + relTol 0.01; maxIter 100; } @@ -39,6 +35,7 @@ solvers { solver PBiCGStab; preconditioner DILU; + tolerance 1e-6; relTol 0.1; } diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.oil new file mode 100644 index 0000000000..765474864d --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.oil @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object T.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 297; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.oil; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type coupledMultiphaseTemperature; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.water new file mode 100644 index 0000000000..363b7e1084 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/T.water @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object T.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 297; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type coupledMultiphaseTemperature; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.oil new file mode 100644 index 0000000000..1e668da797 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.oil @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format binary; + class volVectorField; + object U.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.1 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0.1 0 0); + } + + outlet + { + type pressureInletOutletVelocity; + phi phi.oil; + value $internalField; + } + + topAndBottom + { + type slip; + } + + wall + { + type noSlip; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.water new file mode 100644 index 0000000000..95f0e039a6 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/U.water @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format binary; + class volVectorField; + object U.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.1 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0.1 0 0); + } + + outlet + { + type pressureInletOutletVelocity; + phi phi.water; + value $internalField; + } + + topAndBottom + { + type slip; + } + + wall + { + type noSlip; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.oil new file mode 100644 index 0000000000..fb87f3ab18 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.oil @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object alpha.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.1; + } + + outlet + { + type inletOutlet; + phi phi.oil; + inletValue uniform 0.1; + value uniform 0.1; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type zeroGradient; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.water new file mode 100644 index 0000000000..8f670cb1a7 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alpha.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object alpha.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.9; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.9; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue uniform 0.9; + value uniform 0.9; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type zeroGradient; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.oil new file mode 100644 index 0000000000..d0fef39d96 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.oil @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object alphat.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type compressible::alphatWallFunction; + Prt 0.85; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.water new file mode 100644 index 0000000000..5c72fb84e8 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/alphat.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object alphat.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type compressible::alphatWallFunction; + Prt 0.85; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.oil new file mode 100644 index 0000000000..3d98c4d2f8 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.oil @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object epsilon.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.oil; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type epsilonWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.water new file mode 100644 index 0000000000..6cf5af2ccd --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilon.water @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object epsilon.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type epsilonWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilonm b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilonm new file mode 100644 index 0000000000..ec9576b401 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/epsilonm @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object epsilonm; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phim; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + + wall + { + type epsilonmWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.oil new file mode 100644 index 0000000000..6a7690a227 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.oil @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object k.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.oil; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type kqRWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.water new file mode 100644 index 0000000000..be9c344ced --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/k.water @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object k.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type kqRWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/km b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/km new file mode 100644 index 0000000000..1e0ff0fc79 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/km @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object km; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phim; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type zeroGradient; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut new file mode 100644 index 0000000000..bea937bd46 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "(inlet|outlet)" + { + type calculated; + value uniform 0; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.oil new file mode 100644 index 0000000000..c39682d482 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.oil @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object nut.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type nutkWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.water new file mode 100644 index 0000000000..5b3a457b88 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/nut.water @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object nut.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type nutkWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p new file mode 100644 index 0000000000..5551a60e2c --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type calculated; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p_rgh b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p_rgh new file mode 100644 index 0000000000..37db8af97f --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/fluid/p_rgh @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value $internalField; + } + + outlet + { + type prghPressure; + p $internalField; + value $internalField; + } + + topAndBottom + { + type fixedFluxPressure; + } + + wall + { + type fixedFluxPressure; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/solid/T b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/solid/T new file mode 100644 index 0000000000..77a33e55c3 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/0/solid/T @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 350; + +boundaryField +{ + wall + { + type coupledTemperature; + Tnbr T.water; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/Allrun b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/Allrun new file mode 100755 index 0000000000..351948baa6 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/Allrun @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +runApplication splitMeshRegions -cellZones -overwrite + +paraFoam -region fluid -touch +paraFoam -region solid -touch + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/g b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/g new file mode 100644 index 0000000000..ecb284923a --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 0); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.oil new file mode 100644 index 0000000000..3aa84c0acc --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.oil @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + model mixtureKEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.water new file mode 100644 index 0000000000..847f1b7dca --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/momentumTransport.water @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + model mixtureKEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/phaseProperties b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/phaseProperties new file mode 100644 index 0000000000..5e716ad467 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/phaseProperties @@ -0,0 +1,143 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type basicMultiphaseSystem; + +phases (oil water); + +oil +{ + type purePhaseModel; + diameterModel isothermal; + isothermalCoeffs + { + d0 3e-3; + p0 1e5; + } + + residualAlpha 1e-6; +} + +water +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 1e-4; + } + + residualAlpha 1e-6; +} + +blending +{ + default + { + type linear; + minFullyContinuousAlpha.oil 0.7; + minPartlyContinuousAlpha.oil 0.3; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.3; + } + + drag + { + type linear; + minFullyContinuousAlpha.oil 0.7; + minPartlyContinuousAlpha.oil 0.5; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.5; + } +} + +surfaceTension +{ + oil_water + { + type constant; + sigma 0.07; + } +} + +drag +{ + oil_dispersedIn_water + { + type SchillerNaumann; + residualRe 1e-3; + } + + water_dispersedIn_oil + { + type SchillerNaumann; + residualRe 1e-3; + } + + oil_segregatedWith_water + { + type segregated; + m 0.5; + n 8; + } +} + +virtualMass +{ + oil_dispersedIn_water + { + type constantCoefficient; + Cvm 0.5; + } + + water_dispersedIn_oil + { + type constantCoefficient; + Cvm 0.5; + } +} + +heatTransfer +{ + oil_dispersedIn_water + { + type RanzMarshall; + residualAlpha 1e-4; + } + + water_dispersedIn_oil + { + type RanzMarshall; + residualAlpha 1e-4; + } +} + +phaseTransfer +{} + +lift +{} + +wallLubrication +{} + +turbulentDispersion +{} + +interfaceCompression +{} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.oil b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.oil new file mode 100644 index 0000000000..5918661431 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.oil @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties.oil; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 160; + } + equationOfState + { + rho 800; + } + thermodynamics + { + Cv 2000; + Hf 0; + } + transport + { + mu 2e-3; + Pr 100; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.water b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.water new file mode 100644 index 0000000000..8843e086cf --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/fluid/physicalProperties.water @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rPolynomial; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18; + } + equationOfState + { + C (0.001278 -2.1055e-06 3.9689e-09 4.3772e-13 -2.0225e-16); + } + thermodynamics + { + Cv 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/solid/physicalProperties b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/solid/physicalProperties new file mode 100644 index 0000000000..3703546636 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/constant/solid/physicalProperties @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType constSolidThermo; + +rho +{ + type uniform; + value 8940; +} + +Cv +{ + type uniform; + value 385; +} + +kappa +{ + type uniform; + value 380; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/blockMeshDict b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/blockMeshDict new file mode 100644 index 0000000000..68433c83f2 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/blockMeshDict @@ -0,0 +1,158 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +cylinderRadius 0.005; // Radius of the cylinder +cylinderCore 0.002; // Radius of the core block inside the cylinder +halfWidth 0.04; // Half the channel width +halfThickness 0.0025; // Half the domain thickness +xDownstream 0.1; // X-coordinate of the downstream outlet + +cylinderRadialCells 12; // Cells across the radius of the non-core part of the cylinder +cylinderCoreCells 15; // Cells across the core block inside the cylinder +widthCells 30; // Cells across the domain width +downstreamCells 20; // Cells across the downstream region + +radialGrading 20; // Expansion ratio outside the cylinder in a radial direction + +geometry +{ + cylinder + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $cylinderRadius; + } +} + +vertices +( + project (#neg $cylinderCore #neg $cylinderCore #neg $halfThickness) (cylinder) + project ( $cylinderCore #neg $cylinderCore #neg $halfThickness) (cylinder) + project (#neg $cylinderCore #neg $cylinderCore $halfThickness) (cylinder) + project ( $cylinderCore #neg $cylinderCore $halfThickness) (cylinder) + + project (#neg $cylinderCore $cylinderCore #neg $halfThickness) (cylinder) + project ( $cylinderCore $cylinderCore #neg $halfThickness) (cylinder) + project (#neg $cylinderCore $cylinderCore $halfThickness) (cylinder) + project ( $cylinderCore $cylinderCore $halfThickness) (cylinder) + + (#neg $halfWidth #neg $halfWidth #neg $halfThickness) + ( $halfWidth #neg $halfWidth #neg $halfThickness) + (#neg $halfWidth #neg $halfWidth $halfThickness) + ( $halfWidth #neg $halfWidth $halfThickness) + + (#neg $halfWidth $halfWidth #neg $halfThickness) + ( $halfWidth $halfWidth #neg $halfThickness) + (#neg $halfWidth $halfWidth $halfThickness) + ( $halfWidth $halfWidth $halfThickness) + + ($xDownstream #neg $halfWidth #neg $halfThickness) + ($xDownstream #neg $halfWidth $halfThickness) + ($xDownstream $halfWidth #neg $halfThickness) + ($xDownstream $halfWidth $halfThickness) + + (#neg $cylinderCore #neg $cylinderCore #neg $halfThickness) + ( $cylinderCore #neg $cylinderCore #neg $halfThickness) + ( $cylinderCore #neg $cylinderCore $halfThickness) + (#neg $cylinderCore #neg $cylinderCore $halfThickness) + + (#neg $cylinderCore $cylinderCore #neg $halfThickness) + ( $cylinderCore $cylinderCore #neg $halfThickness) + ( $cylinderCore $cylinderCore $halfThickness) + (#neg $cylinderCore $cylinderCore $halfThickness) +); + +graded simpleGrading (1 $radialGrading 1); +uniform simpleGrading (1 1 1); + +blocks +( + hex (4 6 14 12 0 2 10 8) fluid (1 $widthCells $cylinderCoreCells) $graded + hex (7 5 13 15 3 1 9 11) fluid (1 $widthCells $cylinderCoreCells) $graded + hex (2 3 11 10 0 1 9 8) fluid ($cylinderCoreCells $widthCells 1) $graded + hex (7 6 14 15 5 4 12 13) fluid ($cylinderCoreCells $widthCells 1) $graded + hex (13 18 19 15 9 16 17 11) fluid ($downstreamCells 1 $cylinderCoreCells) $uniform + + hex (24 25 26 27 20 21 22 23) solid ($cylinderCoreCells 1 $cylinderCoreCells) $uniform + hex (0 2 23 20 4 6 27 24) solid (1 $cylinderRadialCells $cylinderCoreCells) $uniform + hex (21 22 3 1 25 26 7 5) solid (1 $cylinderRadialCells $cylinderCoreCells) $uniform + hex (0 2 3 1 20 23 22 21) solid (1 $cylinderCoreCells $cylinderRadialCells) $uniform + hex (4 5 7 6 24 25 26 27) solid ($cylinderCoreCells 1 $cylinderRadialCells) $uniform +); + +edges +( + project 0 2 (cylinder) + project 2 3 (cylinder) + project 3 1 (cylinder) + project 1 0 (cylinder) + project 4 6 (cylinder) + project 6 7 (cylinder) + project 7 5 (cylinder) + project 5 4 (cylinder) + project 0 4 (cylinder) + project 2 6 (cylinder) + project 3 7 (cylinder) + project 1 5 (cylinder) +); + +faces +( +); + +defaultPatch +{ + name frontAndBack; + type empty; +} + +boundary +( + inlet + { + type patch; + faces + ( + (8 10 14 12) + ); + } + + outlet + { + type patch; + faces + ( + (16 17 19 18) + ); + } + + topAndBottom + { + type patch; + faces + ( + (8 9 11 10) + (12 13 15 14) + (9 16 17 11) + (13 18 19 15) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/controlDict b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/controlDict new file mode 100644 index 0000000000..92d989af67 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/controlDict @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamMultiRun; + +regionSolvers +{ + fluid multiphaseEuler; + solid solid; +} + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 0.25; + +maxDi 200; + +maxDeltaT 1; + +functions +{ + #includeFunc patchAverage + ( + funcName=cylinderToil, + region=fluid, + patch=fluid_to_solid, + field=T.oil + ) + + #includeFunc patchAverage + ( + funcName=cylinderTwater, + region=fluid, + patch=fluid_to_solid, + field=T.water + ) +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvConstraints b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvConstraints new file mode 100644 index 0000000000..164c3e0bc0 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvConstraints @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSchemes b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSchemes new file mode 100644 index 0000000000..671b4d95ff --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSchemes @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,alpha.oil) Gauss vanLeer; + div(phi,alpha.water) Gauss vanLeer; + div(phir,alpha.water,alpha.oil) Gauss vanLeer; + div(phir,alpha.oil,alpha.water) Gauss vanLeer; + + div(alphaRhoPhi,U) Gauss limitedLinearV 1; + div(phi,U) Gauss limitedLinearV 1; + + "div\(alphaRhoPhi,(h|e)\)" Gauss limitedLinear 1; + div(alphaRhoPhi,K) Gauss limitedLinear 1; + div(alphaRhoPhi,(p|rho)) Gauss limitedLinear 1; + + "div\(alphaRhoPhi,(k|epsilon)\)" Gauss limitedLinear 1; + "div\(phim,(k|epsilon)m\)" Gauss limitedLinear 1; + + div((((alpha*rho)*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSolution b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSolution new file mode 100644 index 0000000000..a9ba912bb7 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fluid/fvSolution @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 2; + } + + p_rgh + { + solver GAMG; + smoother DIC; + + tolerance 1e-7; + relTol 0.01; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-7; + relTol 0; + } + + "e.*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-7; + relTol 0; + } + + "(k|epsilon).*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-7; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 1; + nNonOrthogonalCorrectors 1; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSchemes b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSchemes new file mode 100644 index 0000000000..0ae4c3c458 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSchemes @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSolution b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSolution new file mode 100644 index 0000000000..dd79b13b6f --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/fvSolution @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 3; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSchemes b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSchemes new file mode 100644 index 0000000000..f289fefcef --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSchemes @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSolution b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSolution new file mode 100644 index 0000000000..bfdb4e16d4 --- /dev/null +++ b/tutorials/modules/CHT/multiphaseCoolingCylinder2D/system/solid/fvSolution @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + e + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + eFinal + { + $e; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* //