Merge branch 'develop'

This commit is contained in:
Andrew Heather
2021-12-21 19:19:38 +00:00
10968 changed files with 117572 additions and 39375 deletions

View File

@ -49,7 +49,7 @@
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v1806|v1812|v1906|v1912|v2006|v2012|v2106 etc
OpenFOAM version : v2112|v2106|v2012|v2006|v1912|v1906 etc
Operating system : ubuntu|openSUSE|centos etc
Hardware info : any info that may help?
Compiler : gcc|intel|clang etc

View File

@ -8,7 +8,7 @@ wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error";
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
@ -23,23 +23,23 @@ else
echo "mpirun=$(command -v mpirun || true)"
fi
echo
# Report compiler information
# Report compiler information. First non-blank line from --version output
compiler="$(wmake -show-path-cxx 2>/dev/null || true)"
if [ -x "$compiler" ]
then
echo "compiler=$compiler"
"$compiler" --version 2>/dev/null | sed -ne '1p'
"$compiler" --version 2>/dev/null | sed -e '/^$/d;q'
else
echo "compiler=unknown"
fi
echo
echo "========================================"
echo ========================================
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*/}"
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo "========================================"
echo ========================================
echo
# Compile tools for wmake
@ -62,26 +62,24 @@ else
echo "Skip ThirdParty (no directory)"
fi
echo "========================================"
echo "Compile OpenFOAM libraries"
echo
# OpenFOAM libraries
src/Allwmake $targetType $*
echo "========================================"
echo "Compile OpenFOAM applications"
echo
# OpenFOAM applications
applications/Allwmake $targetType $*
# Additional components/modules
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
then
echo "========================================"
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
echo
elif [ -d "$WM_PROJECT_DIR/modules" ]
then
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
fi
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all )
esac
# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
@ -93,7 +91,7 @@ _foamCountDirEntries()
# Some summary information
echo
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "========================================"
echo ========================================
echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
@ -103,6 +101,6 @@ echo " patch = $(etc/openfoam -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
echo
echo "========================================"
echo ========================================
#------------------------------------------------------------------------------

View File

@ -1,2 +1,2 @@
api=2106
api=2112
patch=0

View File

