Compare commits
250 Commits
feature-re
...
rpmbuild-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b319324b6 | |||
| 9f40e04cc1 | |||
| 927b06a19d | |||
| e6a27e0a67 | |||
| 50b44dbfe2 | |||
| 54567be3c6 | |||
| 8c20e769ba | |||
| d1264955e8 | |||
| 2c6fc15734 | |||
| ffde9c2c6f | |||
| 0081eca87d | |||
| a3f173e937 | |||
| 06a60286d2 | |||
| 6e1fca0e46 | |||
| 7b5cfbd1b0 | |||
| 40cadfd2f2 | |||
| 91198eaf6a | |||
| 6f4196ae62 | |||
| f8dc192941 | |||
| 2c7621116e | |||
| de1aa80593 | |||
| 579883354a | |||
| 0e5dfb1f64 | |||
| cae9b6b868 | |||
| b9d6a84314 | |||
| 80318542e1 | |||
| 942c354b59 | |||
| 3d7e99b7a7 | |||
| cc65f5f0f0 | |||
| 3d842aac93 | |||
| 34a3e0abe3 | |||
| 3a6c0d7fb0 | |||
| 19398ded1c | |||
| d44c8318f0 | |||
| 91b5525749 | |||
| 48562b8649 | |||
| 145f29cc9a | |||
| 14aeaf8dab | |||
| 34e226dfe3 | |||
| a2014242cf | |||
| 281f136f38 | |||
| af864cdcd1 | |||
| 83243cf01e | |||
| c2368e3775 | |||
| 1a4975a021 | |||
| b0748af9f6 | |||
| a526dcb305 | |||
| 2f07de03ff | |||
| b632e7b500 | |||
| ec3cdf57bb | |||
| 223e06dfb8 | |||
| 79c23b0d23 | |||
| ae708e67b5 | |||
| c4cc33b748 | |||
| f64e2864f7 | |||
| c754c1ccbf | |||
| 0260643c67 | |||
| 0e7920efc3 | |||
| 208aee14af | |||
| c47eb2fe80 | |||
| beea7ba62f | |||
| 4c2728a45c | |||
| 18dd013e22 | |||
| cd2e69923e | |||
| e5b64f7740 | |||
| 43f904ba9c | |||
| 50137a483d | |||
| 94b3e5b406 | |||
| 29f2eddf80 | |||
| 63e294c55c | |||
| c51fc0175e | |||
| 1f0671694f | |||
| 6615699801 | |||
| 17657673b2 | |||
| f309319c06 | |||
| 13b1417710 | |||
| b18dd0cb43 | |||
| 18bc876c93 | |||
| 445baaf277 | |||
| 19705bdd64 | |||
| ee36fe8c0f | |||
| bc192e249c | |||
| fd257cb011 | |||
| 734a3143dc | |||
| 692734bc69 | |||
| 7438aa6c01 | |||
| 7b6572b483 | |||
| 5fa2bc030d | |||
| b7af3ff891 | |||
| 0bf7758dd4 | |||
| d2c1eac501 | |||
| 97081969b4 | |||
| 923e8103dc | |||
| 7419b0bf98 | |||
| 644bd11a93 | |||
| eb3c806ff9 | |||
| 818a5c3dc2 | |||
| 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 | |||
| f815a12bba |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v1806|v1812|v1906|v1912|v2006|v2012|v2106 etc
|
||||
OpenFOAM version : v2112|v2106|v2012|v2006|v1912|v1906 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
11
Allwmake
11
Allwmake
@ -70,15 +70,16 @@ applications/Allwmake $targetType $*
|
||||
|
||||
|
||||
# Additional components/modules
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||
then
|
||||
case "$FOAM_MODULE_PREFIX" in
|
||||
(false | none)
|
||||
echo ========================================
|
||||
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||
echo
|
||||
else
|
||||
;;
|
||||
(*)
|
||||
# Use wmake -all instead of Allwmake to allow for overrides
|
||||
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
|
||||
fi
|
||||
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all )
|
||||
esac
|
||||
|
||||
# Count files in given directory. Ignore "Test-*" binaries.
|
||||
_foamCountDirEntries()
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2108
|
||||
patch=0
|
||||
api=2112
|
||||
patch=220610
|
||||
|
||||
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
|
||||
|
||||
@ -4,6 +4,5 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
wclean libso BCs
|
||||
wclean
|
||||
wclean rhoCentralDyMFoam
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -5,8 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
(
|
||||
wmake $targetType BCs \
|
||||
&& wmake $targetType \
|
||||
&& wmake $targetType rhoCentralDyMFoam \
|
||||
&& wmake $targetType
|
||||
)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -18,4 +18,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lrhoCentralFoam \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels
|
||||
-lcompressibleTurbulenceModels \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
rhoCentralDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/rhoCentralDyMFoam
|
||||
@ -1,26 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../BCs/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lrhoCentralFoam \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh
|
||||
@ -1,288 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
rhoCentralDyMFoam
|
||||
|
||||
Group
|
||||
grpCompressibleSolvers grpMovingMeshSolvers
|
||||
|
||||
Description
|
||||
Density-based compressible flow solver based on central-upwind
|
||||
schemes of Kurganov and Tadmor
|
||||
with support for mesh-motion and topology changes.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "fixedRhoFvPatchScalarField.H"
|
||||
#include "directionInterpolate.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
#include "motionSolver.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Density-based compressible flow solver based on central-upwind"
|
||||
" schemes of Kurganov and Tadmor.\n"
|
||||
"With support for mesh-motion and topology changes."
|
||||
);
|
||||
|
||||
#define NO_CONTROL
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createTimeControls.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "readFluxScheme.H"
|
||||
|
||||
const dimensionedScalar v_zero(dimVolume/dimTime, Zero);
|
||||
|
||||
// Courant numbers used to adjust the time-step
|
||||
scalar CoNum = 0.0;
|
||||
scalar meanCoNum = 0.0;
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
|
||||
// --- Directed interpolation of primitive fields onto faces
|
||||
|
||||
surfaceScalarField rho_pos(interpolate(rho, pos));
|
||||
surfaceScalarField rho_neg(interpolate(rho, neg));
|
||||
|
||||
surfaceVectorField rhoU_pos(interpolate(rhoU, pos, U.name()));
|
||||
surfaceVectorField rhoU_neg(interpolate(rhoU, neg, U.name()));
|
||||
|
||||
volScalarField rPsi("rPsi", 1.0/psi);
|
||||
surfaceScalarField rPsi_pos(interpolate(rPsi, pos, T.name()));
|
||||
surfaceScalarField rPsi_neg(interpolate(rPsi, neg, T.name()));
|
||||
|
||||
surfaceScalarField e_pos(interpolate(e, pos, T.name()));
|
||||
surfaceScalarField e_neg(interpolate(e, neg, T.name()));
|
||||
|
||||
surfaceVectorField U_pos("U_pos", rhoU_pos/rho_pos);
|
||||
surfaceVectorField U_neg("U_neg", rhoU_neg/rho_neg);
|
||||
|
||||
surfaceScalarField p_pos("p_pos", rho_pos*rPsi_pos);
|
||||
surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg);
|
||||
|
||||
surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf());
|
||||
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
|
||||
|
||||
// Make fluxes relative to mesh-motion
|
||||
if (mesh.moving())
|
||||
{
|
||||
phiv_pos -= mesh.phi();
|
||||
phiv_neg -= mesh.phi();
|
||||
}
|
||||
// Note: extracted out the orientation so becomes unoriented
|
||||
phiv_pos.setOriented(false);
|
||||
phiv_neg.setOriented(false);
|
||||
|
||||
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
||||
surfaceScalarField cSf_pos
|
||||
(
|
||||
"cSf_pos",
|
||||
interpolate(c, pos, T.name())*mesh.magSf()
|
||||
);
|
||||
surfaceScalarField cSf_neg
|
||||
(
|
||||
"cSf_neg",
|
||||
interpolate(c, neg, T.name())*mesh.magSf()
|
||||
);
|
||||
|
||||
surfaceScalarField ap
|
||||
(
|
||||
"ap",
|
||||
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
|
||||
);
|
||||
surfaceScalarField am
|
||||
(
|
||||
"am",
|
||||
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
|
||||
);
|
||||
|
||||
surfaceScalarField a_pos("a_pos", ap/(ap - am));
|
||||
|
||||
surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap)));
|
||||
|
||||
surfaceScalarField aSf("aSf", am*a_pos);
|
||||
|
||||
if (fluxScheme == "Tadmor")
|
||||
{
|
||||
aSf = -0.5*amaxSf;
|
||||
a_pos = 0.5;
|
||||
}
|
||||
|
||||
surfaceScalarField a_neg("a_neg", 1.0 - a_pos);
|
||||
|
||||
phiv_pos *= a_pos;
|
||||
phiv_neg *= a_neg;
|
||||
|
||||
surfaceScalarField aphiv_pos("aphiv_pos", phiv_pos - aSf);
|
||||
surfaceScalarField aphiv_neg("aphiv_neg", phiv_neg + aSf);
|
||||
|
||||
// Reuse amaxSf for the maximum positive and negative fluxes
|
||||
// estimated by the central scheme
|
||||
amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));
|
||||
|
||||
#include "centralCourantNo.H"
|
||||
|
||||
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
||||
|
||||
surfaceVectorField phiU(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg);
|
||||
// Note: reassembled orientation from the pos and neg parts so becomes
|
||||
// oriented
|
||||
phiU.setOriented(true);
|
||||
|
||||
surfaceVectorField phiUp(phiU + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf());
|
||||
|
||||
surfaceScalarField phiEp
|
||||
(
|
||||
"phiEp",
|
||||
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
|
||||
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
|
||||
+ aSf*p_pos - aSf*p_neg
|
||||
);
|
||||
|
||||
// Make flux for pressure-work absolute
|
||||
if (mesh.moving())
|
||||
{
|
||||
surfaceScalarField phia(a_pos*p_pos + a_neg*p_neg);
|
||||
phia.setOriented(true);
|
||||
|
||||
phiEp += mesh.phi()*phia;
|
||||
}
|
||||
|
||||
volScalarField muEff("muEff", turbulence->muEff());
|
||||
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
|
||||
|
||||
// --- Solve density
|
||||
solve(fvm::ddt(rho) + fvc::div(phi));
|
||||
|
||||
// --- Solve momentum
|
||||
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
|
||||
|
||||
U.ref() =
|
||||
rhoU()
|
||||
/rho();
|
||||
U.correctBoundaryConditions();
|
||||
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
|
||||
|
||||
if (!inviscid)
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, U) - fvc::ddt(rho, U)
|
||||
- fvm::laplacian(muEff, U)
|
||||
- fvc::div(tauMC)
|
||||
);
|
||||
rhoU = rho*U;
|
||||
}
|
||||
|
||||
// --- Solve energy
|
||||
surfaceScalarField sigmaDotU
|
||||
(
|
||||
"sigmaDotU",
|
||||
(
|
||||
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
||||
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
||||
)
|
||||
& (a_pos*U_pos + a_neg*U_neg)
|
||||
);
|
||||
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rhoE)
|
||||
+ fvc::div(phiEp)
|
||||
- fvc::div(sigmaDotU)
|
||||
);
|
||||
|
||||
e = rhoE/rho - 0.5*magSqr(U);
|
||||
e.correctBoundaryConditions();
|
||||
thermo.correct();
|
||||
rhoE.boundaryFieldRef() ==
|
||||
rho.boundaryField()*
|
||||
(
|
||||
e.boundaryField() + 0.5*magSqr(U.boundaryField())
|
||||
);
|
||||
|
||||
if (!inviscid)
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, e) - fvc::ddt(rho, e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
);
|
||||
thermo.correct();
|
||||
rhoE = rho*(e + 0.5*magSqr(U));
|
||||
}
|
||||
|
||||
p.ref() =
|
||||
rho()
|
||||
/psi();
|
||||
p.correctBoundaryConditions();
|
||||
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,12 +31,14 @@ Group
|
||||
grpCompressibleSolvers
|
||||
|
||||
Description
|
||||
Density-based compressible flow solver based on central-upwind
|
||||
schemes of Kurganov and Tadmor.
|
||||
Density-based compressible flow solver based on
|
||||
central-upwind schemes of Kurganov and Tadmor with
|
||||
support for mesh-motion and topology changes.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "fixedRhoFvPatchScalarField.H"
|
||||
@ -49,8 +52,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Density-based compressible flow solver based on central-upwind"
|
||||
" schemes of Kurganov and Tadmor."
|
||||
"Density-based compressible flow solver based on"
|
||||
" central-upwind schemes of Kurganov and Tadmor with"
|
||||
" support for mesh-motion and topology changes."
|
||||
);
|
||||
|
||||
#define NO_CONTROL
|
||||
@ -59,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createTimeControls.H"
|
||||
@ -80,6 +84,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "setDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
}
|
||||
|
||||
// --- Directed interpolation of primitive fields onto faces
|
||||
|
||||
surfaceScalarField rho_pos(interpolate(rho, pos));
|
||||
@ -107,6 +123,15 @@ int main(int argc, char *argv[])
|
||||
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
|
||||
phiv_neg.setOriented(false);
|
||||
|
||||
// Make fluxes relative to mesh-motion
|
||||
if (mesh.moving())
|
||||
{
|
||||
surfaceScalarField meshPhi(mesh.phi());
|
||||
meshPhi.setOriented(false);
|
||||
phiv_pos -= meshPhi;
|
||||
phiv_neg -= meshPhi;
|
||||
}
|
||||
|
||||
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
||||
surfaceScalarField cSf_pos
|
||||
(
|
||||
@ -157,18 +182,13 @@ int main(int argc, char *argv[])
|
||||
amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));
|
||||
|
||||
#include "centralCourantNo.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
++runTime;
|
||||
++runTime;
|
||||
}
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
@ -189,6 +209,14 @@ int main(int argc, char *argv[])
|
||||
+ aSf*p_pos - aSf*p_neg
|
||||
);
|
||||
|
||||
// Make flux for pressure-work absolute
|
||||
if (mesh.moving())
|
||||
{
|
||||
surfaceScalarField meshPhi(mesh.phi());
|
||||
meshPhi.setOriented(false);
|
||||
phiEp += meshPhi*(a_pos*p_pos + a_neg*p_neg);
|
||||
}
|
||||
|
||||
volScalarField muEff("muEff", turbulence->muEff());
|
||||
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -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 = "
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I../buoyantBoussinesqSimpleFoam \
|
||||
-I../../incompressible/pimpleFoam \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
@ -13,6 +16,8 @@ EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,7 +31,8 @@ Group
|
||||
grpHeatTransferSolvers
|
||||
|
||||
Description
|
||||
Transient solver for buoyant, turbulent flow of incompressible fluids.
|
||||
Transient solver for buoyant, turbulent flow of incompressible fluids,
|
||||
with optional mesh motion and mesh topology changes.
|
||||
|
||||
Uses the Boussinesq approximation:
|
||||
\f[
|
||||
@ -51,9 +53,11 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvOptions.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -64,7 +68,8 @@ int main(int argc, char *argv[])
|
||||
argList::addNote
|
||||
(
|
||||
"Transient solver for buoyant, turbulent flow"
|
||||
" of incompressible fluids.\n"
|
||||
" of incompressible fluids, with optional mesh"
|
||||
" motion and mesh topology changes.\n"
|
||||
"Uses the Boussinesq approximation."
|
||||
);
|
||||
|
||||
@ -73,10 +78,10 @@ int main(int argc, char *argv[])
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createUfIfPresent.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
#include "initContinuityErrs.H"
|
||||
@ -89,7 +94,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "readDyMControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
@ -100,6 +105,34 @@ int main(int argc, char *argv[])
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
// Do any mesh changes
|
||||
mesh.controlledUpdate();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
MRF.update();
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
// Calculate absolute flux
|
||||
// from the mapped surface velocity
|
||||
phi = mesh.Sf() & Uf();
|
||||
|
||||
#include "correctPhi.H"
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "TEqn.H"
|
||||
|
||||
|
||||
@ -42,6 +42,12 @@
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
|
||||
// Correct Uf if the mesh is moving
|
||||
fvc::correctUf(Uf, U, phi);
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I../../compressible/rhoPimpleFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
@ -7,7 +8,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -21,4 +24,7 @@ EXE_LIBS = \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-latmosphericModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-lregionFaModels
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,8 +31,9 @@ Group
|
||||
grpHeatTransferSolvers
|
||||
|
||||
Description
|
||||
Transient solver for buoyant, turbulent flow of compressible fluids for
|
||||
ventilation and heat-transfer.
|
||||
Transient solver for buoyant, turbulent flow of compressible fluids
|
||||
for ventilation and heat-transfer, with optional mesh motion
|
||||
and mesh topology changes.
|
||||
|
||||
Turbulence is modelled using a run-time selectable compressible RAS or
|
||||
LES model.
|
||||
@ -39,12 +41,16 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "rhoThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvOptions.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -53,7 +59,8 @@ int main(int argc, char *argv[])
|
||||
argList::addNote
|
||||
(
|
||||
"Transient solver for buoyant, turbulent fluid flow"
|
||||
" of compressible fluids, including radiation."
|
||||
" of compressible fluids, including radiation,"
|
||||
" with optional mesh motion and mesh topology changes."
|
||||
);
|
||||
|
||||
#include "postProcess.H"
|
||||
@ -61,36 +68,105 @@ int main(int argc, char *argv[])
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
#include "createRhoUfIfPresent.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
#include "readDyMControls.H"
|
||||
|
||||
// Store divrhoU from the previous mesh
|
||||
// so that it can be mapped and used in correctPhi
|
||||
// to ensure the corrected phi has the same divergence
|
||||
autoPtr<volScalarField> divrhoU;
|
||||
if (correctPhi)
|
||||
{
|
||||
divrhoU.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
"divrhoU",
|
||||
fvc::div(fvc::absolute(phi, rho, U))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
// Store momentum to set rhoUf for introduced faces.
|
||||
autoPtr<volVectorField> rhoU;
|
||||
if (rhoUf.valid())
|
||||
{
|
||||
rhoU.reset(new volVectorField("rhoU", rho*U));
|
||||
}
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
gh = (g & mesh.C()) - ghRef;
|
||||
ghf = (g & mesh.Cf()) - ghRef;
|
||||
|
||||
MRF.update();
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
// Calculate absolute flux
|
||||
// from the mapped surface velocity
|
||||
phi = mesh.Sf() & rhoUf();
|
||||
|
||||
#include "correctPhi.H"
|
||||
|
||||
// Make the fluxes relative to the mesh-motion
|
||||
fvc::makeRelative(phi, rho, U);
|
||||
}
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pimple.firstIter() && !pimple.SIMPLErho())
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
|
||||
|
||||
@ -28,6 +28,8 @@ MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
|
||||
fvScalarMatrix p_rghDDtEqn
|
||||
(
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||
@ -104,7 +106,15 @@ else
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
// Correct rhoUf if the mesh is moving
|
||||
fvc::correctRhoUf(rhoUf, rho, U, phi);
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
|
||||
if (mesh.moving())
|
||||
{
|
||||
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -19,7 +19,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -90,5 +90,24 @@ else
|
||||
);
|
||||
}
|
||||
|
||||
// Consider mesh flux to correct for mesh deformation
|
||||
bool meshFluxCorr(false);
|
||||
if (mesh.solutionDict().found("SIMPLE"))
|
||||
{
|
||||
meshFluxCorr =
|
||||
mesh.solutionDict().subDict("SIMPLE").getOrDefault<bool>
|
||||
(
|
||||
"meshFluxCorrection", false
|
||||
);
|
||||
}
|
||||
else if (mesh.solutionDict().found("PIMPLE"))
|
||||
{
|
||||
meshFluxCorr =
|
||||
mesh.solutionDict().subDict("PIMPLE").getOrDefault<bool>
|
||||
(
|
||||
"meshFluxCorrection", false
|
||||
);
|
||||
}
|
||||
|
||||
#include "createRadiationModel.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
@ -11,14 +11,14 @@
|
||||
fvOptions(rho, h)
|
||||
);
|
||||
|
||||
if (mesh.changing())
|
||||
if (meshFluxCorr)
|
||||
{
|
||||
surfaceScalarField phihMesh
|
||||
(
|
||||
fvc::interpolate(betav*rho*h)*mesh.phi()
|
||||
);
|
||||
|
||||
hEqn -= fvc::div(phihMesh);
|
||||
hEqn -= fvc::div(phihMesh);
|
||||
}
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
@ -8,7 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -39,6 +39,6 @@ EXE_LIBS = \
|
||||
-lturbulenceModels \
|
||||
-lsampling \
|
||||
-lregionModels \
|
||||
-lregionFaModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lcompressibleTwoPhaseMixtureTurbulenceModels
|
||||
|
||||
|
||||
@ -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,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -203,6 +204,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity using pressure and temperature
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Heat capacity at constant volume [J/kg/K]
|
||||
virtual tmp<volScalarField> Cv() const;
|
||||
|
||||
@ -214,6 +227,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Density from pressure and temperature
|
||||
virtual tmp<scalarField> rhoEoS
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
virtual tmp<volScalarField> gamma() const;
|
||||
|
||||
|
||||
@ -318,6 +318,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity using pressure and temperature
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Heat capacity at constant volume [J/kg/K]
|
||||
virtual tmp<volScalarField> Cv() const;
|
||||
|
||||
@ -329,6 +341,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Density from pressure and temperature
|
||||
virtual tmp<scalarField> rhoEoS
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
virtual tmp<volScalarField> gamma() const;
|
||||
|
||||
|
||||
@ -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) 2016-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -173,6 +173,18 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity using pressure and temperature
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Return Cv of the mixture
|
||||
virtual tmp<volScalarField> Cv() const;
|
||||
|
||||
@ -184,6 +196,18 @@ public:
|
||||
const label patchI
|
||||
) const;
|
||||
|
||||
//- Density from pressure and temperature
|
||||
virtual tmp<scalarField> rhoEoS
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const labelList& cells
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return tmp<scalarField>::New(p);
|
||||
}
|
||||
|
||||
//- Gamma = Cp/Cv []
|
||||
virtual tmp<volScalarField> gamma() const;
|
||||
|
||||
|
||||
35
applications/solvers/multiphase/interIsoFoam/UEqn.H
Normal file
35
applications/solvers/multiphase/interIsoFoam/UEqn.H
Normal file
@ -0,0 +1,35 @@
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
+ turbulence->divDevRhoReff(rho, U)
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
#include "UEqnAddPorosity.H"
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
// Including porosity effects in UEqn following:
|
||||
// Jensen, B., Jacobsen, N. G., & Christensen, E. D. (2014).
|
||||
// Investigations on the porous media equations and resistance
|
||||
// coefficients for coastal structures. Coastal Engineering, 84, 56-72.
|
||||
|
||||
if (porosityEnabled)
|
||||
{
|
||||
const volScalarField& porosity = tporosity.cref();
|
||||
|
||||
const word porosityModel("JensenEtAl2014");
|
||||
const dictionary& dict =
|
||||
porosityProperties.subDict(porosityModel + "Coeffs");
|
||||
const dimensionedScalar alpha(dimless/dimArea, dict.get<scalar>("alpha"));
|
||||
const dimensionedScalar beta(dimless/dimLength, dict.get<scalar>("beta"));
|
||||
const dimensionedScalar d50(dimless, dict.get<scalar>("d50"));
|
||||
const dimensionedScalar KC(dimless, dict.get<scalar>("KC"));
|
||||
|
||||
// Generating Darcy-Forchheimer coefficient: F = rho*U*(a + b*|U|)
|
||||
// Shoud it be mu or muEff in the equation below?
|
||||
{
|
||||
// Darcy term
|
||||
volScalarField DarcyForchheimerCoeff
|
||||
(
|
||||
alpha*sqr(1 - porosity)*mixture.mu()/sqr(porosity)/sqr(d50)
|
||||
);
|
||||
|
||||
// Adding Forchheimer term
|
||||
DarcyForchheimerCoeff += rho*mag(U)
|
||||
*beta*(1 + pos(KC)*7.5/KC)*(1 - porosity)/sqr(porosity)/d50;
|
||||
|
||||
// Adding Darcy-Forchheimer term as implicit source term
|
||||
UEqn += fvm::Sp(DarcyForchheimerCoeff, U);
|
||||
}
|
||||
|
||||
{
|
||||
// Generating added mass force coefficient
|
||||
const dimensionedScalar gamma_p(dimless, dict.get<scalar>("gamma_p"));
|
||||
const volScalarField Cm(gamma_p*(1 - porosity));
|
||||
|
||||
UEqn += Cm*fvm::ddt(rho, U);
|
||||
UEqn += Cm*MRF.DDt(rho, U);
|
||||
}
|
||||
|
||||
// Dividing both matrix entries and source term by porosity to compensate
|
||||
// for the fact that the FVM cell volume averages use division by cell
|
||||
// volume V whereas only the cell pore volume, porosity*V, is accessible.
|
||||
UEqn *= scalar(1)/porosity;
|
||||
}
|
||||
@ -22,8 +22,20 @@
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
scalar domainFraction = 0;
|
||||
if (porosityEnabled)
|
||||
{
|
||||
const volScalarField& porosity = tporosity.cref();
|
||||
rhoPhi *= scalar(1)/fvc::interpolate(porosity);
|
||||
domainFraction = alpha1.weightedAverage(mesh.Vsc()*porosity).value();
|
||||
}
|
||||
else
|
||||
{
|
||||
domainFraction = alpha1.weightedAverage(mesh.Vsc()).value();
|
||||
}
|
||||
|
||||
Info<< "Phase-1 volume fraction = "
|
||||
<< alpha1.weightedAverage(mesh.Vsc()).value()
|
||||
<< domainFraction
|
||||
<< " Min(" << alpha1.name() << ") = " << min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") = " << max(alpha1).value()
|
||||
<< endl;
|
||||
|
||||
@ -130,5 +130,6 @@ mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createPorosity.H"
|
||||
|
||||
isoAdvection advector(alpha1, phi, U);
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
// Reading porosity properties from constant directory
|
||||
IOdictionary porosityProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"porosityProperties",
|
||||
runTime.constant(),
|
||||
runTime,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
const bool porosityEnabled
|
||||
(
|
||||
porosityProperties.getOrDefault<bool>("porosityEnabled", false)
|
||||
);
|
||||
|
||||
tmp<volScalarField> tporosity;
|
||||
if (porosityEnabled)
|
||||
{
|
||||
tporosity = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"porosity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
}
|
||||
@ -92,7 +92,7 @@ int main(int argc, char *argv[])
|
||||
#include "initCorrectPhi.H"
|
||||
#include "createUfIfPresent.H"
|
||||
|
||||
#include "CourantNo.H"
|
||||
#include "porousCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -101,8 +101,8 @@ int main(int argc, char *argv[])
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "porousCourantNo.H"
|
||||
#include "porousAlphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
@ -0,0 +1,69 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 Johan Roenby
|
||||
-------------------------------------------------------------------------------
|
||||
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/>.
|
||||
|
||||
Global
|
||||
porousAlphaCourantNo
|
||||
|
||||
Description
|
||||
Calculates and outputs the mean and maximum Courant Numbers.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
scalar maxAlphaCo = runTime.controlDict().get<scalar>("maxAlphaCo");
|
||||
scalar alphaCoNum = 0;
|
||||
scalar meanAlphaCoNum = 0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
mixture.nearInterface()().primitiveField()
|
||||
*fvc::surfaceSum(mag(phi))().primitiveField()
|
||||
);
|
||||
|
||||
if (porosityEnabled)
|
||||
{
|
||||
const volScalarField& porosity = tporosity.cref();
|
||||
|
||||
alphaCoNum =
|
||||
0.5*gMax(sumPhi/mesh.V().field()/porosity)*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()*porosity))
|
||||
*runTime.deltaTValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
<< " max: " << alphaCoNum << endl;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 Johan Roenby
|
||||
-------------------------------------------------------------------------------
|
||||
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/>.
|
||||
|
||||
Global
|
||||
porousCourantNo
|
||||
|
||||
Description
|
||||
Calculates and outputs the mean and maximum Courant Numbers.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
scalar CoNum = 0;
|
||||
scalar meanCoNum = 0;
|
||||
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
fvc::surfaceSum(mag(phi))().primitiveField()
|
||||
);
|
||||
|
||||
if (porosityEnabled)
|
||||
{
|
||||
const volScalarField& porosity = tporosity.cref();
|
||||
|
||||
CoNum =
|
||||
0.5*gMax(sumPhi/mesh.V().field()/porosity)
|
||||
*runTime.deltaTValue();
|
||||
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()*porosity))
|
||||
*runTime.deltaTValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Courant Number mean: " << meanCoNum
|
||||
<< " max: " << CoNum << endl;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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()
|
||||
#};
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -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;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -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 | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user