Compare commits
225 Commits
maintenanc
...
feature-re
| Author | SHA1 | Date | |
|---|---|---|---|
| bc5a55f7e6 | |||
| d4f3581265 | |||
| c8ba81f92c | |||
| f05dc09692 | |||
| 76dcc4f28f | |||
| b90ba9d125 | |||
| 6102b76377 | |||
| 7fc943c178 | |||
| a95427c28a | |||
| ea92cb82c4 | |||
| 8e45108905 | |||
| 9c1f94d4fd | |||
| a809265432 | |||
| 38bf30167d | |||
| ba8d6bddcc | |||
| 4fc6ec1d1d | |||
| 794e23e083 | |||
| 0bd113f537 | |||
| 7f8ecd98f5 | |||
| 3416151dee | |||
| 9e56dd4098 | |||
| 5cba269072 | |||
| 83fd1c9579 | |||
| 742a2c8a49 | |||
| 50995706a6 | |||
| c9333a5ac8 | |||
| 1c354ce299 | |||
| b364a9e72c | |||
| a19f03a5cb | |||
| 851be8ea33 | |||
| fddf8a8832 | |||
| 2698cab01c | |||
| 3494d662c7 | |||
| a6f2aff449 | |||
| 8746d7e443 | |||
| 227b3976ba | |||
| 08e66a64e1 | |||
| 08588134fb | |||
| 0c89154729 | |||
| 048166c3d8 | |||
| 33ff3201ea | |||
| b6539cd02e | |||
| 1f20747b1a | |||
| 609fb366e3 | |||
| b8a4b7e80d | |||
| e2861cc200 | |||
| 3781f17eee | |||
| 3d3d287452 | |||
| f5058bca90 | |||
| 33790ca972 | |||
| 120e4a46bc | |||
| a98d5ebf32 | |||
| 435be2e5ec | |||
| 36bb99da9b | |||
| 7d5dc29e53 | |||
| 783c2f567f | |||
| 64fdbf6099 | |||
| ec62cda73a | |||
| 52be5d0428 | |||
| c2697f466d | |||
| 8eab653117 | |||
| 42a9078dad | |||
| b157614e00 | |||
| 2a2edf5fee | |||
| 3e026783ab | |||
| 85760cbc34 | |||
| fe8c630936 | |||
| 4a0646451d | |||
| 16d48ed047 | |||
| f61228ae38 | |||
| f422495bb5 | |||
| 9bed548227 | |||
| 7ad75fa18e | |||
| 5014398c45 | |||
| 6a3f918827 | |||
| 674a9a878f | |||
| 3c0fef819b | |||
| 9ad7e87000 | |||
| 40bed278ef | |||
| 770df14bf6 | |||
| a8243b8377 | |||
| e2d54dfe14 | |||
| 3a1c61fc98 | |||
| cd938d96f3 | |||
| c161d0e069 | |||
| 9923cc9bf8 | |||
| 8a3dc0527c | |||
| 20902b7f7c | |||
| 15f2487c0b | |||
| aa5ba2b494 | |||
| 8e5c569cf1 | |||
| d585774841 | |||
| 6a3f63c2bc | |||
| 9ce5aa2136 | |||
| ad8e5540a3 | |||
| 680c1dcfdd | |||
| 4ff010d094 | |||
| 0454f4a040 | |||
| a0d7933360 | |||
| 8628d4216c | |||
| fcd7423fa8 | |||
| 134aaee91a | |||
| c0b4c26dc1 | |||
| 72e67c7d1b | |||
| a4289f7dd2 | |||
| c0feb56521 | |||
| 7c46daea0d | |||
| 6ed5e23536 | |||
| da1afe816a | |||
| f3d0db18bb | |||
| 91439bb30d | |||
| 0265f2caad | |||
| fb88d4887b | |||
| 7d20854726 | |||
| f89fb3e066 | |||
| 96adf3ae80 | |||
| 610711ac47 | |||
| f0fb0d4263 | |||
| dabe506e9e | |||
| bf1ed94e53 | |||
| 5e4d678c98 | |||
| d27aa79cd7 | |||
| ac6077b471 | |||
| aeda015a78 | |||
| 0aa44f2b9b | |||
| c307c4abd2 | |||
| 4be5511f8c | |||
| 2bd37c7643 | |||
| 5a1baa478d | |||
| 800df883a6 | |||
| 07cd88abd0 | |||
| 89289b0716 | |||
| 0feb0e4d7b | |||
| 839a52ee16 | |||
| a88d0e7181 | |||
| 851cf11c0a | |||
| d5fd97d991 | |||
| 8be3f3d910 | |||
| 9678b1dc22 | |||
| 9bf030d86a | |||
| b826e23d2f | |||
| 93b0a57791 | |||
| b78dccdd51 | |||
| d8eecc5e2a | |||
| a870be6511 | |||
| 3207e315b2 | |||
| c8a52fad96 | |||
| 14b328d990 | |||
| 2e703543ff | |||
| be7d6b3afb | |||
| c6c575052f | |||
| 99291a7ac5 | |||
| 084f89ee94 | |||
| 9c46f86048 | |||
| c64c312bae | |||
| f482f74277 | |||
| f687a21761 | |||
| 6dedfe078a | |||
| d9b200af28 | |||
| d6ff22e5e7 | |||
| fa03050e03 | |||
| 53af23b9fb | |||
| 11e0db96d3 | |||
| 60aeca32a8 | |||
| 9ab8c525cf | |||
| 9b0051c40d | |||
| 270f2eecf9 | |||
| d379f0b61d | |||
| 9d26b25c46 | |||
| 2bb91e354b | |||
| 56a5a43910 | |||
| ec4265343a | |||
| b2ec5af9e0 | |||
| 13740de427 | |||
| 8f1bad1cb4 | |||
| 10dd0d34d1 | |||
| a530b505ed | |||
| 29acee5a50 | |||
| d31f351c15 | |||
| 4eeff16735 | |||
| d49566ea34 | |||
| 5b09e59b3f | |||
| e2be2289a1 | |||
| eb7d0f0ef0 | |||
| 847b61d1f9 | |||
| 621d400db2 | |||
| 3e70154ff1 | |||
| 6f20499b57 | |||
| 1f3c35841f | |||
| 3f670d88ea | |||
| 7d8dba564c | |||
| 5b21050a0b | |||
| 4b05b766d3 | |||
| 18ffb1ad07 | |||
| d3807a6ee3 | |||
| a9aa6cb0db | |||
| 4476863907 | |||
| 384b9f8100 | |||
| f98633e427 | |||
| e30cbfc6db | |||
| b62306ddc5 | |||
| be09967acf | |||
| efd3f59295 | |||
| b006f5c44e | |||
| ce5e2e7e1c | |||
| db9460f0bc | |||
| 0c15f773e0 | |||
| aca366d293 | |||
| 09aa3d8b43 | |||
| ccc751e55d | |||
| c1c1799051 | |||
| 20ca8e8aac | |||
| bda5a87213 | |||
| 2ab81c3b69 | |||
| 70c697fdcb | |||
| 64deb4e4b8 | |||
| 8cda8e5c3a | |||
| cc5aa20931 | |||
| 8a1f667067 | |||
| 00990698ad | |||
| 8884d58a52 | |||
| 6a390f6ad1 | |||
| 1898395038 | |||
| 252326df05 | |||
| f75379633c |
29
Allwmake
29
Allwmake
@ -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,24 +62,21 @@ 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 "========================================"
|
||||
echo ========================================
|
||||
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||
echo
|
||||
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
||||
then
|
||||
else
|
||||
# Use wmake -all instead of Allwmake to allow for overrides
|
||||
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
|
||||
fi
|
||||
|
||||
@ -93,7 +90,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 +100,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 ========================================
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2106
|
||||
api=2108
|
||||
patch=0
|
||||
|
||||
@ -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 ========================================
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -138,6 +138,13 @@ public:
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
//- Return a clone
|
||||
virtual refPtr<regIOobject> deepClone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~PDRDragModel();
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-latmosphericModels
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
IOMRFZoneList& MRF = MRFfluid[i];
|
||||
fv::options& fvOptions = fluidFvOptions[i];
|
||||
|
||||
fvVectorMatrix& UEqn = UEqFluid[i];
|
||||
|
||||
const dimensionedScalar initialMass
|
||||
(
|
||||
"initialMass",
|
||||
|
||||
@ -12,8 +12,10 @@
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
|
||||
turb.correct();
|
||||
if (!coupled)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
turb.correct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ EXE_INC = \
|
||||
-I${phaseSystem}/twoPhaseCompressibleTurbulenceModels/lnInclude \
|
||||
-I${phaseSystem}/multiphaseSystem/lnInclude \
|
||||
-I./fluid \
|
||||
-I./solid \
|
||||
-I../solid \
|
||||
-I../fluid \
|
||||
-I../include \
|
||||
|
||||
@ -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");
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
IOMRFZoneList& MRF = MRFfluid[i];
|
||||
fv::options& fvOptions = fluidFvOptions[i];
|
||||
|
||||
fvVectorMatrix& UEqn = UEqFluid[i];
|
||||
|
||||
const dimensionedScalar initialMass
|
||||
(
|
||||
"initialMass",
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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");
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
kinematicParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/kinematicParcelFoam
|
||||
@ -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
|
||||
22
applications/solvers/lagrangian/kinematicParcelFoam/UEqn.H
Normal file
22
applications/solvers/lagrangian/kinematicParcelFoam/UEqn.H
Normal 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);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
const word kinematicCloudName
|
||||
(
|
||||
args.getOrDefault<word>("cloud", "kinematicCloud")
|
||||
);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
|
||||
basicKinematicCloud parcels
|
||||
(
|
||||
kinematicCloudName,
|
||||
rhoInf,
|
||||
U,
|
||||
muc,
|
||||
g
|
||||
);
|
||||
|
||||
@ -0,0 +1 @@
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
@ -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"
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
58
applications/solvers/lagrangian/kinematicParcelFoam/pEqn.H
Normal file
58
applications/solvers/lagrangian/kinematicParcelFoam/pEqn.H
Normal 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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 "
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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)
|
||||
);
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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,7 +122,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
cellSetOption(sourceName, modelType, dict, mesh),
|
||||
fv::cellSetOption(sourceName, modelType, dict, mesh),
|
||||
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_)),
|
||||
L_("L", dimEnergy/dimMass, coeffs_),
|
||||
relax_(coeffs_.getOrDefault("relax", 0.9)),
|
||||
|
||||
@ -99,7 +99,7 @@ namespace fv
|
||||
|
||||
class VoFSolidificationMeltingSource
|
||||
:
|
||||
public cellSetOption
|
||||
public fv::cellSetOption
|
||||
{
|
||||
// Private data
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ License
|
||||
|
||||
bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict)
|
||||
{
|
||||
if (cellSetOption::read(dict))
|
||||
if (fv::cellSetOption::read(dict))
|
||||
{
|
||||
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_);
|
||||
coeffs_.readEntry("L", L_);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
|
||||
#include "mixtureViscosityModel.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -120,21 +120,6 @@ if (p_rgh.needReference())
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
// 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)
|
||||
);
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
@ -9,6 +10,7 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lgeometricVoF \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020 Henning Scheufler
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -269,14 +269,14 @@ correct()
|
||||
|
||||
// interface heat resistance
|
||||
mDotc_ = interfaceArea_*R_*max(TSat - T, T0)/L;
|
||||
mDote_ = interfaceArea_*R_*(T - TSat)/L;
|
||||
mDote_ = interfaceArea_*R_*max(T - TSat, T0)/L;
|
||||
|
||||
// Limiting max condensation
|
||||
forAll(mDotc_, celli)
|
||||
{
|
||||
scalar rhobyDt = mixture_.rho1().value()/mesh_.time().deltaTValue();
|
||||
scalar maxEvap = mixture_.alpha1()[celli]*rhobyDt; // positive
|
||||
scalar maxCond = -mixture_.alpha2()[celli]*rhobyDt; // negative
|
||||
mDote_[celli] = min(max(mDote_[celli], maxCond), maxEvap);
|
||||
mDotc_[celli] = min(max(mDotc_[celli], maxCond), maxEvap);
|
||||
}
|
||||
|
||||
@ -326,14 +326,6 @@ correct()
|
||||
void Foam::temperaturePhaseChangeTwoPhaseMixtures::interfaceHeatResistance::
|
||||
updateInterface()
|
||||
{
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
|
||||
const twoPhaseMixtureEThermo& thermo =
|
||||
refCast<const twoPhaseMixtureEThermo>
|
||||
(
|
||||
mesh_.lookupObject<basicThermo>(basicThermo::dictName)
|
||||
);
|
||||
|
||||
const dimensionedScalar& TSat = thermo.TSat();
|
||||
|
||||
// interface heat resistance
|
||||
// Interpolating alpha1 cell centre values to mesh points (vertices)
|
||||
@ -354,30 +346,6 @@ updateInterface()
|
||||
mag(cutCell.faceArea())/mesh_.V()[celli];
|
||||
}
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||
|
||||
forAll(pbm, patchi)
|
||||
{
|
||||
if (isA<wallPolyPatch>(pbm[patchi]))
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
forAll(pp.faceCells(),i)
|
||||
{
|
||||
const label pCelli = pp.faceCells()[i];
|
||||
|
||||
if
|
||||
(
|
||||
(TSat.value() - T[pCelli]) > 0
|
||||
&& mixture_.alpha1()[pCelli] < 0.9
|
||||
)
|
||||
{
|
||||
interfaceArea_[pCelli] =
|
||||
mag(pp.faceAreas()[i])/mesh_.V()[pCelli];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,9 +54,9 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
|
||||
|
||||
Info<< "Selecting phaseChange model " << modelType << endl;
|
||||
|
||||
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = componentsConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -70,7 +70,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
|
||||
return
|
||||
autoPtr<temperaturePhaseChangeTwoPhaseMixture>
|
||||
(
|
||||
cstrIter()(thermo, mesh)
|
||||
ctorPtr(thermo, mesh)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -126,20 +126,5 @@ if (p_rgh.needReference())
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
// 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)
|
||||
);
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
@ -147,19 +147,4 @@ if (p_rgh.needReference())
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
// 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)
|
||||
);
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
@ -8,4 +9,5 @@ LIB_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
#include "surfaceMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -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.
|
||||
@ -28,6 +28,7 @@ License
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "surfaceMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -55,9 +56,9 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
|
||||
Info<< "Selecting phaseChange model " << modelType << endl;
|
||||
|
||||
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = componentsConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -68,7 +69,7 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(ctorPtr(U, phi));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -26,7 +27,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "multiphaseMixture.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "Time.H"
|
||||
#include "subCycle.H"
|
||||
#include "MULES.H"
|
||||
@ -36,6 +36,7 @@ License
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcFlux.H"
|
||||
#include "unitConversion.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -416,102 +417,123 @@ void Foam::multiphaseMixture::correctContactAngle
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const
|
||||
{
|
||||
const volScalarField::Boundary& gbf
|
||||
= alpha1.boundaryField();
|
||||
const volScalarField::Boundary& gb1f = alpha1.boundaryField();
|
||||
const volScalarField::Boundary& gb2f = alpha2.boundaryField();
|
||||
|
||||
const fvBoundaryMesh& boundary = mesh_.boundary();
|
||||
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gb1f[patchi]))
|
||||
{
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gb1f[patchi]);
|
||||
|
||||
vectorField& nHatPatch = nHatb[patchi];
|
||||
correctBoundaryContactAngle(acap, patchi, alpha1, alpha2, nHatb);
|
||||
}
|
||||
else if (isA<alphaContactAngleFvPatchScalarField>(gb2f[patchi]))
|
||||
{
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gb2f[patchi]);
|
||||
|
||||
vectorField AfHatPatch
|
||||
(
|
||||
mesh_.Sf().boundaryField()[patchi]
|
||||
/mesh_.magSf().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
const auto tp =
|
||||
acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
||||
|
||||
if (!tp.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||
<< "\n in table of theta properties for patch "
|
||||
<< acap.patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const bool matched = (tp.key().first() == alpha1.name());
|
||||
|
||||
const scalar theta0 = degToRad(tp().theta0(matched));
|
||||
scalarField theta(boundary[patchi].size(), theta0);
|
||||
|
||||
const scalar uTheta = tp().uTheta();
|
||||
|
||||
// Calculate the dynamic contact angle if required
|
||||
if (uTheta > SMALL)
|
||||
{
|
||||
const scalar thetaA = degToRad(tp().thetaA(matched));
|
||||
const scalar thetaR = degToRad(tp().thetaR(matched));
|
||||
|
||||
// Calculated the component of the velocity parallel to the wall
|
||||
vectorField Uwall
|
||||
(
|
||||
U_.boundaryField()[patchi].patchInternalField()
|
||||
- U_.boundaryField()[patchi]
|
||||
);
|
||||
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
|
||||
|
||||
// Find the direction of the interface parallel to the wall
|
||||
vectorField nWall
|
||||
(
|
||||
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
|
||||
);
|
||||
|
||||
// Normalise nWall
|
||||
nWall /= (mag(nWall) + SMALL);
|
||||
|
||||
// Calculate Uwall resolved normal to the interface parallel to
|
||||
// the interface
|
||||
scalarField uwall(nWall & Uwall);
|
||||
|
||||
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
|
||||
}
|
||||
|
||||
|
||||
// Reset nHatPatch to correspond to the contact angle
|
||||
|
||||
scalarField a12(nHatPatch & AfHatPatch);
|
||||
|
||||
scalarField b1(cos(theta));
|
||||
|
||||
scalarField b2(nHatPatch.size());
|
||||
|
||||
forAll(b2, facei)
|
||||
{
|
||||
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
|
||||
}
|
||||
|
||||
scalarField det(1.0 - a12*a12);
|
||||
|
||||
scalarField a((b1 - a12*b2)/det);
|
||||
scalarField b((b2 - a12*b1)/det);
|
||||
|
||||
nHatPatch = a*AfHatPatch + b*nHatPatch;
|
||||
|
||||
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
|
||||
correctBoundaryContactAngle(acap, patchi, alpha2, alpha1, nHatb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::correctBoundaryContactAngle
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& acap,
|
||||
label patchi,
|
||||
const phase& alpha1,
|
||||
const phase& alpha2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const
|
||||
{
|
||||
const fvBoundaryMesh& boundary = mesh_.boundary();
|
||||
|
||||
vectorField& nHatPatch = nHatb[patchi];
|
||||
|
||||
vectorField AfHatPatch
|
||||
(
|
||||
mesh_.Sf().boundaryField()[patchi]
|
||||
/mesh_.magSf().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
const auto tp = acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
||||
|
||||
if (!tp.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||
<< "\n in table of theta properties for patch "
|
||||
<< acap.patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const bool matched = (tp.key().first() == alpha1.name());
|
||||
|
||||
const scalar theta0 = degToRad(tp().theta0(matched));
|
||||
scalarField theta(boundary[patchi].size(), theta0);
|
||||
|
||||
const scalar uTheta = tp().uTheta();
|
||||
|
||||
// Calculate the dynamic contact angle if required
|
||||
if (uTheta > SMALL)
|
||||
{
|
||||
const scalar thetaA = degToRad(tp().thetaA(matched));
|
||||
const scalar thetaR = degToRad(tp().thetaR(matched));
|
||||
|
||||
// Calculated the component of the velocity parallel to the wall
|
||||
vectorField Uwall
|
||||
(
|
||||
U_.boundaryField()[patchi].patchInternalField()
|
||||
- U_.boundaryField()[patchi]
|
||||
);
|
||||
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
|
||||
|
||||
// Find the direction of the interface parallel to the wall
|
||||
vectorField nWall
|
||||
(
|
||||
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
|
||||
);
|
||||
|
||||
// Normalise nWall
|
||||
nWall /= (mag(nWall) + SMALL);
|
||||
|
||||
// Calculate Uwall resolved normal to the interface parallel to
|
||||
// the interface
|
||||
scalarField uwall(nWall & Uwall);
|
||||
|
||||
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
|
||||
}
|
||||
|
||||
|
||||
// Reset nHatPatch to correspond to the contact angle
|
||||
|
||||
scalarField a12(nHatPatch & AfHatPatch);
|
||||
|
||||
scalarField b1(cos(theta));
|
||||
|
||||
scalarField b2(nHatPatch.size());
|
||||
|
||||
forAll(b2, facei)
|
||||
{
|
||||
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
|
||||
}
|
||||
|
||||
scalarField det(1.0 - a12*a12);
|
||||
|
||||
scalarField a((b1 - a12*b2)/det);
|
||||
scalarField b((b2 - a12*b1)/det);
|
||||
|
||||
nHatPatch = a*AfHatPatch + b*nHatPatch;
|
||||
|
||||
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
|
||||
(
|
||||
const phase& alpha1,
|
||||
|
||||
@ -57,6 +57,9 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Class forward declarations
|
||||
class alphaContactAngleFvPatchScalarField;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -170,6 +173,15 @@ private:
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const;
|
||||
|
||||
void correctBoundaryContactAngle
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& acap,
|
||||
label patchi,
|
||||
const phase& alpha1,
|
||||
const phase& alpha2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const;
|
||||
|
||||
tmp<volScalarField> K(const phase& alpha1, const phase& alpha2) const;
|
||||
|
||||
|
||||
|
||||
3
applications/test/DynamicList2/Make/files
Normal file
3
applications/test/DynamicList2/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-DynamicList2.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-DynamicList2
|
||||
2
applications/test/DynamicList2/Make/options
Normal file
2
applications/test/DynamicList2/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
155
applications/test/DynamicList2/Test-DynamicList2.C
Normal file
155
applications/test/DynamicList2/Test-DynamicList2.C
Normal 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/>.
|
||||
|
||||
Description
|
||||
Test allocation patterns when reading into an existing list.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "DynamicList.H"
|
||||
#include "DynamicField.H"
|
||||
#include "IOstreams.H"
|
||||
#include "ITstream.H"
|
||||
#include "OTstream.H"
|
||||
#include "StringStream.H"
|
||||
#include "FlatOutput.H"
|
||||
#include "ListOps.H"
|
||||
#include "labelRange.H"
|
||||
#include "labelIndList.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
template<class T, int SizeMin>
|
||||
void printInfo
|
||||
(
|
||||
const word& tag,
|
||||
const DynamicList<T, SizeMin>& list,
|
||||
const bool showSize = true
|
||||
)
|
||||
{
|
||||
Info<< '<' << tag;
|
||||
if (showSize)
|
||||
{
|
||||
Info<< " size=\"" << list.size()
|
||||
<< "\" capacity=\"" << list.capacity() << "\"";
|
||||
if (list.cdata())
|
||||
{
|
||||
Info<< " ptr=\"" << name(list.cdata()) << "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " ptr=\"nullptr\"";
|
||||
}
|
||||
}
|
||||
Info<< '>' << nl << flatOutput(list) << nl
|
||||
<< "</" << tag << ">\n" << endl;
|
||||
}
|
||||
|
||||
|
||||
template<class T, int SizeMin>
|
||||
void printInfo
|
||||
(
|
||||
const word& tag,
|
||||
const DynamicField<T, SizeMin>& list,
|
||||
const bool showSize = true
|
||||
)
|
||||
{
|
||||
Info<< '<' << tag;
|
||||
if (showSize)
|
||||
{
|
||||
Info<< " size=\"" << list.size()
|
||||
<< "\" capacity=\"" << list.capacity() << "\"";
|
||||
if (list.cdata())
|
||||
{
|
||||
Info<< " ptr=\"" << name(list.cdata()) << "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " ptr=\"nullptr\"";
|
||||
}
|
||||
}
|
||||
Info<< '>' << nl << flatOutput(list) << nl
|
||||
<< "</" << tag << ">\n" << endl;
|
||||
}
|
||||
|
||||
|
||||
template<class T, int SizeMin>
|
||||
void readList
|
||||
(
|
||||
DynamicList<T, SizeMin>& output,
|
||||
const UList<T>& input
|
||||
)
|
||||
{
|
||||
OTstream os;
|
||||
os << input;
|
||||
ITstream is("input", os.tokens());
|
||||
|
||||
is >> output;
|
||||
}
|
||||
|
||||
template<class T, int SizeMin>
|
||||
void readList
|
||||
(
|
||||
DynamicField<T, SizeMin>& output,
|
||||
const UList<T>& input
|
||||
)
|
||||
{
|
||||
OTstream os;
|
||||
os << input;
|
||||
ITstream is("input", os.tokens());
|
||||
|
||||
is >> output;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//
|
||||
{
|
||||
DynamicList<label, 64> list1;
|
||||
|
||||
list1.resize(4);
|
||||
ListOps::identity(list1);
|
||||
|
||||
list1.resize(3);
|
||||
printInfo("", list1);
|
||||
|
||||
// list1.clear();
|
||||
// printInfo("", list1);
|
||||
|
||||
list1.setCapacity(3);
|
||||
printInfo("", list1);
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -280,16 +280,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
List<label> list3{0, 1, 2, 3};
|
||||
FixedList<label, 4> list4(list3.begin(), list3.end());
|
||||
FixedList<label, 4> list4(list3);
|
||||
Info<< "list3: " << list3 << nl
|
||||
<< "list4: " << list4 << nl;
|
||||
|
||||
list4 = {1, 2, 3, 5};
|
||||
list4 = {1, 20, 3, 40};
|
||||
Info<< "list4: " << list4 << nl;
|
||||
|
||||
FixedList<label, 5> list5{0, 1, 2, 3, 4};
|
||||
Info<< "list5: " << list5 << nl;
|
||||
|
||||
{
|
||||
const FixedList<label, 2> indices({3, 1});
|
||||
FixedList<label, 2> list4b(list4, indices);
|
||||
|
||||
Info<< "subset " << list4 << " with " << indices << " -> "
|
||||
<< list4b << nl;
|
||||
}
|
||||
|
||||
List<FixedList<label, 2>> list6{{0, 1}, {2, 3}};
|
||||
Info<< "list6: " << list6 << nl;
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -28,11 +28,12 @@ License
|
||||
|
||||
#include "HashTable.H"
|
||||
#include "List.H"
|
||||
#include "SortableList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "FlatOutput.H"
|
||||
#include "IOstreams.H"
|
||||
#include "StringStream.H"
|
||||
#include "ListOps.H"
|
||||
#include "flipOp.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -209,12 +210,16 @@ int main()
|
||||
<< "/" << table1.keys().size()
|
||||
<< nl;
|
||||
|
||||
SortableList<word> sortKeys
|
||||
// DynamicList<word> sortKeys
|
||||
List<word> sortKeys
|
||||
(
|
||||
table1.keys().begin(),
|
||||
table1.keys().end()
|
||||
ListOps::create<word>
|
||||
(
|
||||
table1.keys().begin(),
|
||||
table1.keys().end(),
|
||||
noOp{}
|
||||
)
|
||||
);
|
||||
sort(sortKeys);
|
||||
Info<<"sortKeys: " << flatOutput(sortKeys) << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ Description
|
||||
#include "IOstreams.H"
|
||||
#include "argList.H"
|
||||
#include "ITstream.H"
|
||||
#include "ListOps.H"
|
||||
#include "flipOp.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -109,7 +111,7 @@ void doTest
|
||||
<< nl
|
||||
<< "====" << nl << endl;
|
||||
|
||||
ITstream its(name, input);
|
||||
ITstream its(input);
|
||||
Info<< "got " << its.size() << " tokens - index at "
|
||||
<< its.tokenIndex() << endl;
|
||||
|
||||
@ -164,7 +166,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
string stringInput("( string ; input \"string\" to tokenize )");
|
||||
|
||||
List<char> listInput(stringInput.cbegin(), stringInput.cend());
|
||||
List<char> listInput
|
||||
(
|
||||
ListOps::create<char>
|
||||
(
|
||||
stringInput.cbegin(),
|
||||
stringInput.cend(),
|
||||
Foam::noOp{}
|
||||
)
|
||||
);
|
||||
|
||||
doTest("empty", "", true, true);
|
||||
|
||||
|
||||
@ -48,7 +48,9 @@ See also
|
||||
#include "scalarList.H"
|
||||
#include "HashOps.H"
|
||||
#include "ListOps.H"
|
||||
#include "IndirectList.H"
|
||||
#include "SubList.H"
|
||||
#include "SliceList.H"
|
||||
#include "ListPolicy.H"
|
||||
|
||||
#include <list>
|
||||
@ -344,7 +346,7 @@ int main(int argc, char *argv[])
|
||||
labelList longLabelList = identity(25);
|
||||
reverse(longLabelList);
|
||||
|
||||
FixedList<label, 6> fixedLabelList{0,1,2,3,4,5};
|
||||
FixedList<label, 6> fixedLabelList({0,1,2,3,4,5});
|
||||
const labelList constLabelList = identity(25);
|
||||
|
||||
Info<< "full-list: " << flatOutput(longLabelList) << nl;
|
||||
@ -353,6 +355,36 @@ int main(int argc, char *argv[])
|
||||
Info<<"sub range:" << range1 << "=";
|
||||
Info<< SubList<label>(longLabelList, range1) << nl;
|
||||
|
||||
{
|
||||
// A valid range
|
||||
const labelRange subset(4, 5);
|
||||
|
||||
// Assign some values
|
||||
longLabelList.slice(subset) = identity(subset.size());
|
||||
|
||||
Info<<"assigned identity in range:" << subset
|
||||
<< "=> " << flatOutput(longLabelList) << nl;
|
||||
|
||||
labelList someList(identity(24));
|
||||
|
||||
longLabelList.slice(subset) =
|
||||
SliceList<label>(someList, sliceRange(8, subset.size(), 2));
|
||||
|
||||
Info<<"assigned sliced/stride in range:" << subset
|
||||
<< "=> " << flatOutput(longLabelList) << nl;
|
||||
|
||||
// Does not work - need a reference, not a temporary
|
||||
// Foam::reverse(longLabelList[subset]);
|
||||
|
||||
{
|
||||
auto sub(longLabelList.slice(subset));
|
||||
Foam::reverse(sub);
|
||||
}
|
||||
|
||||
Info<<"reversed range:" << subset
|
||||
<< "=> " << flatOutput(longLabelList) << nl;
|
||||
}
|
||||
|
||||
labelRange range2(7, 8);
|
||||
Info<<"sub range:" << range2 << "=";
|
||||
Info<< SubList<label>(longLabelList, range2) << nl;
|
||||
@ -368,29 +400,29 @@ int main(int argc, char *argv[])
|
||||
// > constLabelList[labelRange(23,5)] = 5;
|
||||
|
||||
// Check correct overlaps
|
||||
longLabelList[labelRange(-10, 12)] = 200;
|
||||
longLabelList[{18,3}] = 100;
|
||||
longLabelList[{23,3}] = 400;
|
||||
longLabelList.slice(labelRange(-10, 12)) = 200;
|
||||
longLabelList.slice({18,3}) = 100;
|
||||
longLabelList.slice({23,3}) = 400;
|
||||
// and complete misses
|
||||
longLabelList[{500,50}] = 100;
|
||||
longLabelList.slice({500,50}) = 100;
|
||||
|
||||
// -ve size suppressed by internal 'validateRange' = no-op
|
||||
longLabelList[{5,-5}] = 42;
|
||||
longLabelList[{21,100}] = 42;
|
||||
longLabelList.slice({5,-5}) = 42;
|
||||
longLabelList.slice({21,100}) = 42;
|
||||
|
||||
//Good: does not compile
|
||||
//> longLabelList[labelRange(20,50)] = constLabelList;
|
||||
longLabelList.slice(labelRange(20,50)) = constLabelList;
|
||||
|
||||
//Good: does not compile
|
||||
// longLabelList[labelRange(20,50)] = fixedLabelList;
|
||||
|
||||
Info<< "updated: " << constLabelList[labelRange(23,5)] << nl;
|
||||
Info<< "updated: " << constLabelList.slice(labelRange(23,5)) << nl;
|
||||
Info<< "updated: " << flatOutput(longLabelList) << nl;
|
||||
|
||||
//Nope: sort(longLabelList[labelRange(18,5)]);
|
||||
//Nope: sort(longLabelList.slice(labelRange(18,5)));
|
||||
{
|
||||
// Instead
|
||||
UList<label> sub = longLabelList[labelRange(8)];
|
||||
auto sub = longLabelList.slice(labelRange(8));
|
||||
sort(sub);
|
||||
}
|
||||
Info<< "sub-sorted: " << flatOutput(longLabelList) << nl;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Fatal with FULLDEBUG
|
||||
{
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
const label nx = mesh.sizes().x();
|
||||
const label ny = mesh.sizes().y();
|
||||
@ -230,7 +230,7 @@ int main(int argc, char *argv[])
|
||||
<< err.message().c_str() << nl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -171,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "\ntest operator[] non-const with out-of-range index\n";
|
||||
|
||||
// Expect failure
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -190,7 +191,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Failed (expected) " << err << nl << endl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
report(list1);
|
||||
}
|
||||
|
||||
@ -198,7 +199,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "\ntest operator[] with out-of-range index\n";
|
||||
|
||||
// Expect failure
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -212,7 +213,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Failed (expected) " << err << nl << endl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
report(list1);
|
||||
}
|
||||
|
||||
@ -268,7 +269,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Expect failure
|
||||
{
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
Info<< "\ntest operator[] assignment with auto-vivify\n";
|
||||
|
||||
@ -286,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
list1.set(36, list1.max_value);
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
report(list1);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ EXE_INC = \
|
||||
-DFULLDEBUG -g -O0 \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
|
||||
3
applications/test/PrecisionAdaptor/Make/files
Normal file
3
applications/test/PrecisionAdaptor/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-PrecisionAdaptor.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-PrecisionAdaptor
|
||||
2
applications/test/PrecisionAdaptor/Make/options
Normal file
2
applications/test/PrecisionAdaptor/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
111
applications/test/PrecisionAdaptor/Test-PrecisionAdaptor.C
Normal file
111
applications/test/PrecisionAdaptor/Test-PrecisionAdaptor.C
Normal file
@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
Test-PrecisionAdaptor
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "primitiveFields.H"
|
||||
#include "PrecisionAdaptor.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Field<double> content1(8);
|
||||
Field<double> content2(8);
|
||||
|
||||
forAll(content1, i)
|
||||
{
|
||||
content1[i] = 10 * i;
|
||||
content2[i] = 10 * i;
|
||||
}
|
||||
|
||||
Foam::reverse(content2);
|
||||
|
||||
ConstPrecisionAdaptor<float, double, Field> cadaptor1;
|
||||
|
||||
cadaptor1.set(content1);
|
||||
cadaptor1.commit(); // This is a no-op
|
||||
Info<< "wrapped: " << cadaptor1() << nl;
|
||||
|
||||
cadaptor1.set(content2);
|
||||
Info<< "wrapped: " << cadaptor1() << nl;
|
||||
|
||||
Info<< nl;
|
||||
|
||||
PrecisionAdaptor<float, double, Field> adaptor2;
|
||||
|
||||
adaptor2.set(content1);
|
||||
adaptor2.ref() *= 2;
|
||||
adaptor2.commit(); // Propagate changes back to input now
|
||||
|
||||
Info<< "modified wrapped: " << adaptor2() << nl;
|
||||
|
||||
adaptor2.set(content2);
|
||||
adaptor2.ref() *= 2;
|
||||
adaptor2.commit(); // Propagate changes back to input now
|
||||
|
||||
Info<< "modified wrapped: " << adaptor2() << nl;
|
||||
Info<< "source: " << content1 << nl;
|
||||
Info<< "source: " << content2 << nl;
|
||||
|
||||
|
||||
content2 *= 2;
|
||||
Info<< nl
|
||||
<< "set with " << content2 << nl;
|
||||
Info<< "wrapped was " << adaptor2() << nl;
|
||||
adaptor2.set(content2);
|
||||
Info<< "wrapped now " << adaptor2() << nl;
|
||||
Info<< "source: " << content2 << nl;
|
||||
|
||||
// Can even do this
|
||||
Foam::reverse(adaptor2.ref());
|
||||
|
||||
adaptor2.ref() *= 2;
|
||||
adaptor2.set(content1); // implicit commit
|
||||
Info<< "updated: " << content2 << nl;
|
||||
|
||||
Info<< nl
|
||||
<< "input: " << content1 << nl;
|
||||
|
||||
adaptor2.ref() *= 2;
|
||||
adaptor2.clear(); // discard
|
||||
adaptor2.commit();
|
||||
|
||||
Info<< "unchanged: " << content1 << nl;
|
||||
|
||||
Info<< nl << "Done" << nl << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user