diff --git a/applications/solvers/modules/film/Allwclean b/applications/solvers/modules/film/Allwclean new file mode 100755 index 0000000000..fa04946ea9 --- /dev/null +++ b/applications/solvers/modules/film/Allwclean @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +wclean libso filmThermophysicalTransportModels +wclean + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/modules/film/Allwmake b/applications/solvers/modules/film/Allwmake new file mode 100755 index 0000000000..ea4e04a2ea --- /dev/null +++ b/applications/solvers/modules/film/Allwmake @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +wmake $targetType filmThermophysicalTransportModels +wmake $targetType + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/modules/film/Make/files b/applications/solvers/modules/film/Make/files new file mode 100644 index 0000000000..08aedf4e6c --- /dev/null +++ b/applications/solvers/modules/film/Make/files @@ -0,0 +1,4 @@ +film.C +thermophysicalPredictor.C + +LIB = $(FOAM_LIBBIN)/libfilm diff --git a/applications/solvers/modules/film/Make/options b/applications/solvers/modules/film/Make/options new file mode 100644 index 0000000000..6614bd5600 --- /dev/null +++ b/applications/solvers/modules/film/Make/options @@ -0,0 +1,23 @@ +EXE_INC = \ + -I$(FOAM_SOLVERS)/modules/isothermalFilm/lnInclude \ + -IfilmThermophysicalTransportModels/lnInclude \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lisothermalFilm \ + -lfilmThermophysicalTransportModels \ + -lcoupledThermophysicalTransportModels \ + -lmomentumTransportModels \ + -lcompressibleMomentumTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -lsampling \ + -lfvModels \ + -lfvConstraints diff --git a/applications/solvers/modules/film/film.C b/applications/solvers/modules/film/film.C new file mode 100644 index 0000000000..77438f245f --- /dev/null +++ b/applications/solvers/modules/film/film.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "film.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solvers +{ + defineTypeNameAndDebug(film, 0); + addToRunTimeSelectionTable(solver, film, fvMesh); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solvers::film::film(fvMesh& mesh) +: + isothermalFilm(mesh), + + thermophysicalTransport + ( + filmThermophysicalTransportModel::New + ( + momentumTransport(), + thermo + ) + ) +{ + thermo.validate(type(), "h", "e"); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::solvers::film::~film() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::solvers::film::prePredictor() +{ + isothermalFilm::prePredictor(); + + if (pimple.predictTransport()) + { + thermophysicalTransport->predict(); + } +} + + +void Foam::solvers::film::postCorrector() +{ + isothermalFilm::postCorrector(); + + if (pimple.correctTransport()) + { + thermophysicalTransport->correct(); + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/film/film.H b/applications/solvers/modules/film/film.H new file mode 100644 index 0000000000..73f028831d --- /dev/null +++ b/applications/solvers/modules/film/film.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::solvers::film + +Description + Solver module for flow of compressible liquid films + + Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and + pseudo-transient and steady simulations. + + Optional fvModels and fvConstraints are provided to enhance the simulation + in many ways including adding various sources, Lagrangian particles, + radiation, surface film etc. and constraining or limiting the solution. + +SourceFiles + film.C + +See also + Foam::solvers::isothermalFilm + +\*---------------------------------------------------------------------------*/ + +#ifndef film_H +#define film_H + +#include "isothermalFilm.H" +#include "filmThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solvers +{ + +/*---------------------------------------------------------------------------*\ + Class film Declaration +\*---------------------------------------------------------------------------*/ + +class film +: + public isothermalFilm +{ + +protected: + + // Thermophysical transport + + autoPtr thermophysicalTransport; + + +public: + + //- Runtime type information + TypeName("film"); + + + // Constructors + + //- Construct from region mesh + film(fvMesh& mesh); + + //- Disallow default bitwise copy construction + film(const film&) = delete; + + + //- Destructor + virtual ~film(); + + + // Member Functions + + //- Called at the start of the PIMPLE loop + virtual void prePredictor(); + + //- Construct and solve the energy equation, + // convert to temperature + // and update thermophysical and transport properties + virtual void thermophysicalPredictor(); + + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const film&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace solvers +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/files b/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/files new file mode 100644 index 0000000000..be82f00fa9 --- /dev/null +++ b/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/files @@ -0,0 +1,3 @@ +filmThermophysicalTransportModels.C + +LIB = $(FOAM_LIBBIN)/libfilmThermophysicalTransportModels diff --git a/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/options b/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/options new file mode 100644 index 0000000000..d27c2eb778 --- /dev/null +++ b/applications/solvers/modules/film/filmThermophysicalTransportModels/Make/options @@ -0,0 +1,21 @@ +EXE_INC = \ + -I$(FOAM_SOLVERS)/modules/isothermalFilm/filmCompressibleMomentumTransportModels/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + +LIB_LIBS = \ + -lfluidThermoThermophysicalTransportModels \ + -lfluidThermophysicalModels \ + -lmomentumTransportModels \ + -lfilmCompressibleMomentumTransportModels \ + -lspecie \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModel.H b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModel.H new file mode 100644 index 0000000000..73c049b10f --- /dev/null +++ b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModel.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Typedef + Foam::filmThermophysicalTransportModel + +Description + Typedefs for film thermophysical transport models + +\*---------------------------------------------------------------------------*/ + +#ifndef filmThermophysicalTransportModel_H +#define filmThermophysicalTransportModel_H + +#include "fluidThermo.H" +#include "PhaseThermophysicalTransportModel.H" +#include "filmCompressibleMomentumTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef PhaseThermophysicalTransportModel + < + filmCompressibleMomentumTransportModel, + fluidThermo + > filmThermophysicalTransportModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.C b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.C new file mode 100644 index 0000000000..fbd7f37a71 --- /dev/null +++ b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "filmThermophysicalTransportModels.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModelTable +( + PhaseThermophysicalTransportModel, + filmCompressibleMomentumTransportModel, + fluidThermo +); + +makeThermophysicalTransportModelTableType +( + PhaseThermophysicalTransportModel, + filmCompressibleMomentumTransportModel, + fluidThermo, + laminar +); + + +// -------------------------------------------------------------------------- // +// Laminar models +// -------------------------------------------------------------------------- // + +#include "Fourier.H" +makeLaminarThermophysicalTransportModel(Fourier); + +#include "unityLewisFourier.H" +makeLaminarThermophysicalTransportModel(unityLewisFourier); + + +// ************************************************************************* // diff --git a/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.H b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.H new file mode 100644 index 0000000000..a14603428f --- /dev/null +++ b/applications/solvers/modules/film/filmThermophysicalTransportModels/filmThermophysicalTransportModels.H @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "filmThermophysicalTransportModel.H" +#include "laminarThermophysicalTransportModel.H" +#include "makeThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModelBaseType +( + PhaseThermophysicalTransportModel, + filmCompressibleMomentumTransportModel, + fluidThermo +); + +makeThermophysicalTransportModelType +( + PhaseThermophysicalTransportModel, + filmCompressibleMomentumTransportModel, + fluidThermo, + laminar +); + +#define makeLaminarThermophysicalTransportModel(Type) \ + makeThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + filmCompressibleMomentumTransportModel, \ + fluidThermo, \ + laminar, \ + Type \ + ) + + +// ************************************************************************* // diff --git a/applications/solvers/modules/film/thermophysicalPredictor.C b/applications/solvers/modules/film/thermophysicalPredictor.C new file mode 100644 index 0000000000..3b4763ee6c --- /dev/null +++ b/applications/solvers/modules/film/thermophysicalPredictor.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "film.H" +#include "fvmDdt.H" +#include "fvmDiv.H" + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::solvers::film::thermophysicalPredictor() +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix heEqn + ( + fvm::ddt(alpha, rho, he) + fvm::div(alphaRhoPhi, he) + + thermophysicalTransport->divq(he) + == + fvModels().source(alpha, rho, he) + ); + + heEqn.relax(); + + fvConstraints().constrain(heEqn); + + heEqn.solve(); + + fvConstraints().constrain(he); + + thermo.correct(); +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/0/film/T b/tutorials/modules/CHT/rivuletPanel/0/film/T new file mode 100644 index 0000000000..1351c69ffa --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/0/film/T @@ -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 T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 300; + } + + outlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } + + wall + { + type coupledTemperature; + value $internalField; + } + + empty + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/0/film/U b/tutorials/modules/CHT/rivuletPanel/0/film/U new file mode 100644 index 0000000000..3124ce36b6 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/0/film/U @@ -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 volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0 -0.075 0); + // value uniform (0 -0.25 0); + } + + outlet + { + type zeroGradient; + } + + sides + { + type noSlip; + } + + wall + { + type noSlip; + } + + empty + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/0/film/delta b/tutorials/modules/CHT/rivuletPanel/0/film/delta new file mode 100644 index 0000000000..db49e8afa1 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/0/film/delta @@ -0,0 +1,63 @@ +/*--------------------------------*- 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 delta; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type turbulentInlet; + // type fixedValue; + fluctuationScale 0.05; + referenceField uniform 1e-3; + alpha 0.1; + value uniform 1e-3; + } + + outlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } + + wall + { + type filmContactAngle; + + contactAngle + { + type gravitational; + theta0 70; + thetaAdv 90; + thetaRec 50; + gTheta 0.1; + } + } + + empty + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/0/film/p b/tutorials/modules/CHT/rivuletPanel/0/film/p new file mode 100644 index 0000000000..2a79ec7eba --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/0/film/p @@ -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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } + + wall + { + type zeroGradient; + } + + empty + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/0/panel/T b/tutorials/modules/CHT/rivuletPanel/0/panel/T new file mode 100644 index 0000000000..6c53cc8dca --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/0/panel/T @@ -0,0 +1,41 @@ +/*--------------------------------*- 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/panel"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 330; + +boundaryField +{ + "(inlet|outlet|sides)" + { + type zeroGradient; + } + + wall + { + type coupledTemperature; + value $internalField; + } + + insulatedWall + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/Allclean b/tutorials/modules/CHT/rivuletPanel/Allclean new file mode 100755 index 0000000000..2a71c1e034 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/Allclean @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf constant/panel/polyMesh +rm -rf constant/film/polyMesh + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/CHT/rivuletPanel/Allrun b/tutorials/modules/CHT/rivuletPanel/Allrun new file mode 100755 index 0000000000..5b3bfd918b --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/Allrun @@ -0,0 +1,25 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh -region panel + +runApplication -s 1 decomposePar -region panel -noFields + +runParallel extrudeToRegionMesh -region panel -overwrite + +runApplication -s 1 reconstructPar -allRegions + +runApplication -s 2 decomposePar -fields -allRegions + +printf "\n%s\n" "Creating files for paraview post-processing" +paraFoam -touchAll +echo + +runParallel $(getApplication) + +runApplication reconstructPar -allRegions + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/CHT/rivuletPanel/constant/film/g b/tutorials/modules/CHT/rivuletPanel/constant/film/g new file mode 100644 index 0000000000..770a56192e --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/constant/film/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 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/constant/film/momentumTransport b/tutorials/modules/CHT/rivuletPanel/constant/film/momentumTransport new file mode 100644 index 0000000000..8278c989ec --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/constant/film/momentumTransport @@ -0,0 +1,20 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/constant/film/physicalProperties b/tutorials/modules/CHT/rivuletPanel/constant/film/physicalProperties new file mode 100644 index 0000000000..e131771292 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/constant/film/physicalProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + +sigma +{ + type constant; + sigma 0.07; +} + +deltaWet 1e-8; + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/constant/panel/physicalProperties b/tutorials/modules/CHT/rivuletPanel/constant/panel/physicalProperties new file mode 100644 index 0000000000..d1f1bdeacf --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/constant/panel/physicalProperties @@ -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/metal"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIsoSolid; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + // Aluminium + + specie + { + molWeight 27; + } + equationOfState + { + rho 2700; + } + transport + { + kappa 200; + } + thermodynamics + { + Hf 0; + Cv 900; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/controlDict b/tutorials/modules/CHT/rivuletPanel/system/controlDict new file mode 100644 index 0000000000..d7f42a06dd --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/controlDict @@ -0,0 +1,61 @@ +/*--------------------------------*- 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 controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamMultiRun; + +regionSolvers +{ + film film; + panel solid; +} + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 10; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.2; + +maxDeltaT 5e-3; + +libs ("libisothermalFilm.so"); + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/decomposeParDict b/tutorials/modules/CHT/rivuletPanel/system/decomposeParDict new file mode 100644 index 0000000000..cc66455ee1 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/decomposeParDict @@ -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 dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); +} + +hierarchicalCoeffs +{ + n (1 1 1); + order xyz; +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/film/fvSchemes b/tutorials/modules/CHT/rivuletPanel/system/film/fvSchemes new file mode 100644 index 0000000000..10a28677c0 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/film/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- 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 filmGauss linear; +} + +divSchemes +{ + default none; + + div(phid,alpha) Gauss upwind; // vanLeer; + div(alphaRhoPhi,U) Gauss upwind; + div(alphaRhoPhi,e) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear orthogonal; +} + +snGradSchemes +{ + default orthogonal; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/film/fvSolution b/tutorials/modules/CHT/rivuletPanel/system/film/fvSolution new file mode 100644 index 0000000000..2b66db28a9 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/film/fvSolution @@ -0,0 +1,55 @@ +/*--------------------------------*- 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.*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-10; + relTol 0; + } + + "(U|e).*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-10; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor yes; + nOuterCorrectors 2; + nCorrectors 1; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/fvSolution b/tutorials/modules/CHT/rivuletPanel/system/fvSolution new file mode 100644 index 0000000000..f1497eb3b5 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/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 +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/panel/blockMeshDict b/tutorials/modules/CHT/rivuletPanel/system/panel/blockMeshDict new file mode 100644 index 0000000000..7804ae9c86 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/panel/blockMeshDict @@ -0,0 +1,106 @@ +/*--------------------------------*- 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; + +vertices +( + // front + ( 0 0 0.002) + ( 0.125 0 0.002) + ( 0.625 0 0.002) + ( 0.750 0 0.002) + ( 0 1 0.002) + ( 0.125 1 0.002) + ( 0.625 1 0.002) + ( 0.750 1 0.002) + + // back + ( 0 0 0) + ( 0.125 0 0) + ( 0.625 0 0) + ( 0.750 0 0) + ( 0 1 0) + ( 0.125 1 0) + ( 0.625 1 0) + ( 0.750 1 0) +); + +blocks +( + hex (0 1 9 8 4 5 13 12) (30 1 240) simpleGrading (1 1 1) + hex (1 2 10 9 5 6 14 13) (120 1 240) simpleGrading (1 1 1) + hex (2 3 11 10 6 7 15 14) (30 1 240) simpleGrading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces + ( + (5 6 14 13) + ); + } + + outlet + { + type patch; + faces + ( + (0 1 9 8) + (1 2 10 9) + (2 3 11 10) + ); + } + + sides + { + type patch; + faces + ( + (8 0 4 12) + (15 7 3 11) + (13 5 4 12) + (15 7 6 14) + ); + } + + extrudeWall + { + type wall; + faces + ( + (0 1 5 4) + (1 2 6 5) + (2 3 7 6) + ); + } + + insulatedWall + { + type wall; + faces + ( + (8 12 13 9) + (9 13 14 10) + (10 14 15 11) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/panel/extrudeToRegionMeshDict b/tutorials/modules/CHT/rivuletPanel/system/panel/extrudeToRegionMeshDict new file mode 100644 index 0000000000..fa9dc1becd --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/panel/extrudeToRegionMeshDict @@ -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 dictionary; + object extrudeToRegionMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +region film; + +patches (extrudeWall); + +adaptMesh yes; + +patchTypes (mappedWall); +patchNames (wall); + +regionPatchTypes (mappedFilmWall); +regionPatchNames (wall); + +regionOppositePatchTypes (empty); +regionOppositePatchNames (empty); + +extrudeModel linearNormal; + +nLayers 1; + +expansionRatio 1; + +linearNormalCoeffs +{ + thickness 0.01; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/panel/fvSchemes b/tutorials/modules/CHT/rivuletPanel/system/panel/fvSchemes new file mode 100644 index 0000000000..f56d5a0eaf --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/panel/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- 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/metal"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/rivuletPanel/system/panel/fvSolution b/tutorials/modules/CHT/rivuletPanel/system/panel/fvSolution new file mode 100644 index 0000000000..745712db67 --- /dev/null +++ b/tutorials/modules/CHT/rivuletPanel/system/panel/fvSolution @@ -0,0 +1,40 @@ +/*--------------------------------*- 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/metal"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + e + { + solver GAMG; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + maxIter 10; + } + + eFinal + { + $e; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +// ************************************************************************* // diff --git a/tutorials/modules/film/rivuletPanel/Allclean b/tutorials/modules/film/rivuletPanel/Allclean new file mode 100755 index 0000000000..888ffaa3ce --- /dev/null +++ b/tutorials/modules/film/rivuletPanel/Allclean @@ -0,0 +1,9 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase && rm -rf constant system 0 + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/film/rivuletPanel/Allrun b/tutorials/modules/film/rivuletPanel/Allrun new file mode 100755 index 0000000000..ba64272e8a --- /dev/null +++ b/tutorials/modules/film/rivuletPanel/Allrun @@ -0,0 +1,19 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run and clean functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Copy the source case +isTest "$@" && path=.. || path=$FOAM_TUTORIALS/modules/isothermalFilm +cp -r $path/rivuletPanel/constant . +cp -r $path/rivuletPanel/system . +cp -r $path/rivuletPanel/0 . + +runApplication -a foamDictionary system/controlDict -entry solver -set film + +runApplication blockMesh + +runApplication foamRun + +#------------------------------------------------------------------------------