Compare commits
299 Commits
develop.sw
...
feature-cl
| Author | SHA1 | Date | |
|---|---|---|---|
| 55d5f99047 | |||
| d439440453 | |||
| 6c66cc58a6 | |||
| 265b3dd2f8 | |||
| b17a9128a1 | |||
| 31d4148173 | |||
| 13b8a3c02a | |||
| 715831610d | |||
| ab42d1a1e6 | |||
| 13cf489f63 | |||
| 3277fb931b | |||
| 9e83d31138 | |||
| 878f1bf773 | |||
| 84348dc3f5 | |||
| 1f7c038ad7 | |||
| f20361d44a | |||
| 580a003d4d | |||
| d74572cae8 | |||
| 1cd47839ac | |||
| 66908158ae | |||
| 7e61f36c12 | |||
| 4cccd5f854 | |||
| b1e919dbbb | |||
| c273ee4697 | |||
| aebd79ff59 | |||
| 0a01492397 | |||
| 8d2165e7f4 | |||
| 5fa37fb41c | |||
| 87cff55f9e | |||
| 4dafaa8cfe | |||
| ec77d3152b | |||
| fa7f0e1b67 | |||
| 02ca7868d5 | |||
| 029c5a24fe | |||
| b41ddc43c3 | |||
| 48973bad83 | |||
| 7d97b6f791 | |||
| a0f1e98d24 | |||
| d5b7200295 | |||
| 952d42512d | |||
| 0de1df7309 | |||
| d58e06494d | |||
| b7b78a3052 | |||
| 6ad25ef293 | |||
| c551ef3b01 | |||
| 24e97c6b91 | |||
| bd41ad1842 | |||
| ed5690ffbc | |||
| 05322608a2 | |||
| 4b94ac97c2 | |||
| 1888bc62ab | |||
| 95a6e8b419 | |||
| c3b0742e03 | |||
| 7c235371ff | |||
| e90092ad91 | |||
| 115bf529ad | |||
| 09f4d8513f | |||
| 36f66606a2 | |||
| 91a62ca05a | |||
| 993b7af513 | |||
| 6f2c609a14 | |||
| 885456f9a4 | |||
| 8f63fd5230 | |||
| 7441e18475 | |||
| 9e6123b5a4 | |||
| 3a429894b1 | |||
| d8f33c626a | |||
| 9c9088f191 | |||
| 1f393aefa8 | |||
| b94bf625a5 | |||
| 161fab8d60 | |||
| 8afd6ff729 | |||
| b69db76b67 | |||
| d5e82f072e | |||
| a8b0ec0c4e | |||
| d7de6a2772 | |||
| 48f8680941 | |||
| 4c8fc9dc6e | |||
| 5844463ba4 | |||
| 9479ab98eb | |||
| c29e67e5e5 | |||
| eaffe4c2cf | |||
| 0fde8ac91d | |||
| d0061d6f54 | |||
| c439968390 | |||
| 5fb0cd77f1 | |||
| b50591166e | |||
| ce10cc54c2 | |||
| 599b009b18 | |||
| 80f385a3b0 | |||
| 8127ec6a05 | |||
| c9a10055e8 | |||
| 9018c94b90 | |||
| d6204acd0e | |||
| 3e260b84db | |||
| 9fbe2ef0b3 | |||
| 9b379398c5 | |||
| b50850de56 | |||
| 3ab182b1ae | |||
| 3151dacccc | |||
| 8ae2e5a969 | |||
| bbd6bfbb7f | |||
| 8d4e32da22 | |||
| f9191b9377 | |||
| 59811983db | |||
| dff4c3da05 | |||
| e60d0997e6 | |||
| ea44944037 | |||
| 4a01979fa8 | |||
| 689b2ab2a9 | |||
| fbd14e42a2 | |||
| 9711b7f1b9 | |||
| ffeef76d8f | |||
| 7fe8bdcf99 | |||
| e190df9033 | |||
| 0b83d39500 | |||
| 8495b86d8e | |||
| 09a6049f50 | |||
| 6b6d4c10a3 | |||
| 8bfbda8c71 | |||
| bdb437ab10 | |||
| 286c6ce7d8 | |||
| 478c1b2312 | |||
| 69be54107d | |||
| e401e8f132 | |||
| 3f87aec01a | |||
| efc4649f12 | |||
| 360af221fe | |||
| adf95d483c | |||
| 8c02820db6 | |||
| 9d212dfd32 | |||
| 126d831f6e | |||
| cb4e026aed | |||
| 2984d1e3e7 | |||
| 98598ba0bb | |||
| fc0b980333 | |||
| ffbad65538 | |||
| 38b663b6a8 | |||
| ac4f580d09 | |||
| f638db48c7 | |||
| b8d01a88ea | |||
| 3d7dc6a870 | |||
| b129446221 | |||
| fc9311ba0d | |||
| 3384747f9b | |||
| e5006a62d7 | |||
| 1339c3357b | |||
| 0ba458fdbc | |||
| 27c2cdc040 | |||
| 5ec435aca3 | |||
| c33167dc0e | |||
| e4139898d2 | |||
| d3e285b48b | |||
| c7e6ae30bf | |||
| db88265163 | |||
| f3ba6c6da0 | |||
| 9f9b8fb662 | |||
| 8ba1156a56 | |||
| 13606d4e09 | |||
| 90b61429f6 | |||
| d69ac516e8 | |||
| 9114e01de9 | |||
| a8f369fd2b | |||
| b5e6a42ded | |||
| b18a6675cb | |||
| 354767c694 | |||
| 88e1932145 | |||
| 945405c32d | |||
| 013f3cccc4 | |||
| 8993af73ac | |||
| 21e7ce8f42 | |||
| 94c7e180fb | |||
| 67b58c28c0 | |||
| db57c456f6 | |||
| 1b11e4b3ac | |||
| 5e0a23edd5 | |||
| d7bf2d400d | |||
| d9ab5d54ef | |||
| ec1d66d640 | |||
| 3b0af86448 | |||
| d009cb8bc1 | |||
| 1dafe5d393 | |||
| 225f548d2d | |||
| 6cb8337345 | |||
| 3d81dd6277 | |||
| 90c4ee7e12 | |||
| 5714a3606e | |||
| 0fabbcb404 | |||
| 5338e56c73 | |||
| 9f7cfa9419 | |||
| e15b103003 | |||
| c2af76337e | |||
| edc12c9ad9 | |||
| 25e874a4f0 | |||
| beea22b2f0 | |||
| 0624fb0181 | |||
| 941cd7fef4 | |||
| fd75d38757 | |||
| d5a973419a | |||
| ab6615c060 | |||
| b48fd4f38a | |||
| 2a406bbb25 | |||
| 8c0679d25f | |||
| a4d235af6b | |||
| 6c6c8c5008 | |||
| 7fa4f1ef76 | |||
| 5b29ff0e42 | |||
| b7592c1ee8 | |||
| 799d247142 | |||
| 70208a7399 | |||
| 473e14418a | |||
| b9c15b8585 | |||
| 18216a4639 | |||
| 99780bd7cd | |||
| 5163e52974 | |||
| 35aa6140cc | |||
| e510321a26 | |||
| 3a4537abc9 | |||
| 493bfdbdc4 | |||
| 32507b3251 | |||
| 81f783286c | |||
| 7db69fc22e | |||
| 9557cde880 | |||
| c039a09e71 | |||
| e0f3993045 | |||
| 12ba22bebf | |||
| 07a9ee86f3 | |||
| 9563607e01 | |||
| 5b1c060e9e | |||
| 53397e6f3f | |||
| 67ba5acf18 | |||
| e5cf96b0f9 | |||
| 62f37b2a43 | |||
| 619ddc2355 | |||
| 4fc34c8a63 | |||
| 2cc96ad7f4 | |||
| 541b6eb28a | |||
| 10b724b10d | |||
| d2f2ab6d25 | |||
| b92fbd8f73 | |||
| 3c214e99df | |||
| 913c45afff | |||
| fc19ca39f3 | |||
| 2202995f5c | |||
| 21f037e3a0 | |||
| c973066646 | |||
| 371795840c | |||
| 7a43cac55a | |||
| 9433898941 | |||
| 454f7960b0 | |||
| 9db3547bd3 | |||
| 278378031e | |||
| bd000d89e9 | |||
| ac25608fbd | |||
| 37e90dbad7 | |||
| 2c7a7b27a3 | |||
| 7a67c1e72b | |||
| b145e59049 | |||
| 24ffc5236d | |||
| fd55151a12 | |||
| 3caeeb1f51 | |||
| 0c3a938810 | |||
| 62244c6caf | |||
| 3a6a76044d | |||
| 5a9dbcdadf | |||
| dffac4d887 | |||
| 65dc440f3c | |||
| 4585a2d229 | |||
| 18eeba116a | |||
| 61deacd24d | |||
| 81b1c5021f | |||
| 96ff2f32e5 | |||
| 9434972261 | |||
| d5cdc60a54 | |||
| 779a2ca084 | |||
| 98a510c317 | |||
| 0c89f38312 | |||
| bcd461926c | |||
| 793433da72 | |||
| 34d69cad23 | |||
| a246a97b12 | |||
| 7b2bcfda0b | |||
| 7eda6de6f4 | |||
| d938e01d7a | |||
| 623c0624fb | |||
| 36d7954004 | |||
| 159a7a5a38 | |||
| 55f5f8774b | |||
| 9d5a3a5c54 | |||
| ee9119f436 | |||
| 3a6e427409 | |||
| ea51c2c0e4 | |||
| 867b5e9060 | |||
| 7c2311aae6 | |||
| f87f0040b8 | |||
| c59b6db3c4 | |||
| 5677e10d90 | |||
| 38d68824b3 | |||
| 8283599c31 |
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Providing details of your set-up can help us identify any issues, e.g.
|
Providing details of your set-up can help us identify any issues, e.g.
|
||||||
OpenFOAM version : v2206|v2112|v2106|v2012|v2006 etc
|
OpenFOAM version : v2212|v2206|v2112|v2106|v2012 etc
|
||||||
Operating system : ubuntu|openSUSE|centos etc
|
Operating system : ubuntu|openSUSE|centos etc
|
||||||
Hardware info : any info that may help?
|
Hardware info : any info that may help?
|
||||||
Compiler : gcc|intel|clang etc
|
Compiler : gcc|intel|clang etc
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
api=2206
|
api=2212
|
||||||
patch=220907
|
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
|
If OpenFOAM has already been compiled on your system, simply source
|
||||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||||
For example, for the OpenFOAM-v2206 version:
|
For example, for the OpenFOAM-v2212 version:
|
||||||
```
|
```
|
||||||
source /installation/path/OpenFOAM-v2206/etc/bashrc
|
source /installation/path/OpenFOAM-v2212/etc/bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compiling OpenFOAM
|
## Compiling OpenFOAM
|
||||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
|||||||
to the OpenFOAM directory. For example,
|
to the OpenFOAM directory. For example,
|
||||||
```
|
```
|
||||||
/path/parent
|
/path/parent
|
||||||
|-- OpenFOAM-v2206
|
|-- OpenFOAM-v2212
|
||||||
\-- ThirdParty-v2206
|
\-- ThirdParty-v2212
|
||||||
```
|
```
|
||||||
There are, however, many cases where this simple convention is inadequate:
|
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)
|
operating system or cluster installation provides it)
|
||||||
|
|
||||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||||
directory name, e.g. openfoam-sandbox2206, etc..
|
directory name, e.g. openfoam-sandbox2212, etc..
|
||||||
|
|
||||||
* When we would like any additional 3rd party software to be located
|
* When we would like any additional 3rd party software to be located
|
||||||
inside of the OpenFOAM directory to ensure that the installation is
|
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
|
2. PREFIX/ThirdParty-VERSION
|
||||||
* this corresponds to the traditional approach
|
* this corresponds to the traditional approach
|
||||||
3. PREFIX/ThirdParty-vAPI
|
3. PREFIX/ThirdParty-vAPI
|
||||||
* allows for an updated value of VERSION, *eg*, `v2206-myCustom`,
|
* allows for an updated value of VERSION, *eg*, `v2212-myCustom`,
|
||||||
without requiring a renamed ThirdParty. The API value would still
|
without requiring a renamed ThirdParty. The API value would still
|
||||||
be `2206` and the original `ThirdParty-v2206/` would be found.
|
be `2212` and the original `ThirdParty-v2212/` would be found.
|
||||||
4. PREFIX/ThirdParty-API
|
4. PREFIX/ThirdParty-API
|
||||||
* same as the previous example, but using an unadorned API value.
|
* same as the previous example, but using an unadorned API value.
|
||||||
5. PREFIX/ThirdParty-common
|
5. PREFIX/ThirdParty-common
|
||||||
|
|||||||
@ -3,6 +3,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/overset/lnInclude \
|
-I$(LIB_SRC)/overset/lnInclude \
|
||||||
|
-I$(LIB_SRC)/overset/include/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -31,3 +31,25 @@
|
|||||||
Info<< "Reading diffusivity DT\n" << endl;
|
Info<< "Reading diffusivity DT\n" << endl;
|
||||||
|
|
||||||
dimensionedScalar DT("DT", dimViscosity, transportProperties);
|
dimensionedScalar DT("DT", dimViscosity, transportProperties);
|
||||||
|
|
||||||
|
bool oversetPatchErrOutput =
|
||||||
|
simple.dict().getOrDefault("oversetPatchErrOutput", false);
|
||||||
|
|
||||||
|
// Dummy phi for oversetPatchErrOutput
|
||||||
|
tmp<surfaceScalarField> tdummyPhi;
|
||||||
|
if (oversetPatchErrOutput)
|
||||||
|
{
|
||||||
|
tdummyPhi = tmp<surfaceScalarField>::New
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"dummyPhi",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(dimless, Zero)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,6 +58,7 @@ Description
|
|||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "simpleControl.H"
|
#include "simpleControl.H"
|
||||||
#include "dynamicFvMesh.H"
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "oversetPatchPhiErr.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -99,6 +100,11 @@ int main(int argc, char *argv[])
|
|||||||
fvOptions.constrain(TEqn);
|
fvOptions.constrain(TEqn);
|
||||||
TEqn.solve();
|
TEqn.solve();
|
||||||
fvOptions.correct(T);
|
fvOptions.correct(T);
|
||||||
|
|
||||||
|
if (oversetPatchErrOutput)
|
||||||
|
{
|
||||||
|
oversetPatchPhiErr(TEqn, tdummyPhi.ref());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "write.H"
|
#include "write.H"
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd
|
Copyright (C) 2017-2022 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -149,7 +149,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
|
||||||
|
|
||||||
// Since solver contains no time loop it would never execute
|
// Since solver contains no time loop it would never execute
|
||||||
// function objects so do it ourselves
|
// function objects so do it ourselves
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "\nConstructing reacting cloud" << endl;
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
basicReactingCloud parcels
|
reactingCloud parcels
|
||||||
(
|
(
|
||||||
"reactingCloud1",
|
"reactingCloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "basicReactingCloud.H"
|
#include "reactingCloud.H"
|
||||||
#include "surfaceFilmModel.H"
|
#include "surfaceFilmModel.H"
|
||||||
#include "pyrolysisModelCollection.H"
|
#include "pyrolysisModelCollection.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
bool ddtCorr
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("ddtCorr", true)
|
|
||||||
);
|
|
||||||
@ -69,6 +69,8 @@ mesh.setFluxRequired(p.name());
|
|||||||
|
|
||||||
// Mask field for zeroing out contributions on hole cells
|
// Mask field for zeroing out contributions on hole cells
|
||||||
#include "createCellMask.H"
|
#include "createCellMask.H"
|
||||||
|
// Create bool field with interpolated cells
|
||||||
|
#include "createInterpolatedCells.H"
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -43,7 +43,6 @@ Description
|
|||||||
#include "dynamicFvMesh.H"
|
#include "dynamicFvMesh.H"
|
||||||
#include "fluidThermo.H"
|
#include "fluidThermo.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "bound.H"
|
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "pressureControl.H"
|
#include "pressureControl.H"
|
||||||
#include "CorrectPhi.H"
|
#include "CorrectPhi.H"
|
||||||
@ -89,10 +88,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
|
||||||
#include "readDyMControls.H"
|
#include "readDyMControls.H"
|
||||||
|
|
||||||
|
|
||||||
// Store divrhoU from the previous mesh so that it can be mapped
|
// Store divrhoU from the previous mesh so that it can be mapped
|
||||||
// and used in correctPhi to ensure the corrected phi has the
|
// and used in correctPhi to ensure the corrected phi has the
|
||||||
// same divergence
|
// same divergence
|
||||||
@ -128,7 +125,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Do any mesh changes
|
// Do any mesh changes
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
@ -137,52 +133,22 @@ int main(int argc, char *argv[])
|
|||||||
MRF.update();
|
MRF.update();
|
||||||
|
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
|
#include "setInterpolatedCells.H"
|
||||||
const surfaceScalarField faceMaskOld
|
#include "correctRhoPhiFaceMask.H"
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
|
||||||
rhoUf() *= faceMaskOld;
|
|
||||||
|
|
||||||
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
|
|
||||||
|
|
||||||
// Update Uf and phi on new C-I faces
|
|
||||||
rhoUf() += (1-faceMaskOld)*rhoUfint;
|
|
||||||
|
|
||||||
// Update Uf boundary
|
|
||||||
forAll(rhoUf().boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
rhoUf().boundaryFieldRef()[patchI] =
|
|
||||||
rhoUfint.boundaryField()[patchI];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate absolute flux from the mapped surface velocity
|
|
||||||
phi = mesh.Sf() & rhoUf();
|
|
||||||
|
|
||||||
if (correctPhi)
|
if (correctPhi)
|
||||||
{
|
{
|
||||||
|
// Corrects flux on separated regions
|
||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
|
|
||||||
phi *= faceMask;
|
|
||||||
U *= cellMask;
|
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh-motion
|
// Make the fluxes relative to the mesh-motion
|
||||||
fvc::makeRelative(phi, rho, U);
|
fvc::makeRelative(phi, rho, U);
|
||||||
|
|
||||||
}
|
if (checkMeshCourantNo)
|
||||||
|
{
|
||||||
if (checkMeshCourantNo)
|
#include "meshCourantNo.H"
|
||||||
{
|
}
|
||||||
#include "meshCourantNo.H"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,17 +25,6 @@ surfaceScalarField phiHbyA
|
|||||||
fvc::interpolate(rho)*fvc::flux(HbyA)
|
fvc::interpolate(rho)*fvc::flux(HbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ddtCorr)
|
|
||||||
{
|
|
||||||
surfaceScalarField faceMaskOld
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
|
|
||||||
phiHbyA +=
|
|
||||||
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf));
|
|
||||||
}
|
|
||||||
|
|
||||||
fvc::makeRelative(phiHbyA, rho, U);
|
fvc::makeRelative(phiHbyA, rho, U);
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
@ -134,8 +123,4 @@ if (thermo.dpdt())
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
phi *= faceMask;
|
phi *= faceMask;
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
|
||||||
|
|
||||||
checkMeshCourantNo =
|
|
||||||
pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
|
||||||
|
|
||||||
|
|
||||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
|
||||||
@ -4,7 +4,7 @@
|
|||||||
sqrt
|
sqrt
|
||||||
(
|
(
|
||||||
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
|
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
|
||||||
*aMesh.edgeInterpolation::deltaCoeffs()
|
*mag(aMesh.edgeInterpolation::deltaCoeffs())
|
||||||
/rhol
|
/rhol
|
||||||
)
|
)
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaT().value();
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
// Volume-to surface mapping object
|
||||||
|
const volSurfaceMapping vsm(aMesh);
|
||||||
|
|
||||||
volVectorField U
|
volVectorField U
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -26,6 +29,3 @@ volScalarField H
|
|||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar(dimLength, Zero)
|
dimensionedScalar(dimLength, Zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create volume-to surface mapping object
|
|
||||||
volSurfaceMapping vsm(aMesh);
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Create volume-to surface mapping object
|
// Volume-to surface mapping object
|
||||||
volSurfaceMapping vsm(aMesh);
|
const volSurfaceMapping vsm(aMesh);
|
||||||
|
|
||||||
volScalarField Cvf
|
volScalarField Cvf
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Create volume-to surface mapping object
|
// Volume-to surface mapping object
|
||||||
volSurfaceMapping vsm(aMesh);
|
const volSurfaceMapping vsm(aMesh);
|
||||||
|
|
||||||
volScalarField Cvf
|
volScalarField Cvf
|
||||||
(
|
(
|
||||||
|
|||||||
@ -124,3 +124,6 @@ dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
|
|||||||
|
|
||||||
// Mask field for zeroing out contributions on hole cells
|
// Mask field for zeroing out contributions on hole cells
|
||||||
#include "createCellMask.H"
|
#include "createCellMask.H"
|
||||||
|
|
||||||
|
// Create bool field with interpolated cells
|
||||||
|
#include "createInterpolatedCells.H"
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -50,6 +50,7 @@ Description
|
|||||||
#include "CorrectPhi.H"
|
#include "CorrectPhi.H"
|
||||||
#include "cellCellStencilObject.H"
|
#include "cellCellStencilObject.H"
|
||||||
#include "localMin.H"
|
#include "localMin.H"
|
||||||
|
#include "oversetAdjustPhi.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -86,9 +87,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
#include "readControls.H"
|
|
||||||
#include "readDyMControls.H"
|
#include "readDyMControls.H"
|
||||||
|
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
@ -128,45 +126,14 @@ int main(int argc, char *argv[])
|
|||||||
MRF.update();
|
MRF.update();
|
||||||
|
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
|
#include "setInterpolatedCells.H"
|
||||||
const surfaceScalarField faceMaskOld
|
#include "correctRhoPhiFaceMask.H"
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
|
||||||
rhoUf() *= faceMaskOld;
|
|
||||||
|
|
||||||
//fvc::correctRhoUf(rhoUfint, rho, U, phi);
|
|
||||||
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
|
|
||||||
|
|
||||||
// Update Uf and phi on new C-I faces
|
|
||||||
rhoUf() += (1-faceMaskOld)*rhoUfint;
|
|
||||||
|
|
||||||
// Update Uf boundary
|
|
||||||
forAll(rhoUf().boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
rhoUf().boundaryFieldRef()[patchI] =
|
|
||||||
rhoUfint.boundaryField()[patchI];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate absolute flux from the mapped surface velocity
|
|
||||||
phi = mesh.Sf() & rhoUf();
|
|
||||||
|
|
||||||
if (correctPhi)
|
if (correctPhi)
|
||||||
{
|
{
|
||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
|
|
||||||
phi *= faceMask;
|
|
||||||
U *= cellMask;
|
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh-motion
|
// Make the fluxes relative to the mesh-motion
|
||||||
fvc::makeRelative(phi, rho, U);
|
fvc::makeRelative(phi, rho, U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,17 +21,14 @@ surfaceScalarField phiHbyA
|
|||||||
fvc::flux(rho*HbyA) + phig
|
fvc::flux(rho*HbyA) + phig
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ddtCorr)
|
if (adjustFringe)
|
||||||
{
|
{
|
||||||
surfaceScalarField faceMaskOld
|
fvc::makeRelative(phiHbyA,rho, U);
|
||||||
(
|
oversetAdjustPhi(phiHbyA, U);
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
fvc::makeAbsolute(phiHbyA,rho, U);
|
||||||
);
|
|
||||||
|
|
||||||
phiHbyA +=
|
|
||||||
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
@ -122,8 +119,4 @@ if (thermo.dpdt())
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
phi *= faceMask;
|
phi *= faceMask;
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
|
||||||
|
|
||||||
checkMeshCourantNo =
|
|
||||||
pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
|
||||||
|
|
||||||
|
|
||||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
|
||||||
@ -113,15 +113,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
#include "setRegionFluidFields.H"
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
#include "setRegionSolidFields.H"
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +137,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
#include "setRegionFluidFields.H"
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
if (!frozenFlow)
|
if (!frozenFlow)
|
||||||
{
|
{
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
@ -166,20 +172,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
<< fluidRegions[i].name() << endl;
|
<< fluidRegions[i].name() << endl;
|
||||||
#include "setRegionFluidFields.H"
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
#include "setRegionFluidFields.H"
|
||||||
frozenFlow = true;
|
frozenFlow = true;
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for solid region "
|
Info<< "\nSolving for solid region "
|
||||||
<< solidRegions[i].name() << endl;
|
<< solidRegions[i].name() << endl;
|
||||||
#include "setRegionSolidFields.H"
|
|
||||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,17 +76,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
<< fluidRegions[i].name() << endl;
|
<< fluidRegions[i].name() << endl;
|
||||||
#include "setRegionFluidFields.H"
|
|
||||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
#include "setRegionSolidFields.H"
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,8 +103,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
#include "setRegionFluidFields.H"
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
if (!frozenFlow)
|
if (!frozenFlow)
|
||||||
{
|
{
|
||||||
#include "pEqn.H"
|
#include "pEqn.H"
|
||||||
@ -121,20 +127,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
<< fluidRegions[i].name() << endl;
|
<< fluidRegions[i].name() << endl;
|
||||||
#include "setRegionFluidFields.H"
|
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||||
#include "readFluidMultiRegionSIMPLEControls.H"
|
#include "setRegionFluidFields.H"
|
||||||
frozenFlow = true;
|
frozenFlow = true;
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for solid region "
|
Info<< "\nSolving for solid region "
|
||||||
<< solidRegions[i].name() << endl;
|
<< solidRegions[i].name() << endl;
|
||||||
#include "setRegionSolidFields.H"
|
|
||||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,3 +5,5 @@
|
|||||||
|
|
||||||
const bool momentumPredictor =
|
const bool momentumPredictor =
|
||||||
simple.getOrDefault("momentumPredictor", true);
|
simple.getOrDefault("momentumPredictor", true);
|
||||||
|
|
||||||
|
simple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
const fvMesh& mesh = fluidRegions[i];
|
|
||||||
|
|
||||||
rhoThermo& thermo = thermoFluid[i];
|
rhoThermo& thermo = thermoFluid[i];
|
||||||
thermo.validate(args.executable(), "h", "e");
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -108,19 +108,23 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
<< fluidRegions[i].name() << endl;
|
<< fluidRegions[i].name() << endl;
|
||||||
#include "setRegionFluidFields.H"
|
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for solid region "
|
Info<< "\nSolving for solid region "
|
||||||
<< solidRegions[i].name() << endl;
|
<< solidRegions[i].name() << endl;
|
||||||
#include "setRegionSolidFields.H"
|
|
||||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,20 +139,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for fluid region "
|
Info<< "\nSolving for fluid region "
|
||||||
<< fluidRegions[i].name() << endl;
|
<< fluidRegions[i].name() << endl;
|
||||||
#include "setRegionFluidFields.H"
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
#include "setRegionFluidFields.H"
|
||||||
frozenFlow = true;
|
frozenFlow = true;
|
||||||
#include "solveFluid.H"
|
#include "solveFluid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
{
|
{
|
||||||
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
Info<< "\nSolving for solid region "
|
Info<< "\nSolving for solid region "
|
||||||
<< solidRegions[i].name() << endl;
|
<< solidRegions[i].name() << endl;
|
||||||
#include "setRegionSolidFields.H"
|
|
||||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,3 +9,5 @@
|
|||||||
(
|
(
|
||||||
pimpleDict.getOrDefault<int>("nEnergyCorrectors", 1)
|
pimpleDict.getOrDefault<int>("nEnergyCorrectors", 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
fvMesh& mesh = fluidRegions[i];
|
|
||||||
|
|
||||||
twoPhaseSystem& fluid = phaseSystemFluid[i];
|
twoPhaseSystem& fluid = phaseSystemFluid[i];
|
||||||
|
|
||||||
phaseModel& phase1 = fluid.phase1();
|
phaseModel& phase1 = fluid.phase1();
|
||||||
|
|||||||
@ -8,3 +8,5 @@
|
|||||||
|
|
||||||
const bool momentumPredictor =
|
const bool momentumPredictor =
|
||||||
pimple.getOrDefault("momentumPredictor", true);
|
pimple.getOrDefault("momentumPredictor", true);
|
||||||
|
|
||||||
|
pimple.readIfPresent("frozenFlow", frozenFlowFluid[i]);
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
fvMesh& mesh = fluidRegions[i];
|
|
||||||
|
|
||||||
CombustionModel<rhoReactionThermo>& reaction = reactionFluid[i];
|
CombustionModel<rhoReactionThermo>& reaction = reactionFluid[i];
|
||||||
|
|
||||||
rhoReactionThermo& thermo = reaction.thermo();
|
rhoReactionThermo& thermo = reaction.thermo();
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
(
|
(
|
||||||
solidRegions[i],
|
solidRegions[i],
|
||||||
thermos[i],
|
thermos[i],
|
||||||
coordinateSystem::typeName_()
|
coordinateSystem::typeName
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
fvMesh& mesh = solidRegions[i];
|
|
||||||
solidThermo& thermo = thermos[i];
|
solidThermo& thermo = thermos[i];
|
||||||
|
|
||||||
tmp<volScalarField> trho = thermo.rho();
|
tmp<volScalarField> trho = thermo.rho();
|
||||||
|
|||||||
@ -15,7 +15,7 @@ if (!thermo.isotropic())
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
thermo,
|
thermo,
|
||||||
coordinateSystem::typeName_()
|
coordinateSystem::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
tmp<volVectorField> tkappaByCp = thermo.Kappa()/thermo.Cp();
|
tmp<volVectorField> tkappaByCp = thermo.Kappa()/thermo.Cp();
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -37,7 +37,10 @@ scalar meanCoNum = 0.0;
|
|||||||
|
|
||||||
if (mesh.nInternalFaces())
|
if (mesh.nInternalFaces())
|
||||||
{
|
{
|
||||||
surfaceScalarField phiMask(localMin<scalar>(mesh).interpolate(cellMask));
|
surfaceScalarField phiMask
|
||||||
|
(
|
||||||
|
localMin<scalar>(mesh).interpolate(cellMask + interpolatedCells)
|
||||||
|
);
|
||||||
|
|
||||||
scalarField sumPhi(fvc::surfaceSum(mag(phiMask*phi))().internalField());
|
scalarField sumPhi(fvc::surfaceSum(mag(phiMask*phi))().internalField());
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
// Solve the Momentum equation
|
// Solve the Momentum equation
|
||||||
|
|
||||||
MRF.correctBoundaryVelocity(U);
|
MRF.correctBoundaryVelocity(U);
|
||||||
|
|
||||||
tmp<fvVectorMatrix> tUEqn
|
tmp<fvVectorMatrix> tUEqn
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
#include "createTimeControls.H"
|
|
||||||
|
|
||||||
bool correctPhi
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("correctPhi", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool checkMeshCourantNo
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("checkMeshCourantNo", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool massFluxInterpolation
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("massFluxInterpolation", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool adjustFringe
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("oversetAdjustPhi", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool ddtCorr
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("ddtCorr", true)
|
|
||||||
);
|
|
||||||
@ -1,273 +0,0 @@
|
|||||||
// Interpolation used
|
|
||||||
interpolationCellPoint<vector> UInterpolator(HbyA);
|
|
||||||
|
|
||||||
// Determine faces on outside of interpolated cells
|
|
||||||
bitSet isOwnerInterpolatedFace(mesh.nInternalFaces());
|
|
||||||
bitSet isNeiInterpolatedFace(mesh.nInternalFaces());
|
|
||||||
|
|
||||||
// Determine donor cells
|
|
||||||
labelListList donorCell(mesh.nInternalFaces());
|
|
||||||
|
|
||||||
scalarListList weightCellCells(mesh.nInternalFaces());
|
|
||||||
|
|
||||||
// Interpolated HbyA faces
|
|
||||||
vectorField UIntFaces(mesh.nInternalFaces(), Zero);
|
|
||||||
|
|
||||||
// Determine receptor neighbour cells
|
|
||||||
labelList receptorNeigCell(mesh.nInternalFaces(), -1);
|
|
||||||
|
|
||||||
{
|
|
||||||
const cellCellStencilObject& overlap = Stencil::New(mesh);
|
|
||||||
const labelList& cellTypes = overlap.cellTypes();
|
|
||||||
const labelIOList& zoneID = overlap.zoneID();
|
|
||||||
|
|
||||||
label nZones = gMax(zoneID)+1;
|
|
||||||
PtrList<fvMeshSubset> meshParts(nZones);
|
|
||||||
labelList nCellsPerZone(nZones, Zero);
|
|
||||||
|
|
||||||
// A mesh subset for each zone
|
|
||||||
forAll(meshParts, zonei)
|
|
||||||
{
|
|
||||||
meshParts.set
|
|
||||||
(
|
|
||||||
zonei,
|
|
||||||
// Select cells where the zoneID == zonei
|
|
||||||
new fvMeshSubset(mesh, zonei, zoneID)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
|
||||||
{
|
|
||||||
label ownType = cellTypes[mesh.faceOwner()[faceI]];
|
|
||||||
label neiType = cellTypes[mesh.faceNeighbour()[faceI]];
|
|
||||||
if
|
|
||||||
(
|
|
||||||
ownType == cellCellStencil::INTERPOLATED
|
|
||||||
&& neiType == cellCellStencil::CALCULATED
|
|
||||||
)
|
|
||||||
{
|
|
||||||
isOwnerInterpolatedFace.set(faceI);
|
|
||||||
|
|
||||||
const vector& fc = mesh.faceCentres()[faceI];
|
|
||||||
|
|
||||||
for (label zoneI = 0; zoneI < nZones; zoneI++)
|
|
||||||
{
|
|
||||||
if (zoneI != zoneID[mesh.faceOwner()[faceI]])
|
|
||||||
{
|
|
||||||
const fvMesh& partMesh = meshParts[zoneI].subMesh();
|
|
||||||
const labelList& cellMap = meshParts[zoneI].cellMap();
|
|
||||||
label cellI = partMesh.findCell(fc);
|
|
||||||
|
|
||||||
if (cellI != -1)
|
|
||||||
{
|
|
||||||
// Determine weights
|
|
||||||
labelList stencil(partMesh.cellCells()[cellI]);
|
|
||||||
|
|
||||||
stencil.append(cellI);
|
|
||||||
|
|
||||||
label st = stencil.size();
|
|
||||||
|
|
||||||
donorCell[faceI].setSize(st);
|
|
||||||
|
|
||||||
weightCellCells[faceI].setSize(st);
|
|
||||||
|
|
||||||
scalarField weights(st);
|
|
||||||
|
|
||||||
forAll(stencil, i)
|
|
||||||
{
|
|
||||||
scalar d = mag
|
|
||||||
(
|
|
||||||
partMesh.cellCentres()[stencil[i]]
|
|
||||||
- fc
|
|
||||||
);
|
|
||||||
weights[i] = 1.0/d;
|
|
||||||
donorCell[faceI][i] = cellMap[stencil[i]];
|
|
||||||
}
|
|
||||||
weights /= sum(weights);
|
|
||||||
|
|
||||||
weightCellCells[faceI] = weights;
|
|
||||||
|
|
||||||
forAll(stencil, i)
|
|
||||||
{
|
|
||||||
UIntFaces[faceI] +=
|
|
||||||
weightCellCells[faceI][i]
|
|
||||||
*UInterpolator.interpolate
|
|
||||||
(
|
|
||||||
fc,
|
|
||||||
donorCell[faceI][i]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
receptorNeigCell[faceI] = mesh.faceNeighbour()[faceI];
|
|
||||||
}
|
|
||||||
else if
|
|
||||||
(
|
|
||||||
ownType == cellCellStencil::CALCULATED
|
|
||||||
&& neiType == cellCellStencil::INTERPOLATED
|
|
||||||
)
|
|
||||||
{
|
|
||||||
isNeiInterpolatedFace.set(faceI);
|
|
||||||
|
|
||||||
const vector& fc = mesh.faceCentres()[faceI];
|
|
||||||
for (label zoneI = 0; zoneI < nZones; zoneI++)
|
|
||||||
{
|
|
||||||
if (zoneI != zoneID[mesh.faceNeighbour()[faceI]])
|
|
||||||
{
|
|
||||||
const fvMesh& partMesh = meshParts[zoneI].subMesh();
|
|
||||||
const labelList& cellMap = meshParts[zoneI].cellMap();
|
|
||||||
label cellI = partMesh.findCell(fc);
|
|
||||||
|
|
||||||
if (cellI != -1)
|
|
||||||
{
|
|
||||||
// Determine weights
|
|
||||||
labelList stencil(partMesh.cellCells()[cellI]);
|
|
||||||
|
|
||||||
stencil.append(cellI);
|
|
||||||
|
|
||||||
label st = stencil.size();
|
|
||||||
|
|
||||||
donorCell[faceI].setSize(st);
|
|
||||||
|
|
||||||
weightCellCells[faceI].setSize(st);
|
|
||||||
|
|
||||||
scalarField weights(st);
|
|
||||||
|
|
||||||
forAll(stencil, i)
|
|
||||||
{
|
|
||||||
scalar d = mag
|
|
||||||
(
|
|
||||||
partMesh.cellCentres()[stencil[i]]
|
|
||||||
- fc
|
|
||||||
);
|
|
||||||
weights[i] = 1.0/d;
|
|
||||||
donorCell[faceI][i] = cellMap[stencil[i]];
|
|
||||||
}
|
|
||||||
weights /= sum(weights);
|
|
||||||
|
|
||||||
weightCellCells[faceI] = weights;
|
|
||||||
|
|
||||||
forAll(stencil, i)
|
|
||||||
{
|
|
||||||
UIntFaces[faceI] +=
|
|
||||||
weightCellCells[faceI][i]
|
|
||||||
*UInterpolator.interpolate
|
|
||||||
(
|
|
||||||
fc,
|
|
||||||
donorCell[faceI][i]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
receptorNeigCell[faceI] = mesh.faceOwner()[faceI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// contravariant U
|
|
||||||
vectorField U1Contrav(mesh.nInternalFaces(), Zero);
|
|
||||||
|
|
||||||
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf());
|
|
||||||
|
|
||||||
forAll(isNeiInterpolatedFace, faceI)
|
|
||||||
{
|
|
||||||
label cellId = -1;
|
|
||||||
if (isNeiInterpolatedFace.test(faceI))
|
|
||||||
{
|
|
||||||
cellId = mesh.faceNeighbour()[faceI];
|
|
||||||
}
|
|
||||||
else if (isOwnerInterpolatedFace.test(faceI))
|
|
||||||
{
|
|
||||||
cellId = mesh.faceOwner()[faceI];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cellId != -1)
|
|
||||||
{
|
|
||||||
const vector& n = faceNormals[faceI];
|
|
||||||
vector n1(Zero);
|
|
||||||
|
|
||||||
// 2-D cases
|
|
||||||
if (mesh.nSolutionD() == 2)
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
if (mesh.geometricD()[cmpt] == -1)
|
|
||||||
{
|
|
||||||
switch (cmpt)
|
|
||||||
{
|
|
||||||
case vector::X:
|
|
||||||
{
|
|
||||||
n1 = vector(0, n.z(), -n.y());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case vector::Y:
|
|
||||||
{
|
|
||||||
n1 = vector(n.z(), 0, -n.x());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case vector::Z:
|
|
||||||
{
|
|
||||||
n1 = vector(n.y(), -n.x(), 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (mesh.nSolutionD() == 3)
|
|
||||||
{
|
|
||||||
//Determine which is the primary direction
|
|
||||||
if (mag(n.x()) > mag(n.y()) && mag(n.x()) > mag(n.z()))
|
|
||||||
{
|
|
||||||
n1 = vector(n.y(), -n.x(), 0);
|
|
||||||
}
|
|
||||||
else if (mag(n.y()) > mag(n.z()))
|
|
||||||
{
|
|
||||||
n1 = vector(0, n.z(), -n.y());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
n1 = vector(-n.z(), 0, n.x());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
n1.normalise();
|
|
||||||
|
|
||||||
const vector n2 = normalised(n ^ n1);
|
|
||||||
|
|
||||||
tensor rot =
|
|
||||||
tensor
|
|
||||||
(
|
|
||||||
n.x() ,n.y(), n.z(),
|
|
||||||
n1.x() ,n1.y(), n1.z(),
|
|
||||||
n2.x() ,n2.y(), n2.z()
|
|
||||||
);
|
|
||||||
|
|
||||||
// tensor rot =
|
|
||||||
// tensor
|
|
||||||
// (
|
|
||||||
// n & x ,n & y, n & z,
|
|
||||||
// n1 & x ,n1 & y, n1 & z,
|
|
||||||
// n2 & x ,n2 & y, n2 & z
|
|
||||||
// );
|
|
||||||
|
|
||||||
U1Contrav[faceI].x() =
|
|
||||||
2*transform(rot, UIntFaces[faceI]).x()
|
|
||||||
- transform(rot, HbyA[receptorNeigCell[faceI]]).x();
|
|
||||||
|
|
||||||
U1Contrav[faceI].y() = transform(rot, HbyA[cellId]).y();
|
|
||||||
|
|
||||||
U1Contrav[faceI].z() = transform(rot, HbyA[cellId]).z();
|
|
||||||
|
|
||||||
HbyA[cellId] = transform(inv(rot), U1Contrav[faceI]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2018 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -46,12 +46,9 @@ Description
|
|||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
|
|
||||||
#include "cellCellStencilObject.H"
|
#include "cellCellStencilObject.H"
|
||||||
#include "zeroGradientFvPatchFields.H"
|
|
||||||
#include "localMin.H"
|
#include "localMin.H"
|
||||||
#include "interpolationCellPoint.H"
|
|
||||||
#include "transform.H"
|
|
||||||
#include "fvMeshSubset.H"
|
|
||||||
#include "oversetAdjustPhi.H"
|
#include "oversetAdjustPhi.H"
|
||||||
|
#include "oversetPatchPhiErr.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -68,10 +65,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCaseLists.H"
|
#include "setRootCaseLists.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
|
#include "createDyMControls.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createUf.H"
|
#include "createUf.H"
|
||||||
#include "createMRF.H"
|
#include "createMRF.H"
|
||||||
@ -88,7 +84,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
#include "readDyMControls.H"
|
||||||
|
#include "readOversetDyMControls.H"
|
||||||
|
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
|
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
@ -97,45 +95,20 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
bool changed = mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
if (changed)
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
#include "setInterpolatedCells.H"
|
#include "setInterpolatedCells.H"
|
||||||
|
#include "correctPhiFaceMask.H"
|
||||||
|
|
||||||
surfaceScalarField faceMaskOld
|
fvc::makeRelative(phi, U);
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
if (checkMeshCourantNo)
|
||||||
Uf *= faceMaskOld;
|
{
|
||||||
// Update Uf and phi on new C-I faces
|
#include "meshCourantNo.H"
|
||||||
Uf += (1-faceMaskOld)*fvc::interpolate(U);
|
}
|
||||||
phi = mesh.Sf() & Uf;
|
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
phi *= faceMask;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mesh.changing() && correctPhi)
|
|
||||||
{
|
|
||||||
// Calculate absolute flux from the mapped surface velocity
|
|
||||||
#include "correctPhi.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make the flux relative to the mesh motion
|
|
||||||
fvc::makeRelative(phi, U);
|
|
||||||
|
|
||||||
if (mesh.changing() && checkMeshCourantNo)
|
|
||||||
{
|
|
||||||
#include "meshCourantNo.H"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Pressure-velocity PIMPLE corrector loop
|
// --- Pressure-velocity PIMPLE corrector loop
|
||||||
|
|||||||
@ -1,36 +1,11 @@
|
|||||||
// Option 1: interpolate rAU, do not block out rAU on blocked cells
|
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
mesh.interpolate(rAU);
|
|
||||||
|
|
||||||
// Option 2: do not interpolate rAU but block out rAU
|
|
||||||
//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
|
|
||||||
|
|
||||||
|
|
||||||
// Option 3: do not interpolate rAU but zero out rAUf on faces on holes
|
|
||||||
// But what about:
|
|
||||||
//
|
|
||||||
// H
|
|
||||||
// H I C C C C
|
|
||||||
// H
|
|
||||||
//
|
|
||||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
volVectorField H("H", UEqn.H());
|
volVectorField H("H", UEqn.H());
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = constrainHbyA(rAU*H, U, p);
|
HbyA = constrainHbyA(rAU*H, U, p);
|
||||||
|
|
||||||
if (massFluxInterpolation)
|
|
||||||
{
|
|
||||||
#include "interpolatedFaces.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (runTime.outputTime())
|
|
||||||
{
|
|
||||||
H.write();
|
|
||||||
rAU.write();
|
|
||||||
HbyA.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pimple.nCorrPISO() <= 1)
|
if (pimple.nCorrPISO() <= 1)
|
||||||
{
|
{
|
||||||
tUEqn.clear();
|
tUEqn.clear();
|
||||||
@ -38,33 +13,16 @@ if (pimple.nCorrPISO() <= 1)
|
|||||||
|
|
||||||
phiHbyA = fvc::flux(HbyA);
|
phiHbyA = fvc::flux(HbyA);
|
||||||
|
|
||||||
if (ddtCorr)
|
|
||||||
{
|
|
||||||
surfaceScalarField faceMaskOld
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
phiHbyA += rAUf*faceMaskOld*fvc::ddtCorr(U, Uf);
|
|
||||||
}
|
|
||||||
|
|
||||||
MRF.makeRelative(phiHbyA);
|
MRF.makeRelative(phiHbyA);
|
||||||
|
|
||||||
// WIP
|
|
||||||
if (p.needReference())
|
|
||||||
{
|
|
||||||
fvc::makeRelative(phiHbyA, U);
|
|
||||||
adjustPhi(phiHbyA, U, p);
|
|
||||||
fvc::makeAbsolute(phiHbyA, U);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (adjustFringe)
|
if (adjustFringe)
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phiHbyA, U);
|
fvc::makeRelative(phiHbyA, U);
|
||||||
oversetAdjustPhi(phiHbyA, U);
|
oversetAdjustPhi(phiHbyA, U, zoneIdMass);
|
||||||
fvc::makeAbsolute(phiHbyA, U);
|
fvc::makeAbsolute(phiHbyA, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -79,27 +37,26 @@ while (pimple.correctNonOrthogonal())
|
|||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi = phiHbyA - pEqn.flux();
|
phi = phiHbyA - pEqn.flux();
|
||||||
// option 2:
|
pEqn.relax();
|
||||||
// rAUf*fvc::snGrad(p)*mesh.magSf();
|
U =
|
||||||
|
cellMask*
|
||||||
|
(
|
||||||
|
HbyA
|
||||||
|
- rAU*fvc::reconstruct((pEqn.flux())/rAUf)
|
||||||
|
);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oversetPatchErrOutput)
|
||||||
|
{
|
||||||
|
oversetPatchPhiErr(pEqn, phiHbyA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Excludes error in interpolated/hole cells
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
// Explicitly relax pressure for momentum corrector
|
|
||||||
p.relax();
|
|
||||||
volVectorField gradP(fvc::grad(p));
|
|
||||||
|
|
||||||
// Option 2: zero out velocity on blocked out cells
|
|
||||||
//U = HbyA - rAU*cellMask*gradP;
|
|
||||||
// Option 3: zero out velocity on blocked out cells
|
|
||||||
// This is needed for the scalar Eq (k,epsilon, etc)
|
|
||||||
// which can use U as source term
|
|
||||||
U = cellMask*(HbyA - rAU*gradP);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
|
|
||||||
fvOptions.correct(U);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
@ -109,9 +66,4 @@ fvOptions.correct(U);
|
|||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
phi *= faceMask;
|
phi *= faceMask;
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
|
||||||
|
|
||||||
checkMeshCourantNo = pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
|
||||||
|
|
||||||
massFluxInterpolation =
|
|
||||||
pimple.dict().getOrDefault("massFluxInterpolation", false);
|
|
||||||
|
|
||||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
|
||||||
@ -24,7 +24,3 @@ bool adjustFringe
|
|||||||
(
|
(
|
||||||
simple.dict().getOrDefault("oversetAdjustPhi", false)
|
simple.dict().getOrDefault("oversetAdjustPhi", false)
|
||||||
);
|
);
|
||||||
bool massFluxInterpolation
|
|
||||||
(
|
|
||||||
simple.dict().getOrDefault("massFluxInterpolation", false)
|
|
||||||
);
|
|
||||||
|
|||||||
@ -1,18 +1,10 @@
|
|||||||
{
|
{
|
||||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||||
|
|
||||||
//mesh.interpolate(HbyA);
|
|
||||||
if (massFluxInterpolation)
|
|
||||||
{
|
|
||||||
#include "interpolatedFaces.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
tUEqn.clear();
|
tUEqn.clear();
|
||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
||||||
|
|||||||
@ -42,11 +42,11 @@ Description
|
|||||||
#include "CorrectPhi.H"
|
#include "CorrectPhi.H"
|
||||||
|
|
||||||
#ifdef MPPIC
|
#ifdef MPPIC
|
||||||
#include "basicKinematicCloud.H"
|
#include "kinematicCloud.H"
|
||||||
#define basicKinematicTypeCloud basicKinematicCloud
|
#define kinematicTypeCloud kinematicCloud
|
||||||
#else
|
#else
|
||||||
#include "basicKinematicCollidingCloud.H"
|
#include "kinematicCollidingCloud.H"
|
||||||
#define basicKinematicTypeCloud basicKinematicCollidingCloud
|
#define kinematicTypeCloud kinematicCollidingCloud
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -88,7 +88,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
// Store the particle positions
|
// Store the particle positions
|
||||||
kinematicCloud.storeGlobalPositions();
|
kCloud.storeGlobalPositions();
|
||||||
|
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
@ -111,15 +111,15 @@ int main(int argc, char *argv[])
|
|||||||
continuousPhaseTransport.correct();
|
continuousPhaseTransport.correct();
|
||||||
muc = rhoc*continuousPhaseTransport.nu();
|
muc = rhoc*continuousPhaseTransport.nu();
|
||||||
|
|
||||||
kinematicCloud.evolve();
|
kCloud.evolve();
|
||||||
|
|
||||||
// Update continuous phase volume fraction field
|
// Update continuous phase volume fraction field
|
||||||
alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
|
alphac = max(1.0 - kCloud.theta(), alphacMin);
|
||||||
alphac.correctBoundaryConditions();
|
alphac.correctBoundaryConditions();
|
||||||
alphacf = fvc::interpolate(alphac);
|
alphacf = fvc::interpolate(alphac);
|
||||||
alphaPhic = alphacf*phic;
|
alphaPhic = alphacf*phic;
|
||||||
|
|
||||||
fvVectorMatrix cloudSU(kinematicCloud.SU(Uc));
|
fvVectorMatrix cloudSU(kCloud.SU(Uc));
|
||||||
volVectorField cloudVolSUSu
|
volVectorField cloudVolSUSu
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
|||||||
@ -12,6 +12,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
|
|||||||
@ -11,8 +11,11 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
|
||||||
|
|||||||
@ -43,11 +43,11 @@ Description
|
|||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
#ifdef MPPIC
|
#ifdef MPPIC
|
||||||
#include "basicKinematicCloud.H"
|
#include "kinematicCloud.H"
|
||||||
#define basicKinematicTypeCloud basicKinematicCloud
|
#define kinematicTypeCloud kinematicCloud
|
||||||
#else
|
#else
|
||||||
#include "basicKinematicCollidingCloud.H"
|
#include "kinematicCollidingCloud.H"
|
||||||
#define basicKinematicTypeCloud basicKinematicCollidingCloud
|
#define kinematicTypeCloud kinematicCollidingCloud
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -91,16 +91,16 @@ int main(int argc, char *argv[])
|
|||||||
continuousPhaseTransport.correct();
|
continuousPhaseTransport.correct();
|
||||||
muc = rhoc*continuousPhaseTransport.nu();
|
muc = rhoc*continuousPhaseTransport.nu();
|
||||||
|
|
||||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
Info<< "Evolving " << kCloud.name() << endl;
|
||||||
kinematicCloud.evolve();
|
kCloud.evolve();
|
||||||
|
|
||||||
// Update continuous phase volume fraction field
|
// Update continuous phase volume fraction field
|
||||||
alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
|
alphac = max(1.0 - kCloud.theta(), alphacMin);
|
||||||
alphac.correctBoundaryConditions();
|
alphac.correctBoundaryConditions();
|
||||||
alphacf = fvc::interpolate(alphac);
|
alphacf = fvc::interpolate(alphac);
|
||||||
alphaPhic = alphacf*phic;
|
alphaPhic = alphacf*phic;
|
||||||
|
|
||||||
fvVectorMatrix cloudSU(kinematicCloud.SU(Uc));
|
fvVectorMatrix cloudSU(kCloud.SU(Uc));
|
||||||
volVectorField cloudVolSUSu
|
volVectorField cloudVolSUSu
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
|||||||
@ -10,6 +10,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
|||||||
@ -10,8 +10,11 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
|
|||||||
@ -125,13 +125,13 @@ const word kinematicCloudName
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicTypeCloud kinematicCloud
|
kinematicTypeCloud kCloud
|
||||||
(
|
(
|
||||||
kinematicCloudName,
|
kinematicCloudName,
|
||||||
|
g,
|
||||||
rhoc,
|
rhoc,
|
||||||
Uc,
|
Uc,
|
||||||
muc,
|
muc
|
||||||
g
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Particle fraction upper limit
|
// Particle fraction upper limit
|
||||||
@ -139,13 +139,13 @@ scalar alphacMin
|
|||||||
(
|
(
|
||||||
1.0
|
1.0
|
||||||
- (
|
- (
|
||||||
kinematicCloud.particleProperties().subDict("constantProperties")
|
kCloud.particleProperties().subDict("constantProperties")
|
||||||
.get<scalar>("alphaMax")
|
.get<scalar>("alphaMax")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update alphac from the particle locations
|
// Update alphac from the particle locations
|
||||||
alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
|
alphac = max(1.0 - kCloud.theta(), alphacMin);
|
||||||
alphac.correctBoundaryConditions();
|
alphac.correctBoundaryConditions();
|
||||||
|
|
||||||
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
|
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
|
||||||
|
|||||||
@ -6,7 +6,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
@ -35,7 +34,6 @@ EXE_LIBS = \
|
|||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-lcoalCombustion\
|
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
|
|||||||
@ -37,8 +37,8 @@ Description
|
|||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "basicThermoCloud.H"
|
#include "thermoCloud.H"
|
||||||
#include "coalCloud.H"
|
#include "reactingMultiphaseCloud.H"
|
||||||
#include "psiReactionThermo.H"
|
#include "psiReactionThermo.H"
|
||||||
#include "CombustionModel.H"
|
#include "CombustionModel.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
Info<< "\nConstructing coal cloud" << endl;
|
Info<< "\nConstructing coal cloud" << endl;
|
||||||
coalCloud coalParcels
|
reactingMultiphaseCloud coalParcels
|
||||||
(
|
(
|
||||||
"coalCloud1",
|
"coalCloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "\nConstructing limestone cloud" << endl;
|
Info<< "\nConstructing limestone cloud" << endl;
|
||||||
basicThermoCloud limestoneParcels
|
thermoCloud limestoneParcels
|
||||||
(
|
(
|
||||||
"limestoneCloud1",
|
"limestoneCloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -9,6 +9,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
|
|||||||
@ -63,13 +63,13 @@ const word kinematicCloudName
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicCollidingCloud kinematicCloud
|
kinematicCollidingCloud kCloud
|
||||||
(
|
(
|
||||||
kinematicCloudName,
|
kinematicCloudName,
|
||||||
|
g,
|
||||||
rhoInf,
|
rhoInf,
|
||||||
U,
|
U,
|
||||||
mu,
|
mu
|
||||||
g
|
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject Hheader
|
IOobject Hheader
|
||||||
|
|||||||
@ -10,6 +10,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Description
|
|||||||
#include "dynamicFvMesh.H"
|
#include "dynamicFvMesh.H"
|
||||||
#include "singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "turbulentTransportModel.H"
|
#include "turbulentTransportModel.H"
|
||||||
#include "basicKinematicCollidingCloud.H"
|
#include "kinematicCollidingCloud.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -76,19 +76,19 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
kinematicCloud.storeGlobalPositions();
|
kCloud.storeGlobalPositions();
|
||||||
|
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
Info<< "Evolving " << kCloud.name() << endl;
|
||||||
|
|
||||||
laminarTransport.correct();
|
laminarTransport.correct();
|
||||||
|
|
||||||
mu = laminarTransport.nu()*rhoInfValue;
|
mu = laminarTransport.nu()*rhoInfValue;
|
||||||
|
|
||||||
kinematicCloud.evolve();
|
kCloud.evolve();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "turbulentTransportModel.H"
|
#include "turbulentTransportModel.H"
|
||||||
#include "basicKinematicCollidingCloud.H"
|
#include "kinematicCollidingCloud.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -75,13 +75,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
Info<< "Evolving " << kCloud.name() << endl;
|
||||||
|
|
||||||
laminarTransport.correct();
|
laminarTransport.correct();
|
||||||
|
|
||||||
mu = laminarTransport.nu()*rhoInfValue;
|
mu = laminarTransport.nu()*rhoInfValue;
|
||||||
|
|
||||||
kinematicCloud.evolve();
|
kCloud.evolve();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,12 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
+ MRF.DDt(U)
|
+ MRF.DDt(U)
|
||||||
+ turbulence->divDevReff(U)
|
+ turbulence->divDevReff(U)
|
||||||
==
|
==
|
||||||
parcels.SU(U, true)
|
scalar(1)/rhoInfValue*parcels.SU(U)
|
||||||
+ fvOptions(U)
|
+ fvOptions(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -4,13 +4,12 @@ const word kinematicCloudName
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
|
kinematicCloud parcels
|
||||||
basicKinematicCloud parcels
|
|
||||||
(
|
(
|
||||||
kinematicCloudName,
|
kinematicCloudName,
|
||||||
|
g,
|
||||||
rhoInf,
|
rhoInf,
|
||||||
U,
|
U,
|
||||||
muc,
|
muc
|
||||||
g
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Description
|
|||||||
#include "singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "turbulentTransportModel.H"
|
#include "turbulentTransportModel.H"
|
||||||
#include "surfaceFilmModel.H"
|
#include "surfaceFilmModel.H"
|
||||||
#include "basicKinematicCloud.H"
|
#include "kinematicCloud.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "CorrectPhi.H"
|
#include "CorrectPhi.H"
|
||||||
@ -67,7 +67,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
#include "createRegionControls.H"
|
|
||||||
#include "createUfIfPresent.H"
|
#include "createUfIfPresent.H"
|
||||||
|
|
||||||
turbulence->validate();
|
turbulence->validate();
|
||||||
@ -95,7 +94,7 @@ int main(int argc, char *argv[])
|
|||||||
// Do any mesh changes
|
// Do any mesh changes
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
if (solvePrimaryRegion && mesh.changing())
|
if (pimple.solveFlow() && mesh.changing())
|
||||||
{
|
{
|
||||||
MRF.update();
|
MRF.update();
|
||||||
|
|
||||||
@ -120,7 +119,7 @@ int main(int argc, char *argv[])
|
|||||||
parcels.evolve();
|
parcels.evolve();
|
||||||
surfaceFilm.evolve();
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
if (solvePrimaryRegion)
|
if (pimple.solveFlow())
|
||||||
{
|
{
|
||||||
// --- PIMPLE loop
|
// --- PIMPLE loop
|
||||||
while (pimple.loop())
|
while (pimple.loop())
|
||||||
|
|||||||
3
applications/solvers/lagrangian/parcelFoam/Make/files
Normal file
3
applications/solvers/lagrangian/parcelFoam/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
parcelFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/parcelFoam
|
||||||
@ -1,49 +1,48 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels/lnInclude \
|
-I$(LIB_SRC)/regionFaModels/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/faOptions/lnInclude \
|
||||||
-I$(LIB_SRC)/faOptions/lnInclude
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfvOptions \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
|
-lturbulenceModels \
|
||||||
|
-lincompressibleTurbulenceModels \
|
||||||
|
-lincompressibleTransportModels \
|
||||||
|
-ldynamicMesh \
|
||||||
|
-ldynamicFvMesh \
|
||||||
|
-ltopoChangerFvMesh \
|
||||||
|
-latmosphericModels \
|
||||||
|
-lregionModels \
|
||||||
|
-lsurfaceFilmModels \
|
||||||
|
-lsurfaceFilmDerivedFvPatchFields \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-ldistributionModels \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTransportModels \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lthermophysicalProperties \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lSLGThermo \
|
|
||||||
-lradiationModels \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lincompressibleTurbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-lincompressibleTransportModels \
|
|
||||||
-lregionModels \
|
|
||||||
-lsurfaceFilmModels \
|
|
||||||
-ldynamicMesh \
|
|
||||||
-ldynamicFvMesh \
|
|
||||||
-lregionFaModels \
|
-lregionFaModels \
|
||||||
-lfiniteArea
|
-lfiniteArea \
|
||||||
|
-lfaOptions
|
||||||
22
applications/solvers/lagrangian/parcelFoam/UEqn.H
Normal file
22
applications/solvers/lagrangian/parcelFoam/UEqn.H
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
MRF.correctBoundaryVelocity(U);
|
||||||
|
|
||||||
|
fvVectorMatrix UEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(U) + fvm::div(phi, U)
|
||||||
|
+ MRF.DDt(U)
|
||||||
|
+ turbulence->divDevReff(U)
|
||||||
|
==
|
||||||
|
scalar(1)/rhoInfValue*parcels.SU(U)
|
||||||
|
+ fvOptions(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
|
if (pimple.momentumPredictor())
|
||||||
|
{
|
||||||
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
|
||||||
|
fvOptions.correct(U);
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
auto parcels = parcelCloudModelList(g, rhoInf, U, muc);
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||||
85
applications/solvers/lagrangian/parcelFoam/createFields.H
Normal file
85
applications/solvers/lagrangian/parcelFoam/createFields.H
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
#include "readGravitationalAcceleration.H"
|
||||||
|
|
||||||
|
Info<< "Reading field p\n" << endl;
|
||||||
|
volScalarField p
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "\nReading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "createPhi.H"
|
||||||
|
|
||||||
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
|
dimensionedScalar rhoInfValue
|
||||||
|
(
|
||||||
|
"rhoInf",
|
||||||
|
dimDensity,
|
||||||
|
laminarTransport
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField rhoInf
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
rhoInfValue
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField muc
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"muc",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
rhoInf*laminarTransport.nu()
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<incompressible::turbulenceModel> turbulence
|
||||||
|
(
|
||||||
|
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||||
|
);
|
||||||
|
|
||||||
|
label pRefCell = 0;
|
||||||
|
scalar pRefValue = 0.0;
|
||||||
|
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
|
||||||
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
|
#include "createMRF.H"
|
||||||
|
#include "createClouds.H"
|
||||||
|
#include "createSurfaceFilmModel.H"
|
||||||
|
#include "createFvOptions.H"
|
||||||
|
|
||||||
|
|
||||||
58
applications/solvers/lagrangian/parcelFoam/pEqn.H
Normal file
58
applications/solvers/lagrangian/parcelFoam/pEqn.H
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
|
|
||||||
|
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
||||||
|
|
||||||
|
if (pimple.ddtCorr())
|
||||||
|
{
|
||||||
|
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
|
||||||
|
}
|
||||||
|
|
||||||
|
MRF.makeRelative(phiHbyA);
|
||||||
|
|
||||||
|
if (p.needReference())
|
||||||
|
{
|
||||||
|
fvc::makeRelative(phiHbyA, U);
|
||||||
|
adjustPhi(phiHbyA, U, p);
|
||||||
|
fvc::makeAbsolute(phiHbyA, U);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Update the pressure BCs to ensure flux consistency
|
||||||
|
constrainPressure(p, U, phiHbyA, rAU, MRF);
|
||||||
|
|
||||||
|
// Non-orthogonal pressure corrector loop
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvm::laplacian(rAU, p)
|
||||||
|
==
|
||||||
|
fvc::div(phiHbyA)
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
if (pimple.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi = phiHbyA - pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
|
|
||||||
|
// Correct rhoUf if the mesh is moving
|
||||||
|
fvc::correctUf(Uf, U, phi);
|
||||||
|
|
||||||
|
// Make the fluxes relative to the mesh motion
|
||||||
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
154
applications/solvers/lagrangian/parcelFoam/parcelFoam.C
Normal file
154
applications/solvers/lagrangian/parcelFoam/parcelFoam.C
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
parcelFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpLagrangianSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Transient solver for incompressible, turbulent flow with kinematic,
|
||||||
|
particle cloud, and surface film modelling.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "singlePhaseTransportModel.H"
|
||||||
|
#include "turbulentTransportModel.H"
|
||||||
|
#include "surfaceFilmModel.H"
|
||||||
|
#include "parcelCloudModelList.H"
|
||||||
|
#include "fvOptions.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
#include "CorrectPhi.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::addNote
|
||||||
|
(
|
||||||
|
"Transient solver for incompressible, turbulent flow"
|
||||||
|
" with kinematic particle clouds"
|
||||||
|
" and surface film modelling."
|
||||||
|
);
|
||||||
|
|
||||||
|
#define CREATE_MESH createMeshesPostProcess.H
|
||||||
|
#include "postProcess.H"
|
||||||
|
|
||||||
|
#include "addCheckCaseOptions.H"
|
||||||
|
#include "setRootCaseLists.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createDynamicFvMesh.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
#include "createDyMControls.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "createFieldRefs.H"
|
||||||
|
#include "createUfIfPresent.H"
|
||||||
|
|
||||||
|
turbulence->validate();
|
||||||
|
|
||||||
|
#include "CourantNo.H"
|
||||||
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
#include "readDyMControls.H"
|
||||||
|
#include "CourantNo.H"
|
||||||
|
#include "setMultiRegionDeltaT.H"
|
||||||
|
|
||||||
|
++runTime;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
// Store the particle positions
|
||||||
|
parcels.storeGlobalPositions();
|
||||||
|
|
||||||
|
// Do any mesh changes
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
|
if (pimple.solveFlow() && mesh.changing())
|
||||||
|
{
|
||||||
|
MRF.update();
|
||||||
|
|
||||||
|
if (correctPhi)
|
||||||
|
{
|
||||||
|
// Calculate absolute flux
|
||||||
|
// from the mapped surface velocity
|
||||||
|
phi = mesh.Sf() & Uf();
|
||||||
|
|
||||||
|
#include "../../incompressible/pimpleFoam/correctPhi.H"
|
||||||
|
|
||||||
|
// Make the fluxes relative to the mesh-motion
|
||||||
|
fvc::makeRelative(phi, U);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkMeshCourantNo)
|
||||||
|
{
|
||||||
|
#include "meshCourantNo.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parcels.evolve();
|
||||||
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
|
if (pimple.solveFlow())
|
||||||
|
{
|
||||||
|
// --- PIMPLE loop
|
||||||
|
while (pimple.loop())
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
|
||||||
|
// --- Pressure corrector loop
|
||||||
|
while (pimple.correct())
|
||||||
|
{
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pimple.turbCorr())
|
||||||
|
{
|
||||||
|
laminarTransport.correct();
|
||||||
|
turbulence->correct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
runTime.printExecutionTime(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "\nConstructing reacting cloud" << endl;
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
basicReactingTypeCloud parcels
|
reactingTypeCloud parcels
|
||||||
(
|
(
|
||||||
"reactingCloud1",
|
"reactingCloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -37,8 +37,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define CLOUD_BASE_TYPE HeterogeneousReacting
|
#define CLOUD_BASE_TYPE heterogeneousReacting
|
||||||
#define CLOUD_BASE_TYPE_NAME "HeterogeneousReacting"
|
#define CLOUD_BASE_TYPE_NAME "heterogeneousReacting"
|
||||||
|
|
||||||
#include "reactingParcelFoam.C"
|
#include "reactingParcelFoam.C"
|
||||||
|
|
||||||
|
|||||||
@ -53,12 +53,12 @@ Description
|
|||||||
#include "cloudMacros.H"
|
#include "cloudMacros.H"
|
||||||
|
|
||||||
#ifndef CLOUD_BASE_TYPE
|
#ifndef CLOUD_BASE_TYPE
|
||||||
#define CLOUD_BASE_TYPE ReactingMultiphase
|
#define CLOUD_BASE_TYPE reactingMultiphase
|
||||||
#define CLOUD_BASE_TYPE_NAME "reacting"
|
#define CLOUD_BASE_TYPE_NAME "reacting"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
|
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
|
||||||
#define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
|
#define reactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -81,7 +81,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
#include "createRegionControls.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createRhoUfIfPresent.H"
|
#include "createRhoUfIfPresent.H"
|
||||||
|
|
||||||
@ -105,7 +104,7 @@ int main(int argc, char *argv[])
|
|||||||
// so that it can be mapped and used in correctPhi
|
// so that it can be mapped and used in correctPhi
|
||||||
// to ensure the corrected phi has the same divergence
|
// to ensure the corrected phi has the same divergence
|
||||||
autoPtr<volScalarField> divrhoU;
|
autoPtr<volScalarField> divrhoU;
|
||||||
if (solvePrimaryRegion && correctPhi)
|
if (pimple.solveFlow() && correctPhi)
|
||||||
{
|
{
|
||||||
divrhoU.reset
|
divrhoU.reset
|
||||||
(
|
(
|
||||||
@ -133,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
autoPtr<volVectorField> rhoU;
|
autoPtr<volVectorField> rhoU;
|
||||||
if (solvePrimaryRegion && rhoUf.valid())
|
if (pimple.solveFlow() && rhoUf.valid())
|
||||||
{
|
{
|
||||||
rhoU.reset(new volVectorField("rhoU", rho*U));
|
rhoU.reset(new volVectorField("rhoU", rho*U));
|
||||||
}
|
}
|
||||||
@ -144,7 +143,7 @@ int main(int argc, char *argv[])
|
|||||||
// Do any mesh changes
|
// Do any mesh changes
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
if (solvePrimaryRegion && mesh.changing())
|
if (pimple.solveFlow() && mesh.changing())
|
||||||
{
|
{
|
||||||
gh = (g & mesh.C()) - ghRef;
|
gh = (g & mesh.C()) - ghRef;
|
||||||
ghf = (g & mesh.Cf()) - ghRef;
|
ghf = (g & mesh.Cf()) - ghRef;
|
||||||
@ -172,7 +171,7 @@ int main(int argc, char *argv[])
|
|||||||
parcels.evolve();
|
parcels.evolve();
|
||||||
surfaceFilm.evolve();
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
if (solvePrimaryRegion)
|
if (pimple.solveFlow())
|
||||||
{
|
{
|
||||||
if (pimple.nCorrPIMPLE() <= 1)
|
if (pimple.nCorrPIMPLE() <= 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,7 +7,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "\nConstructing " << CLOUD_BASE_TYPE_NAME << " cloud" << endl;
|
Info<< "\nConstructing " << CLOUD_BASE_TYPE_NAME << " cloud" << endl;
|
||||||
basicReactingTypeCloud parcels
|
reactingTypeCloud parcels
|
||||||
(
|
(
|
||||||
word(CLOUD_BASE_TYPE_NAME) & "Cloud1",
|
word(CLOUD_BASE_TYPE_NAME) & "Cloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -45,13 +45,13 @@ Description
|
|||||||
#include "cloudMacros.H"
|
#include "cloudMacros.H"
|
||||||
|
|
||||||
#ifndef CLOUD_BASE_TYPE
|
#ifndef CLOUD_BASE_TYPE
|
||||||
#define CLOUD_BASE_TYPE ReactingMultiphase
|
#define CLOUD_BASE_TYPE reactingMultiphase
|
||||||
//#define CLOUD_BASE_TYPE_NAME "reactingMultiphase" Backwards compat
|
//#define CLOUD_BASE_TYPE_NAME "reactingMultiphase" Backwards compat
|
||||||
#define CLOUD_BASE_TYPE_NAME "reacting"
|
#define CLOUD_BASE_TYPE_NAME "reacting"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
|
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
|
||||||
#define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
|
#define reactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
41
applications/solvers/lagrangian/rhoParcelFoam/EEqn.H
Normal file
41
applications/solvers/lagrangian/rhoParcelFoam/EEqn.H
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
volScalarField& he = thermo.he();
|
||||||
|
|
||||||
|
fvScalarMatrix EEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
|
||||||
|
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||||
|
+ (
|
||||||
|
he.name() == "e"
|
||||||
|
? fvc::div
|
||||||
|
(
|
||||||
|
fvc::absolute(phi/fvc::interpolate(rho), U),
|
||||||
|
p,
|
||||||
|
"div(phiv,p)"
|
||||||
|
)
|
||||||
|
: -dpdt
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||||
|
==
|
||||||
|
rho*(U&g)
|
||||||
|
+ parcels.Sh(he)
|
||||||
|
+ surfaceFilm.Sh()
|
||||||
|
+ radiation->Sh(thermo, he)
|
||||||
|
+ Qdot
|
||||||
|
+ fvOptions(rho, he)
|
||||||
|
);
|
||||||
|
|
||||||
|
EEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(EEqn);
|
||||||
|
|
||||||
|
EEqn.solve();
|
||||||
|
|
||||||
|
fvOptions.correct(he);
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
radiation->correct();
|
||||||
|
|
||||||
|
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||||
|
<< max(T).value() << endl;
|
||||||
|
}
|
||||||
3
applications/solvers/lagrangian/rhoParcelFoam/Make/files
Normal file
3
applications/solvers/lagrangian/rhoParcelFoam/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
rhoParcelFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/rhoParcelFoam
|
||||||
@ -1,52 +1,58 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I../reactingParcelFoam \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
|
-I${LIB_SRC}/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/turbulence/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionFaModels/lnInclude \
|
-I$(LIB_SRC)/regionFaModels/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
-I$(LIB_SRC)/faOptions/lnInclude \
|
||||||
-I$(LIB_SRC)/faOptions/lnInclude
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
|
-I$(LIB_SRC)/ODE/lnInclude \
|
||||||
|
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||||
|
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
||||||
|
|
||||||
LIB_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lsurfMesh \
|
-lfvOptions \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llagrangian \
|
-ldynamicMesh \
|
||||||
-llagrangianIntermediate \
|
-ldynamicFvMesh \
|
||||||
-llagrangianTurbulence \
|
-lsampling \
|
||||||
-ldistributionModels \
|
-lturbulenceModels \
|
||||||
|
-lcompressibleTurbulenceModels \
|
||||||
|
-lthermoTools \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lthermophysicalProperties \
|
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
|
-lthermophysicalProperties \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lradiationModels \
|
-lchemistryModel \
|
||||||
-lturbulenceModels \
|
|
||||||
-lincompressibleTurbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-lincompressibleTransportModels \
|
|
||||||
-lregionModels \
|
-lregionModels \
|
||||||
|
-lradiationModels \
|
||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-ldynamicMesh \
|
-lsurfaceFilmDerivedFvPatchFields \
|
||||||
-ldynamicFvMesh \
|
-llagrangian \
|
||||||
|
-llagrangianIntermediate \
|
||||||
|
-llagrangianTurbulence \
|
||||||
|
-lODE \
|
||||||
|
-lcombustionModels \
|
||||||
-lregionFaModels \
|
-lregionFaModels \
|
||||||
-lfiniteArea
|
-lfiniteArea \
|
||||||
|
-lfaOptions
|
||||||
34
applications/solvers/lagrangian/rhoParcelFoam/UEqn.H
Normal file
34
applications/solvers/lagrangian/rhoParcelFoam/UEqn.H
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
MRF.correctBoundaryVelocity(U);
|
||||||
|
|
||||||
|
fvVectorMatrix UEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||||
|
+ MRF.DDt(rho, U)
|
||||||
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
parcels.SU(U)
|
||||||
|
+ fvOptions(rho, U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
|
if (pimple.momentumPredictor())
|
||||||
|
{
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
UEqn
|
||||||
|
==
|
||||||
|
fvc::reconstruct
|
||||||
|
(
|
||||||
|
(
|
||||||
|
- ghf*fvc::snGrad(rho)
|
||||||
|
- fvc::snGrad(p_rgh)
|
||||||
|
)*mesh.magSf()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
fvOptions.correct(U);
|
||||||
|
K = 0.5*magSqr(U);
|
||||||
|
}
|
||||||
51
applications/solvers/lagrangian/rhoParcelFoam/YEqn.H
Normal file
51
applications/solvers/lagrangian/rhoParcelFoam/YEqn.H
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
tmp<fv::convectionScheme<scalar>> mvConvection
|
||||||
|
(
|
||||||
|
fv::convectionScheme<scalar>::New
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
fields,
|
||||||
|
phi,
|
||||||
|
mesh.divScheme("div(phi,Yi_h)")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
combustion->correct();
|
||||||
|
Qdot = combustion->Qdot();
|
||||||
|
volScalarField Yt(0.0*Y[0]);
|
||||||
|
|
||||||
|
forAll(Y, i)
|
||||||
|
{
|
||||||
|
if (i != inertIndex && composition.active(i))
|
||||||
|
{
|
||||||
|
volScalarField& Yi = Y[i];
|
||||||
|
|
||||||
|
fvScalarMatrix YEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, Yi)
|
||||||
|
+ mvConvection->fvmDiv(phi, Yi)
|
||||||
|
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||||
|
==
|
||||||
|
parcels.SYi(i, Yi)
|
||||||
|
+ fvOptions(rho, Yi)
|
||||||
|
+ combustion->R(Yi)
|
||||||
|
+ surfaceFilm.Srho(i)
|
||||||
|
);
|
||||||
|
|
||||||
|
YEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(YEqn);
|
||||||
|
|
||||||
|
YEqn.solve(mesh.solver("Yi"));
|
||||||
|
|
||||||
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
|
Yi.max(0.0);
|
||||||
|
Yt += Yi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
|
Y[inertIndex].max(0.0);
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
Info<< "\nConstructing cloud" << endl;
|
||||||
|
|
||||||
|
auto parcels = parcelCloudModelList(g, rho, U, slgThermo);
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
const volScalarField& T = thermo.T();
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
const label inertIndex(composition.species().find(inertSpecie));
|
||||||
|
|
||||||
|
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||||
132
applications/solvers/lagrangian/rhoParcelFoam/createFields.H
Normal file
132
applications/solvers/lagrangian/rhoParcelFoam/createFields.H
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||||
|
rhoReactionThermo& thermo = pThermo();
|
||||||
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
|
SLGThermo slgThermo(mesh, thermo);
|
||||||
|
|
||||||
|
basicSpecieMixture& composition = thermo.composition();
|
||||||
|
PtrList<volScalarField>& Y = composition.Y();
|
||||||
|
|
||||||
|
const word inertSpecie(thermo.get<word>("inertSpecie"));
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!composition.species().found(inertSpecie)
|
||||||
|
&& composition.species().size() > 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||||
|
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||||
|
<< composition.species()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Creating field rho\n" << endl;
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo.rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField& p = thermo.p();
|
||||||
|
|
||||||
|
Info<< "\nReading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Creating combustion model\n" << endl;
|
||||||
|
autoPtr<CombustionModel<rhoReactionThermo>> combustion
|
||||||
|
(
|
||||||
|
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "readGravitationalAcceleration.H"
|
||||||
|
#include "readhRef.H"
|
||||||
|
#include "gh.H"
|
||||||
|
|
||||||
|
|
||||||
|
volScalarField p_rgh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"p_rgh",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
// Force p_rgh to be consistent with p
|
||||||
|
p_rgh = p - rho*gh;
|
||||||
|
|
||||||
|
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||||
|
|
||||||
|
mesh.setFluxRequired(p_rgh.name());
|
||||||
|
|
||||||
|
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||||
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
|
forAll(Y, i)
|
||||||
|
{
|
||||||
|
fields.add(Y[i]);
|
||||||
|
}
|
||||||
|
fields.add(thermo.he());
|
||||||
|
|
||||||
|
volScalarField Qdot
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Qdot",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "createDpdt.H"
|
||||||
|
|
||||||
|
#include "createK.H"
|
||||||
|
|
||||||
|
#include "createMRF.H"
|
||||||
|
#include "createRadiationModel.H"
|
||||||
|
#include "createClouds.H"
|
||||||
|
#include "createSurfaceFilmModel.H"
|
||||||
|
#include "createFvOptions.H"
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
dictionary filmDict;
|
||||||
|
|
||||||
|
IOobject io
|
||||||
|
(
|
||||||
|
"surfaceFilmProperties",
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (io.typeHeaderOk<IOdictionary>())
|
||||||
|
{
|
||||||
|
IOdictionary propDict(io);
|
||||||
|
|
||||||
|
filmDict = std::move(propDict);
|
||||||
|
|
||||||
|
const word filmRegionName = filmDict.get<word>("region");
|
||||||
|
|
||||||
|
fvMesh filmMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
filmRegionName,
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
Info<< "\nConstructing surface film model" << endl;
|
||||||
|
|
||||||
|
autoPtr<regionModels::surfaceFilmModel> tsurfaceFilm
|
||||||
|
(
|
||||||
|
regionModels::surfaceFilmModel::New(mesh, g)
|
||||||
|
);
|
||||||
96
applications/solvers/lagrangian/rhoParcelFoam/pEqn.H
Normal file
96
applications/solvers/lagrangian/rhoParcelFoam/pEqn.H
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
if (!pimple.SIMPLErho())
|
||||||
|
{
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
|
// pressure solution
|
||||||
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
|
|
||||||
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
|
surfaceScalarField phiHbyA
|
||||||
|
(
|
||||||
|
"phiHbyA",
|
||||||
|
(
|
||||||
|
fvc::flux(rho*HbyA)
|
||||||
|
+ MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
|
||||||
|
)
|
||||||
|
+ phig
|
||||||
|
);
|
||||||
|
|
||||||
|
fvc::makeRelative(phiHbyA, rho, U);
|
||||||
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the pressure BCs to ensure flux consistency
|
||||||
|
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||||
|
|
||||||
|
fvScalarMatrix p_rghDDtEqn
|
||||||
|
(
|
||||||
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
|
+ fvc::div(phiHbyA)
|
||||||
|
==
|
||||||
|
parcels.Srho()
|
||||||
|
+ surfaceFilm.Srho()
|
||||||
|
+ fvOptions(psi, p_rgh, rho.name())
|
||||||
|
);
|
||||||
|
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix p_rghEqn
|
||||||
|
(
|
||||||
|
p_rghDDtEqn
|
||||||
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
|
);
|
||||||
|
|
||||||
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
if (pimple.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi = phiHbyA + p_rghEqn.flux();
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
|
p_rgh.relax();
|
||||||
|
|
||||||
|
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
|
K = 0.5*magSqr(U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p = p_rgh + rho*gh;
|
||||||
|
|
||||||
|
// Thermodynamic density update
|
||||||
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
|
||||||
|
#include "rhoEqn.H"
|
||||||
|
#include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
|
if (pressureControl.limit(p))
|
||||||
|
{
|
||||||
|
p.correctBoundaryConditions();
|
||||||
|
rho = thermo.rho();
|
||||||
|
p_rgh = p - rho*gh;
|
||||||
|
}
|
||||||
|
else if (pimple.SIMPLErho())
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
50
applications/solvers/lagrangian/rhoParcelFoam/rhoEqn.H
Normal file
50
applications/solvers/lagrangian/rhoParcelFoam/rhoEqn.H
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2017 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/>.
|
||||||
|
|
||||||
|
Global
|
||||||
|
rhoEqn
|
||||||
|
|
||||||
|
Description
|
||||||
|
Solve the continuity for density.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
{
|
||||||
|
fvScalarMatrix rhoEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho)
|
||||||
|
+ fvc::div(phi)
|
||||||
|
==
|
||||||
|
parcels.Srho(rho)
|
||||||
|
+ surfaceFilm.Srho()
|
||||||
|
+ fvOptions(rho)
|
||||||
|
);
|
||||||
|
|
||||||
|
rhoEqn.solve();
|
||||||
|
|
||||||
|
fvOptions.correct(rho);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
206
applications/solvers/lagrangian/rhoParcelFoam/rhoParcelFoam.C
Normal file
206
applications/solvers/lagrangian/rhoParcelFoam/rhoParcelFoam.C
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2018-2020 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
|
||||||
|
rhoParcelFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpLagrangianSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Transient solver for compressible, turbulent flow with a reacting,
|
||||||
|
multiphase particle cloud, and surface film modelling.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "turbulentFluidThermoModel.H"
|
||||||
|
#include "surfaceFilmModel.H"
|
||||||
|
#include "rhoReactionThermo.H"
|
||||||
|
#include "CombustionModel.H"
|
||||||
|
#include "radiationModel.H"
|
||||||
|
#include "SLGThermo.H"
|
||||||
|
#include "fvOptions.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
#include "pressureControl.H"
|
||||||
|
#include "CorrectPhi.H"
|
||||||
|
#include "localEulerDdtScheme.H"
|
||||||
|
#include "fvcSmooth.H"
|
||||||
|
|
||||||
|
#include "parcelCloudModelList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::addNote
|
||||||
|
(
|
||||||
|
"Transient solver for compressible, turbulent flow"
|
||||||
|
" with lagrangian parcel clouds and surface film modelling."
|
||||||
|
);
|
||||||
|
|
||||||
|
#define CREATE_MESH createMeshesPostProcess.H
|
||||||
|
#include "postProcess.H"
|
||||||
|
|
||||||
|
#include "addCheckCaseOptions.H"
|
||||||
|
#include "setRootCaseLists.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createDynamicFvMesh.H"
|
||||||
|
#include "createDyMControls.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "createFieldRefs.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
#include "createRhoUfIfPresent.H"
|
||||||
|
|
||||||
|
turbulence->validate();
|
||||||
|
|
||||||
|
if (!LTS)
|
||||||
|
{
|
||||||
|
#include "compressibleCourantNo.H"
|
||||||
|
#include "setInitialDeltaT.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
#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 (pimple.solveFlow() && correctPhi)
|
||||||
|
{
|
||||||
|
divrhoU.reset
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
"divrhoU",
|
||||||
|
fvc::div(fvc::absolute(phi, rho, U))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LTS)
|
||||||
|
{
|
||||||
|
#include "setRDeltaT.H"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#include "compressibleCourantNo.H"
|
||||||
|
#include "setMultiRegionDeltaT.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
++runTime;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (pimple.solveFlow() && rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU.reset(new volVectorField("rhoU", rho*U));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store the particle positions
|
||||||
|
parcels.storeGlobalPositions();
|
||||||
|
|
||||||
|
// Do any mesh changes
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
|
if (pimple.solveFlow() && 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 "../../compressible/rhoPimpleFoam/correctPhi.H"
|
||||||
|
|
||||||
|
// Make the fluxes relative to the mesh-motion
|
||||||
|
fvc::makeRelative(phi, rho, U);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkMeshCourantNo)
|
||||||
|
{
|
||||||
|
#include "meshCourantNo.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parcels.evolve();
|
||||||
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
|
if (pimple.solveFlow())
|
||||||
|
{
|
||||||
|
if (pimple.nCorrPIMPLE() <= 1)
|
||||||
|
{
|
||||||
|
#include "rhoEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- PIMPLE loop
|
||||||
|
while (pimple.loop())
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "YEqn.H"
|
||||||
|
#include "EEqn.H"
|
||||||
|
|
||||||
|
// --- Pressure corrector loop
|
||||||
|
while (pimple.correct())
|
||||||
|
{
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pimple.turbCorr())
|
||||||
|
{
|
||||||
|
turbulence->correct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
runTime.printExecutionTime(Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2017 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/>.
|
||||||
|
|
||||||
|
Global
|
||||||
|
setMultiRegionDeltaT
|
||||||
|
|
||||||
|
Description
|
||||||
|
Reset the timestep to maintain a constant maximum Courant numbers.
|
||||||
|
Reduction of time-step is immediate, but increase is damped to avoid
|
||||||
|
unstable oscillations.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
if (adjustTimeStep)
|
||||||
|
{
|
||||||
|
const scalar maxDeltaTFact =
|
||||||
|
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
|
||||||
|
const scalar deltaTFact =
|
||||||
|
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||||
|
|
||||||
|
runTime.setDeltaT
|
||||||
|
(
|
||||||
|
min
|
||||||
|
(
|
||||||
|
deltaTFact*runTime.deltaTValue(),
|
||||||
|
maxDeltaT
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
137
applications/solvers/lagrangian/rhoParcelFoam/setRDeltaT.H
Normal file
137
applications/solvers/lagrangian/rhoParcelFoam/setRDeltaT.H
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
{
|
||||||
|
volScalarField& rDeltaT = trDeltaT.ref();
|
||||||
|
|
||||||
|
const dictionary& pimpleDict = pimple.dict();
|
||||||
|
|
||||||
|
// Maximum flow Courant number
|
||||||
|
scalar maxCo(pimpleDict.get<scalar>("maxCo"));
|
||||||
|
|
||||||
|
// Maximum time scale
|
||||||
|
scalar maxDeltaT(pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT));
|
||||||
|
|
||||||
|
// Smoothing parameter (0-1) when smoothing iterations > 0
|
||||||
|
scalar rDeltaTSmoothingCoeff
|
||||||
|
(
|
||||||
|
pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Damping coefficient (1-0)
|
||||||
|
scalar rDeltaTDampingCoeff
|
||||||
|
(
|
||||||
|
pimpleDict.getOrDefault<scalar>("rDeltaTDampingCoeff", 0.2)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Maximum change in cell temperature per iteration
|
||||||
|
// (relative to previous value)
|
||||||
|
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Time scales min/max:" << endl;
|
||||||
|
|
||||||
|
// Cache old reciprocal time scale field
|
||||||
|
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
||||||
|
|
||||||
|
// Flow time scale
|
||||||
|
{
|
||||||
|
rDeltaT.ref() =
|
||||||
|
(
|
||||||
|
fvc::surfaceSum(mag(phi))()()
|
||||||
|
/((2*maxCo)*mesh.V()*rho())
|
||||||
|
);
|
||||||
|
|
||||||
|
// Limit the largest time scale
|
||||||
|
rDeltaT.max(1/maxDeltaT);
|
||||||
|
|
||||||
|
Info<< " Flow = "
|
||||||
|
<< gMin(1/rDeltaT.primitiveField()) << ", "
|
||||||
|
<< gMax(1/rDeltaT.primitiveField()) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reaction source time scale
|
||||||
|
{
|
||||||
|
volScalarField::Internal rDeltaTT
|
||||||
|
(
|
||||||
|
mag
|
||||||
|
(
|
||||||
|
parcels.hsTrans()/(mesh.V()*runTime.deltaT())
|
||||||
|
+ Qdot()
|
||||||
|
)
|
||||||
|
/(
|
||||||
|
alphaTemp
|
||||||
|
*rho()
|
||||||
|
*thermo.Cp()()()
|
||||||
|
*T()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Temperature = "
|
||||||
|
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
|
||||||
|
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
|
||||||
|
|
||||||
|
rDeltaT.ref() = max
|
||||||
|
(
|
||||||
|
rDeltaT(),
|
||||||
|
rDeltaTT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the boundary values of the reciprocal time-step
|
||||||
|
rDeltaT.correctBoundaryConditions();
|
||||||
|
|
||||||
|
// Spatially smooth the time scale field
|
||||||
|
if (rDeltaTSmoothingCoeff < 1.0)
|
||||||
|
{
|
||||||
|
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 = max
|
||||||
|
(
|
||||||
|
rDeltaT,
|
||||||
|
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< " Overall = "
|
||||||
|
<< gMin(1/rDeltaT.primitiveField())
|
||||||
|
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -7,7 +7,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
@ -47,7 +46,6 @@ EXE_LIBS = \
|
|||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-lcombustionModels \
|
-lcombustionModels \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lcoalCombustion \
|
|
||||||
-lregionFaModels \
|
-lregionFaModels \
|
||||||
-lfiniteArea \
|
-lfiniteArea \
|
||||||
-lfaOptions
|
-lfaOptions
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "\nConstructing coal cloud" << endl;
|
Info<< "\nConstructing coal cloud" << endl;
|
||||||
coalCloud parcels
|
reactingMultiphaseCloud parcels
|
||||||
(
|
(
|
||||||
"reactingCloud1",
|
"reactingCloud1",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "coalCloud.H"
|
#include "reactingMultiphaseCloud.H"
|
||||||
#include "rhoReactionThermo.H"
|
#include "rhoReactionThermo.H"
|
||||||
#include "CombustionModel.H"
|
#include "CombustionModel.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|||||||
@ -35,7 +35,6 @@ EXE_LIBS = \
|
|||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-llagrangianSpray \
|
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "\nConstructing reacting cloud" << endl;
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
basicSprayCloud parcels
|
sprayCloud parcels
|
||||||
(
|
(
|
||||||
"sprayCloud",
|
"sprayCloud",
|
||||||
|
g,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
g,
|
|
||||||
slgThermo
|
slgThermo
|
||||||
);
|
);
|
||||||
|
|||||||
@ -39,7 +39,6 @@ EXE_LIBS = \
|
|||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-llagrangianSpray \
|
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
#include "engineTime.H"
|
#include "engineTime.H"
|
||||||
#include "engineMesh.H"
|
#include "engineMesh.H"
|
||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "basicSprayCloud.H"
|
#include "sprayCloud.H"
|
||||||
#include "psiReactionThermo.H"
|
#include "psiReactionThermo.H"
|
||||||
#include "CombustionModel.H"
|
#include "CombustionModel.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|||||||
@ -34,7 +34,6 @@ EXE_LIBS = \
|
|||||||
-lthermoTools \
|
-lthermoTools \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianSpray \
|
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define CLOUD_BASE_TYPE Spray
|
#define CLOUD_BASE_TYPE spray
|
||||||
#define CLOUD_BASE_TYPE_NAME "spray"
|
#define CLOUD_BASE_TYPE_NAME "spray"
|
||||||
|
|
||||||
#include "simpleReactingParcelFoam.C"
|
#include "simpleReactingParcelFoam.C"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user