Compare commits
297 Commits
feature-ov
...
feature-ld
| Author | SHA1 | Date | |
|---|---|---|---|
| 82c405882d | |||
| c46216e645 | |||
| 7da2a5e096 | |||
| 33b2e0df3d | |||
| 8d4ad0438d | |||
| a6cbfcb9ba | |||
| 510ffb3322 | |||
| 39f6618d3a | |||
| 6be31e3feb | |||
| af0b20779e | |||
| cad325f41f | |||
| de90b2b28e | |||
| 8ac0548c6a | |||
| c8db0d135f | |||
| b053e2214c | |||
| 0c20256be5 | |||
| ae555ec744 | |||
| ee955b19e5 | |||
| 5b61013cf5 | |||
| 1fca0d8d23 | |||
| 60f3d416a6 | |||
| 402bc0fef0 | |||
| 437ea6917a | |||
| ea9d424e24 | |||
| 6580f1bbef | |||
| 142fc55f44 | |||
| f67406ddb2 | |||
| e479f842b3 | |||
| b69ceb54a7 | |||
| 9e8fd66ed2 | |||
| eabafe5f9e | |||
| 9024441566 | |||
| c3c23c3cb2 | |||
| 638d1fe8f6 | |||
| fde3904796 | |||
| 698ff5eedc | |||
| efb187e3f7 | |||
| 8c98906780 | |||
| d7f7267165 | |||
| f19883c0c6 | |||
| aaf4f40bf7 | |||
| f6dfa76f6d | |||
| 90d62c33e4 | |||
| 3ef0d19ef4 | |||
| 0343d3d7e9 | |||
| ada3d1c77e | |||
| 86da88cdfd | |||
| 391c1eaa40 | |||
| 37a6fc8db3 | |||
| 96821f70cd | |||
| cac0bf856b | |||
| adf6869bba | |||
| 563456087c | |||
| 41b30af01a | |||
| f6ccd77d8c | |||
| 65bc8d1140 | |||
| b25e1486de | |||
| 810d0c72ee | |||
| 34b4770949 | |||
| 85b405206d | |||
| 0f155daf86 | |||
| 98c25d163a | |||
| e5267bf81d | |||
| 79fafda22c | |||
| f5f93e81d8 | |||
| 29f7fcc515 | |||
| 9a5125111e | |||
| 8624d65c5a | |||
| 27e57c29f7 | |||
| e09298092d | |||
| 49e26dd7d2 | |||
| 31a7c2a9cd | |||
| c7f30a0989 | |||
| bdf77bbdd1 | |||
| 939c335504 | |||
| e9054ec636 | |||
| ed5dee71a4 | |||
| e6f4ae927a | |||
| 8ed6a61106 | |||
| 78cc5f8676 | |||
| f7c7fa94a3 | |||
| b96cef1339 | |||
| 9cf26ac7c5 | |||
| 9833e614da | |||
| 6aa608cf33 | |||
| 53e9c8eb5a | |||
| 8fc4501c46 | |||
| 29c70e9bbb | |||
| 6abbcb3eac | |||
| 2880a54373 | |||
| c0adccf826 | |||
| 643763d258 | |||
| fc6239d96e | |||
| e6697edb52 | |||
| adbcd3a19f | |||
| adcf41bd13 | |||
| 30a2fa4b27 | |||
| 89ddc271c7 | |||
| ba45fb2cba | |||
| f6ee1811e7 | |||
| 098aec4962 | |||
| 889bc171d9 | |||
| c233961d45 | |||
| 9194cd5203 | |||
| 925a2e724b | |||
| f29eb55cee | |||
| b9b011f5ea | |||
| bc2b469f9d | |||
| 2c2310dc17 | |||
| 70b55be684 | |||
| c1a04abd96 | |||
| aeef96251f | |||
| b19e767b8f | |||
| f078643f8c | |||
| f459b11e24 | |||
| bcf8a48c68 | |||
| 1804d3fed5 | |||
| 55af2fc2c6 | |||
| ccb0fd9cf0 | |||
| 6712548137 | |||
| 27f4cee78d | |||
| 19f7825a04 | |||
| aaeddba466 | |||
| fd9670d4a3 | |||
| fbd7b78999 | |||
| 141403ed98 | |||
| d710bb6595 | |||
| bb7d8d0f4d | |||
| 39d244ad91 | |||
| 1af0380edc | |||
| 3d889b6dbf | |||
| bb771a3caf | |||
| 92d52243af | |||
| 96735dce20 | |||
| 4e59ad9d8d | |||
| 28800dcbbc | |||
| effd69a005 | |||
| 9c9d6c64b5 | |||
| adb01bddf4 | |||
| e62a260bdd | |||
| 8e887d3395 | |||
| 168c13c514 | |||
| ba93392f69 | |||
| 53e8f2a807 | |||
| ba95b89e5f | |||
| fd82f3e47a | |||
| 8638d82325 | |||
| 79e110aeb0 | |||
| a78e79908b | |||
| e8aa3aad25 | |||
| 5a121119e6 | |||
| c45c649d15 | |||
| 9371c517b9 | |||
| 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 | |||
| 4e6e7d59da | |||
| 9645e1adc2 | |||
| 7f2cbd6cd4 | |||
| 40ff2acdd6 | |||
| 90ad6ce9cf | |||
| 028ca26617 | |||
| 014dbf4004 | |||
| 3f172ccae1 |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v1806|v1812|v1906 etc
|
||||
OpenFOAM version : v2112|v2106|v2012|v2006|v1912|v1906 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
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=2107
|
||||
api=2109
|
||||
patch=0
|
||||
|
||||
14
README.md
14
README.md
@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v2106 version:
|
||||
For example, for the OpenFOAM-v2112 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v2106/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2112/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v2106
|
||||
\-- ThirdParty-v2106
|
||||
|-- OpenFOAM-v2112
|
||||
\-- ThirdParty-v2112
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
|
||||
operating system or cluster installation provides it)
|
||||
|
||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||
directory name, e.g. openfoam-sandbox2106, etc..
|
||||
directory name, e.g. openfoam-sandbox2112, etc..
|
||||
|
||||
* When we would like any additional 3rd party software to be located
|
||||
inside of the OpenFOAM directory to ensure that the installation is
|
||||
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v2106-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2112-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `2106` and the original `ThirdParty-v2106/` would be found.
|
||||
be `2112` and the original `ThirdParty-v2112/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
|
||||
@ -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 ========================================
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
);
|
||||
}
|
||||
|
||||
// Update tho boundary values of the reciprocal time-step
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
|
||||
@ -9,7 +9,7 @@ forAll(fluidRegions, i)
|
||||
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
|
||||
const auto& bpsi = thermo.T().boundaryField();
|
||||
|
||||
forAll (bpsi, patchI)
|
||||
forAll(bpsi, patchI)
|
||||
{
|
||||
if (bpsi[patchI].useImplicit())
|
||||
{
|
||||
@ -23,7 +23,7 @@ forAll(solidRegions, i)
|
||||
solidThermo& thermo = thermos[i];
|
||||
const auto& bpsi = thermo.T().boundaryField();
|
||||
|
||||
forAll (bpsi, patchI)
|
||||
forAll(bpsi, patchI)
|
||||
{
|
||||
if (bpsi[patchI].useImplicit())
|
||||
{
|
||||
@ -37,7 +37,25 @@ forAll(fluidRegions, i)
|
||||
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
|
||||
if (coupled)
|
||||
{
|
||||
Info << "Create fvMatrixAssembly." << endl;
|
||||
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>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Reading field p\n" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
|
||||
@ -81,6 +81,8 @@ Note
|
||||
#include "pimpleControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -107,6 +109,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -114,8 +122,16 @@ int main(int argc, char *argv[])
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
++runTime;
|
||||
|
||||
|
||||
69
applications/solvers/incompressible/pimpleFoam/setRDeltaT.H
Normal file
69
applications/solvers/incompressible/pimpleFoam/setRDeltaT.H
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
volScalarField& rDeltaT = trDeltaT.ref();
|
||||
|
||||
const dictionary& pimpleDict = pimple.dict();
|
||||
|
||||
scalar maxCo
|
||||
(
|
||||
pimpleDict.getOrDefault<scalar>("maxCo", 0.8)
|
||||
);
|
||||
|
||||
scalar rDeltaTSmoothingCoeff
|
||||
(
|
||||
pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
|
||||
);
|
||||
|
||||
scalar rDeltaTDampingCoeff
|
||||
(
|
||||
pimpleDict.getOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
|
||||
);
|
||||
|
||||
scalar maxDeltaT
|
||||
(
|
||||
pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
|
||||
);
|
||||
|
||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||
|
||||
// Set the reciprocal time-step from the local Courant number
|
||||
rDeltaT.ref() = max
|
||||
(
|
||||
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
||||
fvc::surfaceSum(mag(phi))()()
|
||||
/((2*maxCo)*mesh.V())
|
||||
);
|
||||
|
||||
// Update the boundary values of the reciprocal time-step
|
||||
rDeltaT.correctBoundaryConditions();
|
||||
|
||||
Info<< "Flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
|
||||
if (rDeltaTSmoothingCoeff < 1.0)
|
||||
{
|
||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||
}
|
||||
|
||||
Info<< "Smoothed flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
|
||||
// Limit rate of change of time scale
|
||||
// - reduce as much as required
|
||||
// - only increase at a fraction of old time scale
|
||||
if
|
||||
(
|
||||
rDeltaTDampingCoeff < 1.0
|
||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
||||
)
|
||||
{
|
||||
rDeltaT =
|
||||
rDeltaT0
|
||||
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
|
||||
|
||||
Info<< "Damped flow time scale min/max = "
|
||||
<< gMin(1/rDeltaT.primitiveField())
|
||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
|
||||
)
|
||||
:
|
||||
fv::cellSetOption(sourceName, modelType, dict, mesh),
|
||||
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_)),
|
||||
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_, &mesh)),
|
||||
L_("L", dimEnergy/dimMass, coeffs_),
|
||||
relax_(coeffs_.getOrDefault("relax", 0.9)),
|
||||
Cu_(coeffs_.getOrDefault<scalar>("Cu", 100000)),
|
||||
|
||||
@ -33,7 +33,7 @@ bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict)
|
||||
{
|
||||
if (fv::cellSetOption::read(dict))
|
||||
{
|
||||
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_);
|
||||
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_, &mesh_);
|
||||
coeffs_.readEntry("L", L_);
|
||||
coeffs_.readIfPresent("relax", relax_);
|
||||
coeffs_.readIfPresent("Cu", Cu_);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -11,7 +11,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
|
||||
@ -343,12 +343,12 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
|
||||
focalLaserPosition_
|
||||
(
|
||||
Function1<point>::New("focalLaserPosition", *this)
|
||||
Function1<point>::New("focalLaserPosition", *this, &mesh_)
|
||||
),
|
||||
|
||||
laserDirection_
|
||||
(
|
||||
Function1<vector>::New("laserDirection", *this)
|
||||
Function1<vector>::New("laserDirection", *this, &mesh_)
|
||||
),
|
||||
|
||||
focalLaserRadius_(get<scalar>("focalLaserRadius")),
|
||||
@ -359,7 +359,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
|
||||
sigma_(0),
|
||||
I0_(0),
|
||||
laserPower_(Function1<scalar>::New("laserPower", *this)),
|
||||
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
|
||||
powerDistribution_(),
|
||||
|
||||
reflectionSwitch_(false),
|
||||
@ -441,11 +441,11 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
|
||||
focalLaserPosition_
|
||||
(
|
||||
Function1<point>::New("focalLaserPosition", *this)
|
||||
Function1<point>::New("focalLaserPosition", *this, &mesh_)
|
||||
),
|
||||
laserDirection_
|
||||
(
|
||||
Function1<vector>::New("laserDirection", *this)
|
||||
Function1<vector>::New("laserDirection", *this, &mesh_)
|
||||
),
|
||||
|
||||
focalLaserRadius_(get<scalar>("focalLaserRadius")),
|
||||
@ -456,7 +456,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
|
||||
sigma_(0),
|
||||
I0_(0),
|
||||
laserPower_(Function1<scalar>::New("laserPower", *this)),
|
||||
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
|
||||
powerDistribution_(),
|
||||
|
||||
reflectionSwitch_(false),
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
@ -56,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
|
||||
(
|
||||
@ -69,7 +69,7 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(ctorPtr(U, phi));
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / O peration | Version: v2112 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -138,4 +138,53 @@ cosine6
|
||||
}
|
||||
|
||||
|
||||
expr1
|
||||
{
|
||||
type expression;
|
||||
|
||||
functions<scalar>
|
||||
{
|
||||
func1 constant 21;
|
||||
func2 constant 15;
|
||||
sin constant -5;
|
||||
}
|
||||
|
||||
functions<vector>
|
||||
{
|
||||
vfunc3 constant (1 2 3);
|
||||
vfunc4 constant (3 2 1);
|
||||
}
|
||||
|
||||
expression
|
||||
#{
|
||||
100 * fn:vfunc3() & fn:vfunc4() * (vector::z) .z()
|
||||
* (fn:sin(arg()) + fn:func1(fn:func2()))
|
||||
#};
|
||||
}
|
||||
|
||||
|
||||
expr2
|
||||
{
|
||||
type expression;
|
||||
|
||||
functions<scalar>
|
||||
{
|
||||
func1 constant 21;
|
||||
func2 constant 15;
|
||||
sin constant -5;
|
||||
}
|
||||
|
||||
functions<vector>
|
||||
{
|
||||
vfunc3 constant (1 2 3);
|
||||
vfunc4 constant (3 2 1);
|
||||
}
|
||||
|
||||
expression
|
||||
#{
|
||||
(fn:vfunc3() & vector::z) * arg()
|
||||
#};
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -271,7 +271,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// This should fail (in FULLDEBUG)
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
Info<<"Random position(10,5): "
|
||||
@ -282,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Caught FatalError " << err << nl << endl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
|
||||
Info<< "\nDone" << nl << endl;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,7 +40,7 @@ void predicateTests_label(const word& optName, const argList& args)
|
||||
{
|
||||
Info<< "predicate tests for " << optName << nl;
|
||||
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
label val;
|
||||
@ -52,7 +52,7 @@ void predicateTests_label(const word& optName, const argList& args)
|
||||
<< err << nl << endl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ void predicateTests_scalar(const word& optName, const argList& args)
|
||||
{
|
||||
Info<< "predicate tests for " << optName << nl;
|
||||
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
scalar val;
|
||||
@ -72,7 +72,7 @@ void predicateTests_scalar(const word& optName, const argList& args)
|
||||
<< err << nl << endl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
}
|
||||
|
||||
|
||||
@ -121,6 +121,9 @@ int main(int argc, char *argv[])
|
||||
argList::addArgument("label");
|
||||
argList::noMandatoryArgs();
|
||||
|
||||
argList::addDryRunOption("Just for testing");
|
||||
argList::addVerboseOption("Increase verbosity");
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
Pout<< "command-line ("
|
||||
@ -133,6 +136,10 @@ int main(int argc, char *argv[])
|
||||
<< "globalPath: " << args.globalPath() << nl
|
||||
<< nl;
|
||||
|
||||
Pout<< "dry-run: " << args.dryRun()
|
||||
<< " verbose: " << args.verbose() << nl;
|
||||
|
||||
|
||||
if (args.found("relative"))
|
||||
{
|
||||
Pout<< "input path: " << args["relative"] << nl
|
||||
|
||||
@ -57,9 +57,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "addAllRegionOptions.H"
|
||||
|
||||
argList::addBoolOption
|
||||
argList::addVerboseOption
|
||||
(
|
||||
"verbose",
|
||||
"more information about decomposition"
|
||||
);
|
||||
|
||||
@ -71,7 +70,6 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
|
||||
const auto decompFile = args.get<fileName>(1);
|
||||
const bool verbose = args.found("verbose");
|
||||
|
||||
// Set time from database
|
||||
#include "createTime.H"
|
||||
@ -146,7 +144,7 @@ int main(int argc, char *argv[])
|
||||
nDomains
|
||||
);
|
||||
|
||||
if (verbose)
|
||||
if (args.verbose())
|
||||
{
|
||||
info.printDetails(Info);
|
||||
Info<< nl;
|
||||
|
||||
@ -101,8 +101,8 @@ void doTest(const dictionary& dict)
|
||||
Info<< dict.dictName() << dict << nl;
|
||||
|
||||
// Could fail?
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOErr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -120,8 +120,8 @@ void doTest(const dictionary& dict)
|
||||
{
|
||||
Info<< "Caught FatalError " << err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOErr);
|
||||
}
|
||||
|
||||
|
||||
@ -130,8 +130,8 @@ void doTest(const objectRegistry& obr, const dictionary& dict)
|
||||
Info<< dict.dictName() << dict << nl;
|
||||
|
||||
// Could fail?
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOErr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -148,8 +148,8 @@ void doTest(const objectRegistry& obr, const dictionary& dict)
|
||||
{
|
||||
Info<< "Caught FatalError " << err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOErr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -18,6 +18,8 @@ FoamFile
|
||||
#sinclude "$FOAM_CASE/someUnknownFile"
|
||||
#includeIfPresent "$FOAM_CASE/someUnknownFile-$FOAM_CASENAME"
|
||||
|
||||
zeroVelocity uniform (0 0 0);
|
||||
|
||||
internalField uniform 1;
|
||||
|
||||
// supply defaults
|
||||
@ -48,7 +50,7 @@ x 5;
|
||||
varName x;
|
||||
|
||||
|
||||
//Indirection for keys
|
||||
// Indirection for keys
|
||||
key inlet_9;
|
||||
|
||||
|
||||
@ -67,13 +69,17 @@ boundaryField
|
||||
inlet_5 { $inactive }
|
||||
inlet_6a { $...inactive } // Relative scoping - fairly horrible to use
|
||||
inlet_6b { $^inactive } // Absolute scoping
|
||||
inlet_6c { key ${/key}; } // Absolute scoping
|
||||
|
||||
inlet_7 { ${inactive}} // Test variable expansion
|
||||
inlet_8 { $inactive }
|
||||
|
||||
// Variable expansion for a keyword
|
||||
${key} { $inactive }
|
||||
|
||||
#include "testDictInc"
|
||||
|
||||
outlet
|
||||
outletBase
|
||||
{
|
||||
type inletOutlet;
|
||||
inletValue $internalField;
|
||||
@ -83,16 +89,36 @@ boundaryField
|
||||
y 6;
|
||||
}
|
||||
|
||||
// this should have no effect
|
||||
outlet
|
||||
{
|
||||
$outletBase
|
||||
}
|
||||
|
||||
Default_Boundary_Region
|
||||
{
|
||||
valueOut $zeroVelocity;
|
||||
}
|
||||
|
||||
// this should have no effect (not in scope)
|
||||
#remove inactive
|
||||
|
||||
inlet_7 { ${${varType}}} // Test indirection/recursive expansion
|
||||
inlet_8 { $active }
|
||||
// But this should work to remove things in different scopes
|
||||
#remove "/zeroVelocity"
|
||||
|
||||
inlet_7 { ${inactive} } // Test variable expansion
|
||||
inlet_8 { $inactive }
|
||||
|
||||
inlet_7a { ${${varType}} } // Test indirection/recursive expansion
|
||||
inlet_7b { ${${varType}} } // Test indirection/recursive expansion
|
||||
|
||||
#overwrite inlet_8 { type none; }
|
||||
}
|
||||
|
||||
|
||||
// No patterns with scoped removal
|
||||
// #remove "/boundaryField/outletB.*"
|
||||
#remove "/boundaryField/outletBase"
|
||||
|
||||
#include "testDict2"
|
||||
|
||||
verbatim #{
|
||||
@ -123,10 +149,25 @@ baz
|
||||
$active
|
||||
}
|
||||
|
||||
// this should work
|
||||
#remove active
|
||||
// This should work
|
||||
#remove x
|
||||
|
||||
// this should work too
|
||||
// This should work too
|
||||
#remove ( bar baz )
|
||||
|
||||
// Remove a sub-dictionary entry
|
||||
#remove "/anynumber.*/value"
|
||||
|
||||
// Removal does not auto-vivify
|
||||
#remove "/nonExistentDict/value"
|
||||
|
||||
// Add into existing dictionary
|
||||
"/anynumber.*/someValue" 100;
|
||||
|
||||
// Auto-vivify
|
||||
// - but currently cannot auto-vivify entries with dictionary patterns
|
||||
"/abd/someValue" 100;
|
||||
"/def/'someValue.*" 100;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -57,8 +57,8 @@ scalar try_readScalar(const dictionary& dict, const word& k)
|
||||
{
|
||||
scalar val(-GREAT);
|
||||
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOerr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -75,8 +75,8 @@ scalar try_readScalar(const dictionary& dict, const word& k)
|
||||
Info<< "readScalar(" << k << ") Caught FatalError "
|
||||
<< err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOerr);
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -87,8 +87,8 @@ scalar try_getScalar(const dictionary& dict, const word& k)
|
||||
{
|
||||
scalar val(-GREAT);
|
||||
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOerr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -105,8 +105,8 @@ scalar try_getScalar(const dictionary& dict, const word& k)
|
||||
Info<< "get<scalar>(" << k << ") Caught FatalError "
|
||||
<< err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOerr);
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -123,8 +123,8 @@ scalar try_getCheckScalar
|
||||
{
|
||||
scalar val(-GREAT);
|
||||
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOerr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -141,8 +141,8 @@ scalar try_getCheckScalar
|
||||
Info<< "getCheck<scalar>(" << k << ") Caught FatalError "
|
||||
<< err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOerr);
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -159,8 +159,8 @@ scalar try_getScalar(const entry* eptr, const word& k)
|
||||
return val;
|
||||
}
|
||||
|
||||
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOerr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -177,8 +177,8 @@ scalar try_getScalar(const entry* eptr, const word& k)
|
||||
Info<< "entry get<scalar>(" << k << ") Caught FatalError "
|
||||
<< err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalIOError.throwExceptions(throwingIOError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOerr);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -94,7 +94,7 @@ unsigned checkDimensions
|
||||
std::string errMsg;
|
||||
|
||||
// Expect some failures
|
||||
const bool prev = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
for
|
||||
(
|
||||
@ -127,7 +127,7 @@ unsigned checkDimensions
|
||||
hadDimensionError(test, dimsOk, errMsg);
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(prev);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
|
||||
return nFail;
|
||||
}
|
||||
|
||||
@ -56,8 +56,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!args.found("no-throw"))
|
||||
{
|
||||
FatalIOError.throwExceptions();
|
||||
FatalError.throwExceptions();
|
||||
FatalIOError.throwing(true);
|
||||
FatalError.throwing(true);
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
@ -103,8 +103,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
string str(t.stringToken());
|
||||
|
||||
const bool throwingErr = FatalError.throwExceptions();
|
||||
const bool throwingIOErr = FatalIOError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
const bool oldThrowingIOErr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -128,8 +128,8 @@ int main(int argc, char *argv[])
|
||||
Info<< err.message().c_str() << nl;
|
||||
}
|
||||
|
||||
FatalError.throwExceptions(throwingErr);
|
||||
FatalIOError.throwExceptions(throwingIOErr);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
FatalIOError.throwing(oldThrowingIOErr);
|
||||
Info<< nl;
|
||||
}
|
||||
}
|
||||
|
||||
3
applications/test/exprTraits/Make/files
Normal file
3
applications/test/exprTraits/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-exprTraits.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-exprTraits
|
||||
2
applications/test/exprTraits/Make/options
Normal file
2
applications/test/exprTraits/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
108
applications/test/exprTraits/Test-exprTraits.C
Normal file
108
applications/test/exprTraits/Test-exprTraits.C
Normal file
@ -0,0 +1,108 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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, distributed under GPL-3.0-or-later.
|
||||
|
||||
Description
|
||||
Basic tests of expression traits
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "ITstream.H"
|
||||
#include "exprTraits.H"
|
||||
#include "uLabel.H"
|
||||
#include "error.H"
|
||||
#include "stringList.H"
|
||||
#include "exprScanToken.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
void printTraits()
|
||||
{
|
||||
const auto typeCode = exprTypeTraits<T>::value;
|
||||
|
||||
Info<< "type " << pTraits<T>::typeName
|
||||
<< " code:" << int(typeCode)
|
||||
<< " name:" << exprTypeTraits<T>::name;
|
||||
|
||||
if (pTraits<T>::typeName != word(exprTypeTraits<T>::name))
|
||||
{
|
||||
Info<< " (UNSUPPORTED)";
|
||||
}
|
||||
|
||||
Info << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main()
|
||||
{
|
||||
Info<< nl << "Traits:" << nl;
|
||||
|
||||
printTraits<word>();
|
||||
printTraits<string>();
|
||||
printTraits<bool>();
|
||||
printTraits<label>();
|
||||
printTraits<scalar>();
|
||||
printTraits<vector>();
|
||||
printTraits<tensor>();
|
||||
printTraits<symmTensor>();
|
||||
printTraits<sphericalTensor>();
|
||||
|
||||
const auto getName = nameOp<expressions::valueTypeCode>();
|
||||
|
||||
Info<< nl;
|
||||
|
||||
Info<< "Name of typeCode: "
|
||||
<< Foam::name(expressions::valueTypeCode::type_scalar) << nl;
|
||||
|
||||
Info<< "Name of typeCode: "
|
||||
<< getName(expressions::valueTypeCode::type_bool) << nl;
|
||||
|
||||
|
||||
{
|
||||
expressions::scanToken tok;
|
||||
expressions::scanToken tok2;
|
||||
|
||||
Info<< nl << "sizeof(scanToken): "
|
||||
<< sizeof(tok) << nl;
|
||||
|
||||
Info<< " type:" << int(tok.type_) << nl;
|
||||
Info<< " ptr:" << Foam::name(tok.name_) << nl;
|
||||
|
||||
Info<< " type:" << int(tok2.type_) << nl;
|
||||
Info<< " ptr:" << Foam::name(tok2.name_) << nl;
|
||||
|
||||
tok.setWord("hello");
|
||||
|
||||
Info<< " type:" << int(tok.type_) << nl;
|
||||
Info<< " ptr:" << Foam::name(tok.name_) << nl;
|
||||
|
||||
tok2 = tok;
|
||||
Info<< " type:" << int(tok2.type_) << nl;
|
||||
Info<< " ptr:" << Foam::name(tok2.name_) << nl;
|
||||
|
||||
tok2.destroy();
|
||||
|
||||
Info<< " type:" << int(tok2.type_) << nl;
|
||||
Info<< " ptr:" << Foam::name(tok2.name_) << nl;
|
||||
}
|
||||
|
||||
Info<< nl << "Done" << nl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -148,7 +148,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#if 0
|
||||
// Expect failure, but triggers abort which cannot be caught
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
labelledTri l1({1, 2, 3, 10, 24});
|
||||
@ -159,7 +159,7 @@ int main(int argc, char *argv[])
|
||||
WarningInFunction
|
||||
<< "Caught FatalError " << err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
#endif
|
||||
|
||||
labelledTri l2({1, 2, 3});
|
||||
|
||||
@ -224,7 +224,8 @@ void testDirname(const fileName& input)
|
||||
<< " path:" << input.path()
|
||||
<< " name:\"" << input.name() << '"'
|
||||
<< " ext:\"" << input.ext() << '"'
|
||||
<< " components: " << flatOutput(input.components()) << nl;
|
||||
<< " components: " << flatOutput(input.components())
|
||||
<< " last: " << input.component(string::npos) << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -778,7 +779,7 @@ int main(int argc, char *argv[])
|
||||
Info<< nl << "Expect a FatalError for findEtcFile() with a bad name:"
|
||||
<< nl;
|
||||
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -791,7 +792,7 @@ int main(int argc, char *argv[])
|
||||
Info<< nl << "findEtcFile() Caught FatalError "
|
||||
<< err << nl << endl;
|
||||
}
|
||||
FatalError.throwExceptions(throwingError);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
3
applications/test/foamCellZoneToVTK/Make/files
Normal file
3
applications/test/foamCellZoneToVTK/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
foamCellZoneToVTK.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/foamCellZoneToVTK
|
||||
7
applications/test/foamCellZoneToVTK/Make/options
Normal file
7
applications/test/foamCellZoneToVTK/Make/options
Normal file
@ -0,0 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfileFormats \
|
||||
-lmeshTools
|
||||
161
applications/test/foamCellZoneToVTK/foamCellZoneToVTK.C
Normal file
161
applications/test/foamCellZoneToVTK/foamCellZoneToVTK.C
Normal file
@ -0,0 +1,161 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
foamCellZoneToVTK.C
|
||||
|
||||
Description
|
||||
Write tet-decomposed OpenFOAM mesh in VTK format.
|
||||
For diagnostic purposes.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "timeSelector.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "foamVtkInternalMeshWriter.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Write OpenFOAM cellZone mesh to VTK"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"cellZone",
|
||||
"name",
|
||||
"Convert mesh subset corresponding to specified cellZone"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"list",
|
||||
"List names of cellZones and exit"
|
||||
);
|
||||
timeSelector::addOptions();
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
word cellZoneName;
|
||||
args.readIfPresent("cellZone", cellZoneName);
|
||||
|
||||
const bool optList = args.found("list");
|
||||
|
||||
if (optList)
|
||||
{
|
||||
if (!cellZoneName.empty())
|
||||
{
|
||||
Info<< "specify -list or -cellZone, but not both!" << nl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (cellZoneName.empty())
|
||||
{
|
||||
Info<< "Did not specify a cellZone!!" << nl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
fileName exportName("zonemesh-" + cellZoneName);
|
||||
|
||||
#include "createPolyMesh.H"
|
||||
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
|
||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||
|
||||
if (!timei || state != polyMesh::UNCHANGED)
|
||||
{
|
||||
fileName meshName(exportName);
|
||||
if (state != polyMesh::UNCHANGED)
|
||||
{
|
||||
meshName += '_' + runTime.timeName();
|
||||
}
|
||||
|
||||
if (optList)
|
||||
{
|
||||
Info<< "cellZones:" << nl;
|
||||
for (const word& name : mesh.cellZones().names())
|
||||
{
|
||||
Info<< " " << name << nl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const cellZone* zonePtr =
|
||||
mesh.cellZones().cfindZone(cellZoneName);
|
||||
|
||||
Info<< "cellZone " << cellZoneName;
|
||||
if (!zonePtr)
|
||||
{
|
||||
Info<< " ... not found" << nl;
|
||||
continue;
|
||||
}
|
||||
Info<< nl;
|
||||
|
||||
const cellZone& zn = *zonePtr;
|
||||
|
||||
// Define a subset
|
||||
vtk::vtuCells vtuCells;
|
||||
vtuCells.reset(mesh, zn);
|
||||
|
||||
vtk::internalMeshWriter writer
|
||||
(
|
||||
mesh,
|
||||
vtuCells,
|
||||
fileName
|
||||
(
|
||||
mesh.time().globalPath() / meshName
|
||||
)
|
||||
);
|
||||
|
||||
writer.writeGeometry();
|
||||
|
||||
writer.beginCellData();
|
||||
writer.writeProcIDs();
|
||||
|
||||
Info<< "Wrote " << writer.output().name() << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
4
applications/test/foamMeshToTet-vtk/Make/files
Normal file
4
applications/test/foamMeshToTet-vtk/Make/files
Normal file
@ -0,0 +1,4 @@
|
||||
foamMeshToTet-vtk.C
|
||||
writeVTKtetMesh.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/foamMeshToTet-vtk
|
||||
7
applications/test/foamMeshToTet-vtk/Make/options
Normal file
7
applications/test/foamMeshToTet-vtk/Make/options
Normal file
@ -0,0 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfileFormats \
|
||||
-lmeshTools
|
||||
96
applications/test/foamMeshToTet-vtk/foamMeshToTet-vtk.C
Normal file
96
applications/test/foamMeshToTet-vtk/foamMeshToTet-vtk.C
Normal file
@ -0,0 +1,96 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
foamMeshToTet-vtk
|
||||
|
||||
Description
|
||||
Write tet-decomposed OpenFOAM mesh in VTK format.
|
||||
For diagnostic purposes.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "timeSelector.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
void writeVTKtetMesh(const fileName& output, const polyMesh& mesh);
|
||||
}
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Write tet-decomposed OpenFOAM mesh in VTK"
|
||||
);
|
||||
argList::noParallel();
|
||||
timeSelector::addOptions();
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
fileName exportName = "tetmesh";
|
||||
if (args.found("case"))
|
||||
{
|
||||
exportName += '-' + args.globalCaseName();
|
||||
}
|
||||
|
||||
#include "createPolyMesh.H"
|
||||
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
|
||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||
|
||||
if (!timei || state != polyMesh::UNCHANGED)
|
||||
{
|
||||
fileName meshName(exportName);
|
||||
if (state != polyMesh::UNCHANGED)
|
||||
{
|
||||
meshName += '_' + runTime.timeName();
|
||||
}
|
||||
|
||||
writeVTKtetMesh(meshName, mesh);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
204
applications/test/foamMeshToTet-vtk/writeVTKtetMesh.C
Normal file
204
applications/test/foamMeshToTet-vtk/writeVTKtetMesh.C
Normal file
@ -0,0 +1,204 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "Fstream.H"
|
||||
#include "tetMatcher.H"
|
||||
#include "foamVtkInternalMeshWriter.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
void writeVTKtetMesh(const fileName& output, const polyMesh& mesh_)
|
||||
{
|
||||
#if WM_LABEL_SIZE == 64
|
||||
# define FOAM_VTK_LABEL_NAME "vtktypeint64"
|
||||
#else
|
||||
# define FOAM_VTK_LABEL_NAME "int"
|
||||
#endif
|
||||
|
||||
const faceList& faces = mesh_.faces();
|
||||
const labelList& faceOwner = mesh_.faceOwner();
|
||||
|
||||
label nTets = 0;
|
||||
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
|
||||
{
|
||||
nTets += 2 * faces[facei].nTriangles();
|
||||
}
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); ++facei)
|
||||
{
|
||||
nTets += faces[facei].nTriangles();
|
||||
}
|
||||
const label nPoints = (mesh_.nPoints() + mesh_.nCells());
|
||||
|
||||
OFstream os(output + ".vtk");
|
||||
|
||||
Info<< "Write: " << os.name() << nl;
|
||||
|
||||
os << "# vtk DataFile Version 5.1" << nl
|
||||
<< "tet-mesh" << nl
|
||||
<< "ASCII" << nl
|
||||
<< "DATASET UNSTRUCTURED_GRID" << nl
|
||||
<< nl;
|
||||
|
||||
os << "POINTS " << nPoints << " float" << nl;
|
||||
for (const point& p : mesh_.points())
|
||||
{
|
||||
os << float(p.x()) << ' '
|
||||
<< float(p.y()) << ' '
|
||||
<< float(p.z()) << nl;
|
||||
}
|
||||
for (const point& p : mesh_.cellCentres())
|
||||
{
|
||||
os << float(p.x()) << ' '
|
||||
<< float(p.y()) << ' '
|
||||
<< float(p.z()) << nl;
|
||||
}
|
||||
os << nl;
|
||||
|
||||
os << "CELLS " << (1 + nTets) << ' ' << (4 * nTets) << nl;
|
||||
|
||||
os << "OFFSETS " << FOAM_VTK_LABEL_NAME << nl
|
||||
<< 0; // begin offset = 0
|
||||
{
|
||||
label offset = 0;
|
||||
for (label teti = 0; teti < nTets; ++teti)
|
||||
{
|
||||
offset += 4;
|
||||
os << ' ' << offset;
|
||||
}
|
||||
os << nl << nl;
|
||||
}
|
||||
|
||||
labelList nLocalTets(mesh_.nCells(), Zero);
|
||||
|
||||
os << nl
|
||||
<< "CONNECTIVITY " << FOAM_VTK_LABEL_NAME << nl;
|
||||
|
||||
for (label celli = 0; celli < mesh_.nCells(); ++celli)
|
||||
{
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
if (tetMatcher::test(mesh_, celli))
|
||||
{
|
||||
// Tet: no cell-centre decomposition
|
||||
|
||||
const label facei = cFaces[0];
|
||||
const face& f0 = faces[facei];
|
||||
|
||||
// Get the other point from f1. Tbd: check if not duplicate face
|
||||
// (ACMI / ignoreBoundaryFaces_).
|
||||
const face& f1 = faces[cFaces[1]];
|
||||
label apexi = -1;
|
||||
forAll(f1, fp)
|
||||
{
|
||||
apexi = f1[fp];
|
||||
if (!f0.found(apexi))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const label p0 = f0[0];
|
||||
label p1 = f0[1];
|
||||
label p2 = f0[2];
|
||||
|
||||
if (faceOwner[facei] == celli)
|
||||
{
|
||||
std::swap(p1, p2);
|
||||
}
|
||||
|
||||
++nLocalTets[celli];
|
||||
os << p0 << ' ' << p1 << ' ' << p2 << ' ' << apexi << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const label facei : cFaces)
|
||||
{
|
||||
const face& f = faces[facei];
|
||||
|
||||
label fp0 = mesh_.tetBasePtIs()[facei];
|
||||
|
||||
// Fallback
|
||||
if (fp0 < 0)
|
||||
{
|
||||
fp0 = 0;
|
||||
}
|
||||
|
||||
const label p0 = f[fp0];
|
||||
label fp = f.fcIndex(fp0);
|
||||
for (label i = 2; i < f.size(); ++i)
|
||||
{
|
||||
label p1 = f[fp];
|
||||
fp = f.fcIndex(fp);
|
||||
label p2 = f[fp];
|
||||
|
||||
if (faceOwner[facei] == celli)
|
||||
{
|
||||
std::swap(p1, p2);
|
||||
}
|
||||
|
||||
++nLocalTets[celli];
|
||||
os << p0 << ' ' << p1 << ' ' << p2 << ' '
|
||||
<< (mesh_.nPoints() + celli) << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
os << nl
|
||||
<< "CELL_TYPES " << nTets << nl;
|
||||
|
||||
for (label teti = 0; teti < nTets; ++teti)
|
||||
{
|
||||
if (teti) os << ' ';
|
||||
os << vtk::cellType::VTK_TETRA;
|
||||
}
|
||||
os << nl;
|
||||
|
||||
os << nl << "CELL_DATA " << nTets << nl
|
||||
<< "FIELD FieldData " << 1 << nl;
|
||||
|
||||
os << "cellID " << 1 << ' ' << nTets << " int" << nl;
|
||||
forAll(nLocalTets, celli)
|
||||
{
|
||||
label n = nLocalTets[celli];
|
||||
while (n--)
|
||||
{
|
||||
os << ' ' << celli;
|
||||
}
|
||||
os << nl;
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -52,7 +52,7 @@ void testExtraction(const std::string& str)
|
||||
int main()
|
||||
{
|
||||
Info<< "\nVersion information (function)" << nl;
|
||||
foamVersion::printBuildInfo(Info().stdStream());
|
||||
foamVersion::printBuildInfo(Info.stdStream());
|
||||
|
||||
Info
|
||||
<< "\nVersion information (macros)" << nl
|
||||
|
||||
3
applications/test/gatherValues1/Make/files
Normal file
3
applications/test/gatherValues1/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-gatherValues1.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-gatherValues1
|
||||
2
applications/test/gatherValues1/Make/options
Normal file
2
applications/test/gatherValues1/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
189
applications/test/gatherValues1/Test-gatherValues1.C
Normal file
189
applications/test/gatherValues1/Test-gatherValues1.C
Normal file
@ -0,0 +1,189 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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-gatherValues1
|
||||
|
||||
Description
|
||||
Test list gather functionality
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "IPstream.H"
|
||||
#include "OPstream.H"
|
||||
#include "vector.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Pstream.H"
|
||||
#include "globalIndex.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noCheckProcessorDirectories();
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
const labelList localValues
|
||||
(
|
||||
identity(2 *(Pstream::myProcNo()+1), -5*Pstream::myProcNo())
|
||||
);
|
||||
|
||||
// Test resize
|
||||
{
|
||||
globalIndex globIdx(localValues.size());
|
||||
|
||||
Info<< "globIdx = " << flatOutput(globIdx.offsets()) << nl;
|
||||
|
||||
globIdx.setLocalSize(4, 0);
|
||||
Info<< "globIdx = " << flatOutput(globIdx.offsets()) << nl;
|
||||
globIdx.setLocalSize(3, 0);
|
||||
Info<< "globIdx = " << flatOutput(globIdx.offsets()) << nl;
|
||||
}
|
||||
|
||||
|
||||
// Gather all values
|
||||
{
|
||||
const auto& sendData = localValues;
|
||||
|
||||
// One-sided sizing! master only
|
||||
const globalIndex allProcAddr
|
||||
(
|
||||
UPstream::listGatherValues<label>(sendData.size()),
|
||||
globalIndex::SIZES
|
||||
);
|
||||
|
||||
Pout<< "listGather sizes: " << flatOutput(allProcAddr.sizes()) << nl;
|
||||
|
||||
// Collect all values
|
||||
labelList allValues
|
||||
(
|
||||
allProcAddr.mpiGather(sendData)
|
||||
);
|
||||
|
||||
Pout<< "all-data: " << allValues << endl;
|
||||
}
|
||||
|
||||
{
|
||||
const labelList::subList& sendData =
|
||||
(
|
||||
Pstream::master()
|
||||
? SubList<label>(localValues, 0) // exclude
|
||||
: SubList<label>(localValues)
|
||||
);
|
||||
|
||||
const labelList sendSizes
|
||||
(
|
||||
UPstream::listGatherValues<label>(sendData.size())
|
||||
);
|
||||
|
||||
const label sendSize
|
||||
(
|
||||
UPstream::listScatterValues<label>(sendSizes)
|
||||
);
|
||||
|
||||
const globalIndex subProcAddr(sendSizes, globalIndex::SIZES);
|
||||
|
||||
Pout<< "listGather "
|
||||
<< localValues.size() << " = " << flatOutput(sendSizes)
|
||||
<< " offsets " << flatOutput(subProcAddr.offsets())
|
||||
<< nl;
|
||||
|
||||
label newLocalValue = 5 + UPstream::listScatterValues(sendSizes);
|
||||
|
||||
Pout<< "listScattered: " << newLocalValue << nl;
|
||||
|
||||
// Can also scatter a longer list
|
||||
Pout<< "listScatter off "
|
||||
<< UPstream::listScatterValues(subProcAddr.offsets()) << nl;
|
||||
|
||||
|
||||
Pout<< endl << "local list [" << Pstream::myProcNo() << "] "
|
||||
<< flatOutput(localValues) << nl;
|
||||
|
||||
|
||||
Pout<< endl << "local send [" << Pstream::myProcNo() << "] "
|
||||
<< sendSize << nl;
|
||||
|
||||
|
||||
// Collect all off-processor values
|
||||
labelList allValues
|
||||
(
|
||||
subProcAddr.mpiGather(sendData)
|
||||
);
|
||||
|
||||
Pout<< "off-proc: " << allValues << endl;
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
Info<< "master: " << flatOutput(localValues) << nl;
|
||||
|
||||
label proci = 0;
|
||||
for (const labelRange& range : subProcAddr)
|
||||
{
|
||||
Info<< proci << ": " << flatOutput(allValues.slice(range)) << nl;
|
||||
++proci;
|
||||
}
|
||||
|
||||
Info<< nl << "verify ranges" << nl;
|
||||
|
||||
{
|
||||
globalIndex glob;
|
||||
Info<< "empty:" << nl;
|
||||
for (const labelRange& range : glob)
|
||||
{
|
||||
Info<< " range: " << range << endl;
|
||||
}
|
||||
}
|
||||
{
|
||||
globalIndex glob(labelList(Foam::one{}, 0), globalIndex::OFFSETS);
|
||||
Info<< "degenerate:" << nl;
|
||||
for (const labelRange& range : glob)
|
||||
{
|
||||
Info<< " range: " << range << endl;
|
||||
}
|
||||
}
|
||||
{
|
||||
globalIndex glob(labelList(Foam::one{}, 0), globalIndex::SIZES);
|
||||
Info<< "single:" << nl;
|
||||
for (const labelRange& range : glob)
|
||||
{
|
||||
Info<< " range: " << range << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
argList::noParallel();
|
||||
argList::noFunctionObjects();
|
||||
argList::addArgument("start size .. startN sizeN");
|
||||
argList::addOption("verbose");
|
||||
argList::addVerbose("enable labelRange::debug");
|
||||
argList::addNote
|
||||
(
|
||||
"The default is to add ranges, use 'add' and 'del' to toggle\n\n"
|
||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
if (args.found("verbose"))
|
||||
if (args.verbose())
|
||||
{
|
||||
labelRange::debug = 1;
|
||||
}
|
||||
|
||||
15
applications/test/multiWorld/solidFoam/Allrun
Executable file
15
applications/test/multiWorld/solidFoam/Allrun
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#- Run in multi-region mode using chtMultiRegionFoam
|
||||
( cd solid1_solid2 && ./Allrun )
|
||||
|
||||
#- Run in multi-world mode
|
||||
# Could run chtMultiRegionFoam with single solid instead of solidFoam
|
||||
(cd solid1 && runApplication blockMesh)
|
||||
(cd solid2 && runApplication blockMesh)
|
||||
mpirun -app mpirun.schema
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
2
applications/test/multiWorld/solidFoam/mpirun.schema
Normal file
2
applications/test/multiWorld/solidFoam/mpirun.schema
Normal file
@ -0,0 +1,2 @@
|
||||
-np 1 xterm -font fixed -title fluid -geometry 200x15+0+0 -e ./run_solid1.sh
|
||||
-np 1 xterm -font fixed -title solid -geometry 200x15+0+200 -e ./run_solid2.sh
|
||||
8
applications/test/multiWorld/solidFoam/run_solid1.sh
Executable file
8
applications/test/multiWorld/solidFoam/run_solid1.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
solidFoam -case solid1 -world solid1 2>&1 | tee log.solidFoam_solid1
|
||||
read dummy
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
8
applications/test/multiWorld/solidFoam/run_solid2.sh
Executable file
8
applications/test/multiWorld/solidFoam/run_solid2.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
solidFoam -case solid2 -world solid2 2>&1 | tee log.solidFoam_solid2
|
||||
read dummy
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
48
applications/test/multiWorld/solidFoam/solid1/0/T
Normal file
48
applications/test/multiWorld/solidFoam/solid1/0/T
Normal file
@ -0,0 +1,48 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object T;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 1 0 0 0];
|
||||
|
||||
internalField uniform 400;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
bottom
|
||||
{
|
||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||
value $internalField;
|
||||
Tnbr T;
|
||||
kappaMethod solidThermo;
|
||||
thicknessLayers (1e-2);
|
||||
kappaLayers (400);
|
||||
}
|
||||
top
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
left
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
right
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
50
applications/test/multiWorld/solidFoam/solid1/0/p
Normal file
50
applications/test/multiWorld/solidFoam/solid1/0/p
Normal file
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
|
||||
internalField uniform 100000;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
top
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
left
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
20
applications/test/multiWorld/solidFoam/solid1/constant/g
Normal file
20
applications/test/multiWorld/solidFoam/solid1/constant/g
Normal file
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class uniformDimensionedVectorField;
|
||||
object g;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value (0 -9.81 0);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object radiationProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
radiation off;
|
||||
|
||||
radiationModel none;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object thermophysicalProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType
|
||||
{
|
||||
type heSolidThermo;
|
||||
mixture pureMixture;
|
||||
transport constIso;
|
||||
thermo hConst;
|
||||
equationOfState rhoConst;
|
||||
specie specie;
|
||||
energy sensibleEnthalpy;
|
||||
}
|
||||
|
||||
mixture
|
||||
{
|
||||
specie
|
||||
{
|
||||
molWeight 50;
|
||||
}
|
||||
|
||||
transport
|
||||
{
|
||||
kappa 80;
|
||||
}
|
||||
|
||||
thermodynamics
|
||||
{
|
||||
Hf 0;
|
||||
Cp 450;
|
||||
}
|
||||
|
||||
equationOfState
|
||||
{
|
||||
rho 8000;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,96 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-0.1 0.00 -0.05)
|
||||
( 0.1 0.00 -0.05)
|
||||
( 0.1 0.04 -0.05)
|
||||
(-0.1 0.04 -0.05)
|
||||
(-0.1 0.00 0.05)
|
||||
( 0.1 0.00 0.05)
|
||||
( 0.1 0.04 0.05)
|
||||
(-0.1 0.04 0.05)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
bottom
|
||||
{
|
||||
type mappedWall;
|
||||
inGroups 1 ( wall );
|
||||
sampleMode nearestPatchFace;
|
||||
|
||||
sampleWorld solid2;
|
||||
sampleRegion region0;
|
||||
samplePatch top;
|
||||
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
left
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
right
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,61 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application solidFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 500;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
//writeControl adjustable;
|
||||
//writeInterval 0.1;
|
||||
writeControl timeStep;
|
||||
writeInterval 10;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 8;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
//maxCo 0.6;
|
||||
|
||||
// Maximum diffusion number
|
||||
//maxDi 10.0;
|
||||
|
||||
//adjustTimeStep yes;
|
||||
|
||||
//functions
|
||||
//{
|
||||
// #include "vtkWrite"
|
||||
//}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method scotch;
|
||||
// method hierarchical;
|
||||
// method simple;
|
||||
|
||||
regions
|
||||
{
|
||||
heater
|
||||
{
|
||||
numberOfSubdomains 1;
|
||||
method simple; // none;
|
||||
|
||||
coeffs
|
||||
{
|
||||
n (1 1 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
coeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
}
|
||||
|
||||
/*
|
||||
constraints
|
||||
{
|
||||
//- Keep owner and neighbour on same processor for faces in zones:
|
||||
faces
|
||||
{
|
||||
type preserveFaceZones;
|
||||
zones (heater solid1 solid3);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
//default Euler;
|
||||
default steadyState;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(alpha,h) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,53 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
h
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-06;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
hFinal
|
||||
{
|
||||
$h;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
h 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,61 @@
|
||||
// -*- C++ -*-
|
||||
// Use the vtkWrite function object
|
||||
|
||||
vtkWrite
|
||||
{
|
||||
type vtkWrite;
|
||||
libs (utilityFunctionObjects);
|
||||
log true;
|
||||
|
||||
writeControl writeTime;
|
||||
writeInterval 1;
|
||||
|
||||
regions (".*");
|
||||
|
||||
internal true;
|
||||
|
||||
boundary true;
|
||||
|
||||
single false;
|
||||
|
||||
interpolate true;
|
||||
|
||||
// Fields to output (words or regex)
|
||||
fields (".*");
|
||||
|
||||
//- Output format (ascii | binary) - Default=binary
|
||||
// format binary;
|
||||
|
||||
//- Use legacy output format - Default=false
|
||||
// legacy false;
|
||||
|
||||
//- Output directory name - Default="postProcessing/<name>"
|
||||
// directory "VTK";
|
||||
|
||||
//- Write cell ids as field - Default=true
|
||||
writeIds false;
|
||||
}
|
||||
|
||||
|
||||
// Solid walls only
|
||||
walls
|
||||
{
|
||||
type vtkWrite;
|
||||
libs (utilityFunctionObjects);
|
||||
log true;
|
||||
|
||||
writeControl writeTime;
|
||||
writeInterval 1;
|
||||
|
||||
internal false;
|
||||
|
||||
// single true;
|
||||
|
||||
regions ( heater "(?i).*solid" );
|
||||
patches ( "(?i).*solid_to.*" "heater.*(Air|Water)" );
|
||||
|
||||
fields (T);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,48 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object T;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 1 0 0 0];
|
||||
|
||||
internalField uniform 400;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
bottom
|
||||
{
|
||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||
value $internalField;
|
||||
Tnbr T;
|
||||
kappaMethod solidThermo;
|
||||
thicknessLayers (1e-2);
|
||||
kappaLayers (400);
|
||||
}
|
||||
top
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
left
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
right
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
|
||||
internalField uniform 100000;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
top
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
left
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0/leftSolid";
|
||||
object T;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [ 0 0 0 1 0 0 0 ];
|
||||
|
||||
internalField uniform 300;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
left
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
top
|
||||
{
|
||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||
value $internalField;
|
||||
Tnbr T;
|
||||
kappaMethod solidThermo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
|
||||
internalField uniform 100000;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
left
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
top
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
11
applications/test/multiWorld/solidFoam/solid1_solid2/Allclean
Executable file
11
applications/test/multiWorld/solidFoam/solid1_solid2/Allclean
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cleanCase
|
||||
|
||||
rm -rf constant/solid1/polyMesh
|
||||
rm -rf constant/solid2/polyMesh
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -3,11 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if notTest "$@"
|
||||
then
|
||||
foamRunTutorials -skipFirst
|
||||
else
|
||||
echo "--- Skipping testing of tutorials in : $PWD" 1>&2
|
||||
fi
|
||||
#- Run in multi-region mode
|
||||
runApplication -s solid1 blockMesh -region solid1
|
||||
runApplication -s solid2 blockMesh -region solid2
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class uniformDimensionedVectorField;
|
||||
object g;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value (0 -9.81 0);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,24 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object regionProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
regions
|
||||
(
|
||||
fluid ()
|
||||
solid (solid1 solid2)
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object radiationProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
radiation off;
|
||||
|
||||
radiationModel none;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object thermophysicalProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType
|
||||
{
|
||||
type heSolidThermo;
|
||||
mixture pureMixture;
|
||||
transport constIso;
|
||||
thermo hConst;
|
||||
equationOfState rhoConst;
|
||||
specie specie;
|
||||
energy sensibleEnthalpy;
|
||||
}
|
||||
|
||||
mixture
|
||||
{
|
||||
specie
|
||||
{
|
||||
molWeight 50;
|
||||
}
|
||||
|
||||
transport
|
||||
{
|
||||
kappa 80;
|
||||
}
|
||||
|
||||
thermodynamics
|
||||
{
|
||||
Hf 0;
|
||||
Cp 450;
|
||||
}
|
||||
|
||||
equationOfState
|
||||
{
|
||||
rho 8000;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../solid1/radiationProperties
|
||||
@ -0,0 +1 @@
|
||||
../solid1/thermophysicalProperties
|
||||
@ -0,0 +1,61 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application chtMultiRegionFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 500;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
//writeControl adjustable;
|
||||
//writeInterval 0.1;
|
||||
writeControl timeStep;
|
||||
writeInterval 10;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 8;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
//maxCo 0.6;
|
||||
|
||||
// Maximum diffusion number
|
||||
//maxDi 10.0;
|
||||
|
||||
//adjustTimeStep yes;
|
||||
|
||||
//functions
|
||||
//{
|
||||
// #include "vtkWrite"
|
||||
//}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
//default Euler;
|
||||
default steadyState;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(alpha,h) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,53 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
h
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-06;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
hFinal
|
||||
{
|
||||
$h;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
h 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,96 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-0.1 0.00 -0.05)
|
||||
( 0.1 0.00 -0.05)
|
||||
( 0.1 0.04 -0.05)
|
||||
(-0.1 0.04 -0.05)
|
||||
(-0.1 0.00 0.05)
|
||||
( 0.1 0.00 0.05)
|
||||
( 0.1 0.04 0.05)
|
||||
(-0.1 0.04 0.05)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
bottom
|
||||
{
|
||||
type mappedWall;
|
||||
inGroups 1 ( wall );
|
||||
sampleMode nearestPatchFace;
|
||||
|
||||
//sampleWorld solid2;
|
||||
sampleRegion solid2;
|
||||
samplePatch top;
|
||||
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
left
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
right
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../fvSolution
|
||||
@ -0,0 +1,96 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
scale 1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-0.1 -0.04 -0.05)
|
||||
( 0.1 -0.04 -0.05)
|
||||
( 0.1 0.00 -0.05)
|
||||
(-0.1 0.00 -0.05)
|
||||
(-0.1 -0.04 0.05)
|
||||
( 0.1 -0.04 0.05)
|
||||
( 0.1 0.00 0.05)
|
||||
(-0.1 0.00 0.05)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 4 0)
|
||||
);
|
||||
}
|
||||
top
|
||||
{
|
||||
type mappedWall;
|
||||
inGroups 1 ( wall );
|
||||
sampleMode nearestPatchFace;
|
||||
|
||||
//sampleWorld solid1;
|
||||
sampleRegion solid1;
|
||||
samplePatch bottom;
|
||||
|
||||
faces
|
||||
(
|
||||
(3 7 6 2)
|
||||
);
|
||||
}
|
||||
left
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
right
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(2 6 5 1)
|
||||
);
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 3 2 1)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1 @@
|
||||
../fvSchemes
|
||||
@ -0,0 +1 @@
|
||||
../fvSolution
|
||||
51
applications/test/multiWorld/solidFoam/solid2/0/T
Normal file
51
applications/test/multiWorld/solidFoam/solid2/0/T
Normal file
@ -0,0 +1,51 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0/leftSolid";
|
||||
object T;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [ 0 0 0 1 0 0 0 ];
|
||||
|
||||
internalField uniform 300;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
left
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type zeroGradient;
|
||||
value $internalField;
|
||||
}
|
||||
top
|
||||
{
|
||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||
value $internalField;
|
||||
Tnbr T;
|
||||
kappaMethod solidThermo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
50
applications/test/multiWorld/solidFoam/solid2/0/p
Normal file
50
applications/test/multiWorld/solidFoam/solid2/0/p
Normal file
@ -0,0 +1,50 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
|
||||
internalField uniform 100000;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
left
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
right
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
top
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type calculated;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
1
applications/test/multiWorld/solidFoam/solid2/constant/g
Symbolic link
1
applications/test/multiWorld/solidFoam/solid2/constant/g
Symbolic link
@ -0,0 +1 @@
|
||||
../../solid1/constant/g
|
||||
@ -0,0 +1 @@
|
||||
../../solid1/constant/radiationProperties
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user