@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
For example, for the OpenFOAM-v2106 version:
For example, for the OpenFOAM-v2112 version:
```
source /installation/path/OpenFOAM-v2106/etc/bashrc
source /installation/path/OpenFOAM-v2112/etc/bashrc
```
## Compiling OpenFOAM
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
to the OpenFOAM directory. For example,
```
/path/parent
|-- OpenFOAM-v2106
\-- ThirdParty-v2106
|-- OpenFOAM-v2112
\-- ThirdParty-v2112
```
There are, however, many cases where this simple convention is inadequate:
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
operating system or cluster installation provides it)
* When we have changed the OpenFOAM directory name to some arbitrary
directory name, e.g. openfoam-sandbox2106, etc..
directory name, e.g. openfoam-sandbox2112, etc..
* When we would like any additional 3rd party software to be located
inside of the OpenFOAM directory to ensure that the installation is
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
2. PREFIX/ThirdParty-VERSION
* this corresponds to the traditional approach
3. PREFIX/ThirdParty-vAPI
* allows for an updated value of VERSION, *eg*, `v2106-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2112-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2106` and the original `ThirdParty-v2106/` would be found.
be `2112` and the original `ThirdParty-v2112/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common

View File

@ -8,13 +8,17 @@ wmake -check-dir "$WM_PROJECT_DIR/applications" 2>/dev/null || {
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error";
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
echo ========================================
echo Compile OpenFOAM applications
echo ========================================
#------------------------------------------------------------------------------
wmake -all $targetType solvers
@ -24,3 +28,9 @@ wmake -all $targetType utilities
## wmake -all $targetType tools
#------------------------------------------------------------------------------
echo ========================================
echo Done OpenFOAM applications
echo ========================================
#------------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
Info<< "Selecting drag model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -57,7 +57,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
}
return autoPtr<PDRDragModel>
(cstrIter()(dict, turbulence, rho, U, phi));
(
ctorPtr(dict, turbulence, rho, U, phi)
);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
) << exit(FatalIOError);
}
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su));
return autoPtr<XiEqModel>(ctorPtr(dict, thermo, turbulence, Su));
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
) << exit(FatalIOError);
}
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su));
return autoPtr<XiGModel>(ctorPtr(dict, thermo, turbulence, Su));
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
Info<< "Selecting flame-wrinkling model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -59,7 +59,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
}
return autoPtr<XiModel>
(cstrIter()(dict, thermo, turbulence, Su, rho, b, phi));
(
ctorPtr(dict, thermo, turbulence, Su, rho, b, phi)
);
}

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -14,7 +15,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
@ -23,7 +23,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -50,4 +52,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lODE
-lODE \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -4,6 +4,5 @@ cd "${0%/*}" || exit # Run from this directory
wclean libso BCs
wclean
wclean rhoCentralDyMFoam
#------------------------------------------------------------------------------

View File

@ -5,8 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
(
wmake $targetType BCs \
&& wmake $targetType \
&& wmake $targetType rhoCentralDyMFoam \
&& wmake $targetType
)
#------------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -18,4 +18,6 @@ EXE_LIBS = \
-lspecie \
-lrhoCentralFoam \
-lturbulenceModels \
-lcompressibleTurbulenceModels
-lcompressibleTurbulenceModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh

View File

@ -1,3 +0,0 @@
rhoCentralDyMFoam.C
EXE = $(FOAM_APPBIN)/rhoCentralDyMFoam

View File

@ -1,26 +0,0 @@
EXE_INC = \
-I.. \
-I../BCs/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lrhoCentralFoam \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh

View File

@ -1,288 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
rhoCentralDyMFoam
Group
grpCompressibleSolvers grpMovingMeshSolvers
Description
Density-based compressible flow solver based on central-upwind
schemes of Kurganov and Tadmor
with support for mesh-motion and topology changes.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "fixedRhoFvPatchScalarField.H"
#include "directionInterpolate.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
#include "motionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Density-based compressible flow solver based on central-upwind"
" schemes of Kurganov and Tadmor.\n"
"With support for mesh-motion and topology changes."
);
#define NO_CONTROL
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createTimeControls.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "readFluxScheme.H"
const dimensionedScalar v_zero(dimVolume/dimTime, Zero);
// Courant numbers used to adjust the time-step
scalar CoNum = 0.0;
scalar meanCoNum = 0.0;
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "setDeltaT.H"
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Do any mesh changes
mesh.update();
// --- Directed interpolation of primitive fields onto faces
surfaceScalarField rho_pos(interpolate(rho, pos));
surfaceScalarField rho_neg(interpolate(rho, neg));
surfaceVectorField rhoU_pos(interpolate(rhoU, pos, U.name()));
surfaceVectorField rhoU_neg(interpolate(rhoU, neg, U.name()));
volScalarField rPsi("rPsi", 1.0/psi);
surfaceScalarField rPsi_pos(interpolate(rPsi, pos, T.name()));
surfaceScalarField rPsi_neg(interpolate(rPsi, neg, T.name()));
surfaceScalarField e_pos(interpolate(e, pos, T.name()));
surfaceScalarField e_neg(interpolate(e, neg, T.name()));
surfaceVectorField U_pos("U_pos", rhoU_pos/rho_pos);
surfaceVectorField U_neg("U_neg", rhoU_neg/rho_neg);
surfaceScalarField p_pos("p_pos", rho_pos*rPsi_pos);
surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg);
surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf());
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
// Make fluxes relative to mesh-motion
if (mesh.moving())
{
phiv_pos -= mesh.phi();
phiv_neg -= mesh.phi();
}
// Note: extracted out the orientation so becomes unoriented
phiv_pos.setOriented(false);
phiv_neg.setOriented(false);
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
surfaceScalarField cSf_pos
(
"cSf_pos",
interpolate(c, pos, T.name())*mesh.magSf()
);
surfaceScalarField cSf_neg
(
"cSf_neg",
interpolate(c, neg, T.name())*mesh.magSf()
);
surfaceScalarField ap
(
"ap",
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
);
surfaceScalarField am
(
"am",
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
);
surfaceScalarField a_pos("a_pos", ap/(ap - am));
surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap)));
surfaceScalarField aSf("aSf", am*a_pos);
if (fluxScheme == "Tadmor")
{
aSf = -0.5*amaxSf;
a_pos = 0.5;
}
surfaceScalarField a_neg("a_neg", 1.0 - a_pos);
phiv_pos *= a_pos;
phiv_neg *= a_neg;
surfaceScalarField aphiv_pos("aphiv_pos", phiv_pos - aSf);
surfaceScalarField aphiv_neg("aphiv_neg", phiv_neg + aSf);
// Reuse amaxSf for the maximum positive and negative fluxes
// estimated by the central scheme
amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));
#include "centralCourantNo.H"
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
surfaceVectorField phiU(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg);
// Note: reassembled orientation from the pos and neg parts so becomes
// oriented
phiU.setOriented(true);
surfaceVectorField phiUp(phiU + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf());
surfaceScalarField phiEp
(
"phiEp",
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
+ aSf*p_pos - aSf*p_neg
);
// Make flux for pressure-work absolute
if (mesh.moving())
{
surfaceScalarField phia(a_pos*p_pos + a_neg*p_neg);
phia.setOriented(true);
phiEp += mesh.phi()*phia;
}
volScalarField muEff("muEff", turbulence->muEff());
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
// --- Solve density
solve(fvm::ddt(rho) + fvc::div(phi));
// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
U.ref() =
rhoU()
/rho();
U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
if (!inviscid)
{
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
}
// --- Solve energy
surfaceScalarField sigmaDotU
(
"sigmaDotU",
(
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
)
& (a_pos*U_pos + a_neg*U_neg)
);
solve
(
fvm::ddt(rhoE)
+ fvc::div(phiEp)
- fvc::div(sigmaDotU)
);
e = rhoE/rho - 0.5*magSqr(U);
e.correctBoundaryConditions();
thermo.correct();
rhoE.boundaryFieldRef() ==
rho.boundaryField()*
(
e.boundaryField() + 0.5*magSqr(U.boundaryField())
);
if (!inviscid)
{
solve
(
fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(turbulence->alphaEff(), e)
);
thermo.correct();
rhoE = rho*(e + 0.5*magSqr(U));
}
p.ref() =
rho()
/psi();
p.correctBoundaryConditions();
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
turbulence->correct();
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,12 +31,14 @@ Group
grpCompressibleSolvers
Description
Density-based compressible flow solver based on central-upwind
schemes of Kurganov and Tadmor.
Density-based compressible flow solver based on
central-upwind schemes of Kurganov and Tadmor with
support for mesh-motion and topology changes.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "fixedRhoFvPatchScalarField.H"
@ -49,8 +52,9 @@ int main(int argc, char *argv[])
{
argList::addNote
(
"Density-based compressible flow solver based on central-upwind"
" schemes of Kurganov and Tadmor."
"Density-based compressible flow solver based on"
" central-upwind schemes of Kurganov and Tadmor with"
" support for mesh-motion and topology changes."
);
#define NO_CONTROL
@ -59,7 +63,7 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createDynamicFvMesh.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createTimeControls.H"
@ -80,6 +84,18 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
if (!LTS)
{
#include "setDeltaT.H"
++runTime;
// Do any mesh changes
mesh.update();
}
// --- Directed interpolation of primitive fields onto faces
surfaceScalarField rho_pos(interpolate(rho, pos));
@ -107,6 +123,15 @@ int main(int argc, char *argv[])
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
phiv_neg.setOriented(false);
// Make fluxes relative to mesh-motion
if (mesh.moving())
{
surfaceScalarField meshPhi(mesh.phi());
meshPhi.setOriented(false);
phiv_pos -= meshPhi;
phiv_neg -= meshPhi;
}
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
surfaceScalarField cSf_pos
(
@ -157,18 +182,13 @@ int main(int argc, char *argv[])
amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));
#include "centralCourantNo.H"
#include "readTimeControls.H"
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "setDeltaT.H"
}
++runTime;
++runTime;
}
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -189,6 +209,14 @@ int main(int argc, char *argv[])
+ aSf*p_pos - aSf*p_neg
);
// Make flux for pressure-work absolute
if (mesh.moving())
{
surfaceScalarField meshPhi(mesh.phi());
meshPhi.setOriented(false);
phiEp += meshPhi*(a_pos*p_pos + a_neg*p_neg);
}
volScalarField muEff("muEff", turbulence->muEff());
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));

View File

@ -8,7 +8,8 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -23,4 +24,5 @@ EXE_LIBS = \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling \
-latmosphericModels
-latmosphericModels \
-lregionFaModels

View File

@ -49,7 +49,7 @@
);
}
// Update tho boundary values of the reciprocal time-step
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -18,4 +19,5 @@ EXE_LIBS = \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-latmosphericModels
-latmosphericModels \
-lregionFaModels

View File

@ -1,8 +1,11 @@
EXE_INC = \
-I../buoyantBoussinesqSimpleFoam \
-I../../incompressible/pimpleFoam \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
@ -13,6 +16,8 @@ EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,7 +31,8 @@ Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent flow of incompressible fluids.
Transient solver for buoyant, turbulent flow of incompressible fluids,
with optional mesh motion and mesh topology changes.
Uses the Boussinesq approximation:
\f[
@ -51,9 +53,11 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
#include "pimpleControl.H"
@ -64,7 +68,8 @@ int main(int argc, char *argv[])
argList::addNote
(
"Transient solver for buoyant, turbulent flow"
" of incompressible fluids.\n"
" of incompressible fluids, with optional mesh"
" motion and mesh topology changes.\n"
"Uses the Boussinesq approximation."
);
@ -73,10 +78,10 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createTimeControls.H"
#include "createUfIfPresent.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
#include "initContinuityErrs.H"
@ -89,7 +94,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
@ -100,6 +105,34 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
// Do any mesh changes
mesh.controlledUpdate();
if (mesh.changing())
{
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
#include "correctPhi.H"
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
}
#include "UEqn.H"
#include "TEqn.H"

View File

@ -42,6 +42,12 @@
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
// Correct Uf if the mesh is moving
fvc::correctUf(Uf, U, phi);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
}
}

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I../../compressible/rhoPimpleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
@ -6,7 +7,10 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -19,4 +23,8 @@ EXE_LIBS = \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-latmosphericModels
-latmosphericModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lregionFaModels

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,8 +31,9 @@ Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent flow of compressible fluids for
ventilation and heat-transfer.
Transient solver for buoyant, turbulent flow of compressible fluids
for ventilation and heat-transfer, with optional mesh motion
and mesh topology changes.
Turbulence is modelled using a run-time selectable compressible RAS or
LES model.
@ -39,12 +41,16 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "rhoThermo.H"
#include "turbulentFluidThermoModel.H"
#include "radiationModel.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,7 +59,8 @@ int main(int argc, char *argv[])
argList::addNote
(
"Transient solver for buoyant, turbulent fluid flow"
" of compressible fluids, including radiation."
" of compressible fluids, including radiation,"
" with optional mesh motion and mesh topology changes."
);
#include "postProcess.H"
@ -61,36 +68,105 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
#include "createRhoUfIfPresent.H"
turbulence->validate();
if (!LTS)
{
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
#include "readDyMControls.H"
// Store divrhoU from the previous mesh
// so that it can be mapped and used in correctPhi
// to ensure the corrected phi has the same divergence
autoPtr<volScalarField> divrhoU;
if (correctPhi)
{
divrhoU.reset
(
new volScalarField
(
"divrhoU",
fvc::div(fvc::absolute(phi, rho, U))
)
);
}
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
}
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
// Store momentum to set rhoUf for introduced faces.
autoPtr<volVectorField> rhoU;
if (rhoUf.valid())
{
rhoU.reset(new volVectorField("rhoU", rho*U));
}
// Do any mesh changes
mesh.update();
if (mesh.changing())
{
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & rhoUf();
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
}
if (pimple.firstIter() && !pimple.SIMPLErho())
{
#include "rhoEqn.H"
}
#include "UEqn.H"
#include "EEqn.H"

View File

@ -1,3 +1,5 @@
#include "createRDeltaT.H"
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));

View File

@ -28,6 +28,8 @@ MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
fvc::makeRelative(phiHbyA, rho, U);
fvScalarMatrix p_rghDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
@ -104,7 +106,15 @@ else
rho = thermo.rho();
// Correct rhoUf if the mesh is moving
fvc::correctRhoUf(rhoUf, rho, U, phi);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
if (mesh.moving())
{
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
}
}

View File

@ -6,7 +6,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -19,4 +20,5 @@ EXE_LIBS = \
-lradiationModels \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-latmosphericModels
-latmosphericModels \
-lregionFaModels

View File

@ -18,7 +18,9 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -36,4 +38,5 @@ EXE_LIBS = \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lradiationModels \
-lregionModels
-lregionModels \
-lregionFaModels

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,6 +54,7 @@ Description
#include "loopControl.H"
#include "pressureControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
@ -80,6 +81,8 @@ int main(int argc, char *argv[])
#include "solidRegionDiffusionNo.H"
#include "setInitialMultiRegionDeltaT.H"
#include "createCoupledRegions.H"
while (runTime.run())
{
#include "readTimeControls.H"
@ -109,8 +112,6 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "solveFluid.H"
@ -118,13 +119,41 @@ int main(int argc, char *argv[])
forAll(solidRegions, i)
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "solveSolid.H"
}
if (coupled)
{
Info<< "\nSolving energy coupled regions " << endl;
fvMatrixAssemblyPtr->solve();
#include "correctThermos.H"
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
if (!frozenFlow)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
turbulence.correct();
}
rho = thermo.rho();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
fvMatrixAssemblyPtr->clear();
}
// Additional loops for energy solution only
if (!oCorr && nOuterCorr > 1)
{
@ -152,6 +181,21 @@ int main(int argc, char *argv[])
#include "readSolidMultiRegionPIMPLEControls.H"
#include "solveSolid.H"
}
if (coupled)
{
Info<< "\nSolving energy coupled regions " << endl;
fvMatrixAssemblyPtr->solve();
#include "correctThermos.H"
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
rho = thermo.rho();
}
fvMatrixAssemblyPtr->clear();
}
}
}
}

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I./fluid \
-I./solid \
-I../solid \
-I./../include \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -35,3 +36,4 @@ EXE_LIBS = \
-lregionModels \
-lsampling \
-lregionFaModels

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -66,6 +66,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMeshes.H"
#include "createFields.H"
#include "createCoupledRegions.H"
#include "initContinuityErrs.H"
while (runTime.loop())
@ -83,13 +84,32 @@ int main(int argc, char *argv[])
forAll(solidRegions, i)
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionSIMPLEControls.H"
#include "solveSolid.H"
}
if (coupled)
{
Info<< "\nSolving energy coupled regions" << endl;
fvMatrixAssemblyPtr->solve();
#include "correctThermos.H"
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
#include "readSolidMultiRegionSIMPLEControls.H"
if (!frozenFlow)
{
#include "pEqn.H"
turb.correct();
}
}
fvMatrixAssemblyPtr->clear();
}
// Additional loops for energy solution only
{
loopControl looping(runTime, "SIMPLE", "energyCoupling");
@ -116,6 +136,15 @@ int main(int argc, char *argv[])
#include "readSolidMultiRegionSIMPLEControls.H"
#include "solveSolid.H"
}
if (coupled)
{
Info<< "\nSolving energy coupled regions.. " << endl;
fvMatrixAssemblyPtr->solve();
#include "correctThermos.H"
fvMatrixAssemblyPtr->clear();
}
}
}

View File

@ -20,13 +20,20 @@
fvOptions.constrain(EEqn);
EEqn.solve();
if (coupled)
{
fvMatrixAssemblyPtr->addFvMatrix(EEqn);
}
else
{
EEqn.solve();
fvOptions.correct(he);
fvOptions.correct(he);
thermo.correct();
rad.correct();
thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
}

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> tUEqn
UEqn =
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,7 +10,6 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax();

View File

@ -21,6 +21,8 @@ PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
PtrList<fvVectorMatrix> UEqFluid(fluidRegions.size());
const uniformDimensionedVectorField& g = meshObjects::gravity::New(runTime);
// Populate fluid field pointer lists
@ -222,5 +224,11 @@ forAll(fluidRegions, i)
new fv::options(fluidRegions[i])
);
UEqFluid.set
(
i,
new fvVectorMatrix(UFluid[i], dimForce)
);
turbulence[i].validate();
}

View File

@ -2,7 +2,7 @@
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
tUEqn.clear();
//tUEqn.clear();
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

View File

@ -22,6 +22,8 @@
IOMRFZoneList& MRF = MRFfluid[i];
fv::options& fvOptions = fluidFvOptions[i];
fvVectorMatrix& UEqn = UEqFluid[i];
const dimensionedScalar initialMass
(
"initialMass",

View File

@ -12,8 +12,10 @@
#include "UEqn.H"
#include "EEqn.H"
#include "pEqn.H"
turb.correct();
if (!coupled)
{
#include "pEqn.H"
turb.correct();
}
}
}

View File

@ -16,13 +16,21 @@
fvOptions.constrain(hEqn);
hEqn.solve();
if (coupled)
{
fvMatrixAssemblyPtr->addFvMatrix(hEqn);
}
else
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
fvOptions.correct(h);
hEqn.solve();
fvOptions.correct(h);
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I${phaseSystem}/twoPhaseCompressibleTurbulenceModels/lnInclude \
-I${phaseSystem}/multiphaseSystem/lnInclude \
-I./fluid \
-I./solid \
-I../solid \
-I../fluid \
-I../include \

View File

@ -0,0 +1,39 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
{
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
hEqn.relax();
fvOptions.constrain(hEqn);
hEqn.solve(mesh.solver(h.select(finalIter)));
fvOptions.correct(h);
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -27,13 +27,19 @@
fvOptions.constrain(EEqn);
EEqn.solve(mesh.solver(he.select(finalIter)));
if (coupled)
{
fvMatrixAssemblyPtr->addFvMatrix(EEqn);
}
else
{
EEqn.solve(mesh.solver(he.select(finalIter)));
fvOptions.correct(he);
fvOptions.correct(he);
thermo.correct();
rad.correct();
thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
}

View File

@ -2,7 +2,7 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> tUEqn
UEqn =
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
@ -10,7 +10,6 @@
==
fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax();

View File

@ -16,6 +16,8 @@ PtrList<multivariateSurfaceInterpolationScheme<scalar>::fieldTable>
fieldsFluid(fluidRegions.size());
PtrList<volScalarField> QdotFluid(fluidRegions.size());
PtrList<fvVectorMatrix> UEqFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size());
List<bool> frozenFlowFluid(fluidRegions.size(), false);
@ -293,6 +295,12 @@ forAll(fluidRegions, i)
new fv::options(fluidRegions[i])
);
UEqFluid.set
(
i,
new fvVectorMatrix(UFluid[i], dimForce)
);
turbulenceFluid[i].validate();
pRefCellFluid[i] = -1;

View File

@ -49,6 +49,8 @@
IOMRFZoneList& MRF = MRFfluid[i];
fv::options& fvOptions = fluidFvOptions[i];
fvVectorMatrix& UEqn = UEqFluid[i];
const dimensionedScalar initialMass
(
"initialMass",

View File

@ -18,15 +18,20 @@ else
#include "YEqn.H"
#include "EEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
if (!coupled)
{
#include "pEqn.H"
Info<< "\nSolving for fluid region " << fluidRegions[i].name() << endl;
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
turbulence.correct();
rho = thermo.rho();
}
turbulence.correct();
rho = thermo.rho();
}
if (finalIter)

View File

@ -0,0 +1,20 @@
forAll(fluidRegions, i)
{
rhoThermo& thermo = thermoFluid[i];
radiation::radiationModel& rad = radiation[i];
fv::options& fvOptions = fluidFvOptions[i];
volScalarField& he = thermo.he();
fvOptions.correct(he);
thermo.correct();
rad.correct();
}
forAll(solidRegions, i)
{
solidThermo& thermo = thermos[i];
fv::options& fvOptions = solidHeatSources[i];
volScalarField& h = thermo.he();
fvOptions.correct(h);
thermo.correct();
}

View File

@ -0,0 +1,69 @@
fvSolution solutionDict(runTime);
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false));
autoPtr<fvMatrix<scalar>> fvMatrixAssemblyPtr;
forAll(fluidRegions, i)
{
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
const auto& bpsi = thermo.T().boundaryField();
forAll(bpsi, patchI)
{
if (bpsi[patchI].useImplicit())
{
coupled = true;
}
}
}
forAll(solidRegions, i)
{
solidThermo& thermo = thermos[i];
const auto& bpsi = thermo.T().boundaryField();
forAll(bpsi, patchI)
{
if (bpsi[patchI].useImplicit())
{
coupled = true;
}
}
}
forAll(fluidRegions, i)
{
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
if (coupled)
{
Info<< "Create fvMatrixAssembly." << endl;
fvMatrixAssemblyPtr.reset
(
new fvMatrix<scalar>
(
thermo.he(),
dimEnergy/dimTime
)
);
break;
}
}
if (coupled && !fvMatrixAssemblyPtr)
{
forAll(solidRegions, i)
{
solidThermo& thermo = thermos[i];
Info<< "Create fvMatrixAssembly." << endl;
fvMatrixAssemblyPtr.reset
(
new fvMatrix<scalar>
(
thermo.he(),
dimEnergy/dimTime
)
);
break;
}
}

View File

@ -1,39 +1,45 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
hEqn.relax();
fvOptions.constrain(hEqn);
if (coupled)
{
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
fvMatrixAssemblyPtr->addFvMatrix(hEqn);
}
else
{
Info<< "\nSolving for solid region "<< solidRegions[i].name() << endl;
hEqn.relax();
fvOptions.constrain(hEqn);
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
hEqn.solve(mesh.solver(h.select(finalIter)));
fvOptions.correct(h);
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -90,5 +90,24 @@ else
);
}
// Consider mesh flux to correct for mesh deformation
bool meshFluxCorr(false);
if (mesh.solutionDict().found("SIMPLE"))
{
meshFluxCorr =
mesh.solutionDict().subDict("SIMPLE").getOrDefault<bool>
(
"meshFluxCorrection", false
);
}
else if (mesh.solutionDict().found("PIMPLE"))
{
meshFluxCorr =
mesh.solutionDict().subDict("PIMPLE").getOrDefault<bool>
(
"meshFluxCorrection", false
);
}
#include "createRadiationModel.H"
#include "createFvOptions.H"

View File

@ -11,14 +11,14 @@
fvOptions(rho, h)
);
if (mesh.changing())
if (meshFluxCorr)
{
surfaceScalarField phihMesh
(
fvc::interpolate(betav*rho*h)*mesh.phi()
);
hEqn -= fvc::div(phihMesh);
hEqn -= fvc::div(phihMesh);
}
hEqn.relax();

View File

@ -7,7 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels\lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -20,4 +21,5 @@ EXE_LIBS = \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-latmosphericModels
-latmosphericModels \
-lregionFaModels

View File

@ -1,3 +1,5 @@
#include "createRDeltaT.H"
Info<< "Reading field p\n" << endl;
volScalarField p
(

View File

@ -6,10 +6,7 @@ if (pimple.ddtCorr())
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
}
else
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU));
}
MRF.makeRelative(phiHbyA);

View File

@ -81,6 +81,8 @@ Note
#include "pimpleControl.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -107,6 +109,12 @@ int main(int argc, char *argv[])
turbulence->validate();
if (!LTS)
{
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -114,8 +122,16 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "setDeltaT.H"
}
++runTime;

View File

@ -0,0 +1,69 @@
{
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();
scalar maxCo
(
pimpleDict.getOrDefault<scalar>("maxCo", 0.8)
);
scalar rDeltaTSmoothingCoeff
(
pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
);
scalar rDeltaTDampingCoeff
(
pimpleDict.getOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
);
scalar maxDeltaT
(
pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V())
);
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
// Limit rate of change of time scale
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT =
rDeltaT0
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
}

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I../.. \
-I../../DPMTurbulenceModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -19,7 +20,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -39,4 +42,7 @@ EXE_LIBS = \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I.. \
-I../DPMTurbulenceModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -18,7 +19,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -38,4 +41,7 @@ EXE_LIBS = \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -149,6 +149,17 @@ Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devReff
(
const volVectorField& U
) const
{
return devRhoReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::divDevReff
@ -170,6 +181,19 @@ Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devRhoReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devRhoReff
(
const volVectorField& U
) const
{
NotImplemented;
return nullptr;
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::divDevRhoReff

View File

@ -116,12 +116,24 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
};

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I.. \
-I../DPMTurbulenceModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -17,6 +18,8 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -33,4 +36,7 @@ EXE_LIBS = \
-lDPMTurbulenceModels \
-lregionModels \
-lsurfaceFilmModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I./DPMTurbulenceModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -14,7 +15,9 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -31,4 +34,7 @@ EXE_LIBS = \
-lDPMTurbulenceModels \
-lregionModels \
-lsurfaceFilmModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
@ -11,13 +12,14 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
@ -45,4 +47,7 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-lODE \
-lcombustionModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -13,7 +14,9 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -30,4 +33,7 @@ EXE_LIBS = \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lregionModels \
-lsurfaceFilmModels
-lsurfaceFilmModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -16,7 +17,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -36,4 +39,7 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh
-ltopoChangerFvMesh \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -0,0 +1,3 @@
kinematicParcelFoam.C
EXE = $(FOAM_APPBIN)/kinematicParcelFoam

View File

@ -0,0 +1,42 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-latmosphericModels \
-lregionModels \
-lsurfaceFilmModels \
-lsurfaceFilmDerivedFvPatchFields \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -0,0 +1,22 @@
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
parcels.SU(U, true)
+ fvOptions(U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
}

View File

@ -0,0 +1,16 @@
const word kinematicCloudName
(
args.getOrDefault<word>("cloud", "kinematicCloud")
);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCloud parcels
(
kinematicCloudName,
rhoInf,
U,
muc,
g
);

View File

@ -0,0 +1 @@
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();

View File

@ -0,0 +1,85 @@
#include "readGravitationalAcceleration.H"
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
dimensionedScalar rhoInfValue
(
"rhoInf",
dimDensity,
laminarTransport
);
volScalarField rhoInf
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
rhoInfValue
);
volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
rhoInf*laminarTransport.nu()
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
#include "createMRF.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createFvOptions.H"

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
kinematicParcelFoam
Group
grpLagrangianSolvers
Description
Transient solver for incompressible, turbulent flow with kinematic,
particle cloud, and surface film modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "surfaceFilmModel.H"
#include "basicKinematicCloud.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for incompressible, turbulent flow"
" with kinematic particle clouds"
" and surface film modelling."
);
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createRegionControls.H"
#include "createUfIfPresent.H"
turbulence->validate();
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setMultiRegionDeltaT.H"
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store the particle positions
parcels.storeGlobalPositions();
// Do any mesh changes
mesh.update();
if (solvePrimaryRegion && mesh.changing())
{
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
#include "../../incompressible/pimpleFoam/correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
parcels.evolve();
surfaceFilm.evolve();
if (solvePrimaryRegion)
{
// --- PIMPLE loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
laminarTransport.correct();
turbulence->correct();
}
}
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
if (pimple.ddtCorr())
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
}
MRF.makeRelative(phiHbyA);
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAU, MRF);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p)
==
fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
p.relax();
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
// Correct rhoUf if the mesh is moving
fvc::correctUf(Uf, U, phi);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I../reactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
@ -12,13 +13,14 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
@ -49,4 +51,7 @@ EXE_LIBS = \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lODE \
-lcombustionModels
-lcombustionModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -11,7 +11,11 @@ basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
if (!composition.species().found(inertSpecie))
if
(
!composition.species().found(inertSpecie)
&& composition.species().size() > 0
)
{
FatalIOErrorIn(args.executable().c_str(), thermo)
<< "Inert specie " << inertSpecie << " not found in available species "

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
@ -12,13 +13,14 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
@ -48,4 +50,7 @@ EXE_LIBS = \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lODE \
-lcombustionModels
-lcombustionModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -12,7 +13,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -20,6 +20,8 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam
@ -44,4 +46,7 @@ EXE_LIBS = \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -12,7 +13,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -21,7 +21,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -44,4 +46,7 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-lcombustionModels \
-lsampling \
-lcoalCombustion
-lcoalCombustion \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I../reactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -13,7 +14,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -21,6 +21,8 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
EXE_LIBS = \
@ -45,4 +47,7 @@ EXE_LIBS = \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I.. \
-I../../reactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -15,7 +16,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -24,7 +24,9 @@ EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -49,4 +51,7 @@ EXE_LIBS = \
-lengine \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels
-lcombustionModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -13,7 +14,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -21,7 +21,9 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -45,4 +47,7 @@ EXE_LIBS = \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lsampling
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I../../reactingParcelFoam \
-I../../../compressible/rhoPimpleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
@ -15,7 +16,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
@ -26,7 +26,9 @@ EXE_INC = \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -52,4 +54,7 @@ EXE_LIBS = \
-lcombustionModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh
-ldynamicMesh \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -11,7 +12,9 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
EXE_LIBS = \
-lfiniteVolume \
@ -27,4 +30,7 @@ EXE_LIBS = \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lregionModels \
-lsurfaceFilmModels
-lsurfaceFilmModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -14,7 +15,9 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -33,4 +36,7 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh
-ltopoChangerFvMesh \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I../VoF \
-I$(FOAM_SOLVERS)/multiphase/interFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
@ -20,7 +21,9 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -38,3 +41,4 @@ EXE_LIBS = \
-lregionModels \
-lsurfaceFilmModels \
-lcompressibleTwoPhaseMixtureTurbulenceModels

View File

@ -161,12 +161,11 @@
surfaceScalarField phir(phic*mixture.nHatf());
tmp<surfaceScalarField> talphaPhi1Un
(
alphaPhiUn =
fvc::flux
(
phiCN(),
cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(),
phi,
alpha1,
alphaScheme
)
+ fvc::flux
@ -174,19 +173,18 @@
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
);
if (MULESCorr)
{
tmp<surfaceScalarField> talphaPhi1Corr(talphaPhi1Un() - alphaPhi10);
tmp<surfaceScalarField> talphaPhi1Corr(alphaPhiUn - alphaPhi10);
volScalarField alpha10("alpha10", alpha1);
MULES::correct
(
geometricOneField(),
alpha1,
talphaPhi1Un(),
alphaPhiUn,
talphaPhi1Corr.ref(),
Sp,
(-Sp*alpha1)(),
@ -207,7 +205,7 @@
}
else
{
alphaPhi10 = talphaPhi1Un;
alphaPhi10 = alphaPhiUn;
MULES::explicitSolve
(

View File

@ -24,3 +24,18 @@ surfaceScalarField alphaPhi10
// MULES Correction
tmp<surfaceScalarField> talphaPhi1Corr0;
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(phi.dimensions(), Zero)
);

View File

@ -14,7 +14,6 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -122,8 +122,8 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_)),
fv::cellSetOption(sourceName, modelType, dict, mesh),
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_, &mesh)),
L_("L", dimEnergy/dimMass, coeffs_),
relax_(coeffs_.getOrDefault("relax", 0.9)),
Cu_(coeffs_.getOrDefault<scalar>("Cu", 100000)),

View File

@ -99,7 +99,7 @@ namespace fv
class VoFSolidificationMeltingSource
:
public cellSetOption
public fv::cellSetOption
{
// Private data

View File

@ -31,9 +31,9 @@ License
bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict)
{
if (cellSetOption::read(dict))
if (fv::cellSetOption::read(dict))
{
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_);
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_, &mesh_);
coeffs_.readEntry("L", L_);
coeffs_.readIfPresent("relax", relax_);
coeffs_.readIfPresent("Cu", Cu_);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -203,6 +204,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
@ -214,6 +227,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;

View File

@ -318,6 +318,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
@ -329,6 +341,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -130,9 +131,9 @@ bool Foam::mixtureViscosityModels::BinghamPlastic::read
{
plastic::read(viscosityProperties);
plasticCoeffs_.readEntry("yieldStressCoeff", yieldStressCoeff_);
plasticCoeffs_.readEntry("yieldStressExponent", yieldStressExponent_);
plasticCoeffs_.readEntry("yieldStressOffset", yieldStressOffset_);
plasticCoeffs_.readEntry("BinghamCoeff", yieldStressCoeff_);
plasticCoeffs_.readEntry("BinghamExponent", yieldStressExponent_);
plasticCoeffs_.readEntry("BinghamOffset", yieldStressOffset_);
return true;
}

View File

@ -27,6 +27,7 @@ License
#include "mixtureViscosityModel.H"
#include "volFields.H"
#include "surfaceMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -44,9 +44,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
Info<< "Selecting incompressible transport model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -58,7 +58,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
}
return autoPtr<mixtureViscosityModel>
(cstrIter()(name, dict, U, phi));
(
ctorPtr(name, dict, U, phi)
);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -111,9 +111,9 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
Info<< "Selecting relative velocity model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -127,7 +127,7 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
return
autoPtr<relativeVelocityModel>
(
cstrIter()
ctorPtr
(
dict.optionalSubDict(modelType + "Coeffs"),
mixture

View File

@ -11,7 +11,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \

View File

@ -343,12 +343,12 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
focalLaserPosition_
(
Function1<point>::New("focalLaserPosition", *this)
Function1<point>::New("focalLaserPosition", *this, &mesh_)
),
laserDirection_
(
Function1<vector>::New("laserDirection", *this)
Function1<vector>::New("laserDirection", *this, &mesh_)
),
focalLaserRadius_(get<scalar>("focalLaserRadius")),
@ -359,7 +359,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)),
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
powerDistribution_(),
reflectionSwitch_(false),
@ -441,11 +441,11 @@ Foam::radiation::laserDTRM::laserDTRM
focalLaserPosition_
(
Function1<point>::New("focalLaserPosition", *this)
Function1<point>::New("focalLaserPosition", *this, &mesh_)
),
laserDirection_
(
Function1<vector>::New("laserDirection", *this)
Function1<vector>::New("laserDirection", *this, &mesh_)
),
focalLaserRadius_(get<scalar>("focalLaserRadius")),
@ -456,7 +456,7 @@ Foam::radiation::laserDTRM::laserDTRM
sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)),
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
powerDistribution_(),
reflectionSwitch_(false),

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -41,9 +41,9 @@ Foam::radiation::reflectionModel::New
Info<< "Selecting reflectionModel " << modelType << endl;
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto* ctorPtr = dictionaryConstructorTable(modelType);
if (!cstrIter.found())
if (!ctorPtr)
{
FatalIOErrorInLookup
(
@ -54,7 +54,7 @@ Foam::radiation::reflectionModel::New
) << exit(FatalIOError);
}
return autoPtr<reflectionModel>(cstrIter()(dict, mesh));
return autoPtr<reflectionModel>(ctorPtr(dict, mesh));
}

Some files were not shown because too many files have changed in this diff Show More