Compare commits
353 Commits
feature-ne
...
wip-develo
| Author | SHA1 | Date | |
|---|---|---|---|
| 622f476b32 | |||
| 7389ce15ce | |||
| f801e99f9e | |||
| 34e36b83ab | |||
| 1d81190881 | |||
| 25bc7d65f7 | |||
| 20566a87f5 | |||
| 06df44a588 | |||
| b519a8e128 | |||
| 26400d7534 | |||
| b17422ef1a | |||
| 42dba36832 | |||
| 063227baed | |||
| 7e9b5dbc78 | |||
| 94df19a93a | |||
| 2ef89bf9d3 | |||
| 074749a722 | |||
| 820f93c3b4 | |||
| 4dff2bfad1 | |||
| d5c0852de1 | |||
| 4284d02c99 | |||
| 82c0b360c6 | |||
| 99bf27cbee | |||
| d3867a2d34 | |||
| f75af788c1 | |||
| 790a5c26f9 | |||
| 9729617ae3 | |||
| afee861af9 | |||
| 72d2ff8249 | |||
| 0ab0ecb541 | |||
| 00f499d714 | |||
| 0fc2c817e1 | |||
| 117173aaba | |||
| b33b26ad34 | |||
| cdcbd05587 | |||
| 28b492bd54 | |||
| f0a196a908 | |||
| d51aa5a74d | |||
| e623e6a865 | |||
| d88272f031 | |||
| f3d447579a | |||
| 7246b49eac | |||
| 8a2cd2edfb | |||
| 9938a13b2a | |||
| 899d59686c | |||
| 0b7c0844f4 | |||
| d006339c9a | |||
| 74d65ed018 | |||
| 68bbd8f3a8 | |||
| 40bdab1c1a | |||
| f180740b03 | |||
| 1cc72ea7e3 | |||
| ba6667a344 | |||
| 4d45cfd5a9 | |||
| 128516b874 | |||
| 70d526cd82 | |||
| e1a710014c | |||
| ab10b4a05c | |||
| 6f68ce5239 | |||
| 3d8a6a5433 | |||
| 4d7180ae7c | |||
| a7d77391fa | |||
| 2569405383 | |||
| fb2bf77e8e | |||
| 446aff1350 | |||
| c9081d5daf | |||
| c038a9447c | |||
| fdd7e4d87f | |||
| 0767e21d8c | |||
| fe4688c27f | |||
| b71a05a72f | |||
| aef990f8df | |||
| cbb153372e | |||
| 58e4cfbc8a | |||
| a597c044c7 | |||
| d8c6b6b811 | |||
| 521bdf0f07 | |||
| f215ad15d1 | |||
| fb69a54bc3 | |||
| 1ce7a62209 | |||
| b6af124b80 | |||
| 83740ad408 | |||
| a16f09b10c | |||
| 702225c249 | |||
| 375a4792f9 | |||
| aafcd0b9e0 | |||
| 27a7ae2d1d | |||
| 35dae3fc3b | |||
| 2db3e2b64f | |||
| 1ab9dca2ab | |||
| 74fd94dff3 | |||
| 1dbb54c391 | |||
| d597b3f959 | |||
| 750381bd99 | |||
| ed39ee6afe | |||
| 422654a9ea | |||
| add61ca273 | |||
| 70d310329c | |||
| 4ec75d538f | |||
| df61104ef5 | |||
| 068ab8ccc7 | |||
| ab4c5f25ac | |||
| 173c9ac163 | |||
| 3e024d622b | |||
| d2ab9e9abf | |||
| e790e1c4ba | |||
| cc6ba5c1a0 | |||
| 26420a88d7 | |||
| ff13cdd39d | |||
| f713f74855 | |||
| 7c6232b8b3 | |||
| 56bf73d37d | |||
| c0e63a8de7 | |||
| 8b63f64503 | |||
| 1471d292bf | |||
| b93f038ea3 | |||
| a6b3a31b28 | |||
| 8ee7595a77 | |||
| 72bfaa2be9 | |||
| bebc6195a8 | |||
| c8a2d82094 | |||
| 39cabfca9c | |||
| 0190fed56b | |||
| c206b12c80 | |||
| 911c28f17d | |||
| 2faf361354 | |||
| 312037d4ea | |||
| 5672bb296f | |||
| ea2bedf073 | |||
| 988ec18ecc | |||
| eb8b51b475 | |||
| 7c60c80edd | |||
| c1cdacc0b4 | |||
| 0339e5ee0d | |||
| 07c69fdf0d | |||
| 94a79ef24f | |||
| 0c756cc676 | |||
| ba153df8db | |||
| 3888bfa17f | |||
| 8a70c898ae | |||
| 1f5a75c3c2 | |||
| ecaa55295b | |||
| a50d32b587 | |||
| 0fa129e83c | |||
| 03ab6c1a9d | |||
| e62b031f26 | |||
| 33f0ff8145 | |||
| 2641dc4c3a | |||
| b15638a2d2 | |||
| bf2f87f7e3 | |||
| bf99c104eb | |||
| bd0ad07d40 | |||
| 568ced68e2 | |||
| 2d4ecc4326 | |||
| 94a7945be3 | |||
| 06f479fbd4 | |||
| 35c5306544 | |||
| 166164da93 | |||
| 248e5ff86f | |||
| 33c9df7741 | |||
| 1f68e7f9b3 | |||
| e346620a62 | |||
| f08392010f | |||
| df808ad3f2 | |||
| 51ed7a6034 | |||
| 0031cb1efa | |||
| 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 | |||
| a4d235af6b | |||
| dffac4d887 |
@ -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=2301
|
||||||
patch=220907
|
patch=230110
|
||||||
|
|||||||
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"
|
||||||
|
|||||||
@ -1,125 +1,4 @@
|
|||||||
Info<< "Reading velocity field U\n" << endl;
|
#include "../createFields.H"
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
// Initialise the velocity internal field to zero
|
|
||||||
U = dimensionedVector(U.dimensions(), Zero);
|
|
||||||
|
|
||||||
surfaceScalarField phi
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phi",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
fvc::flux(U)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (args.found("initialiseUBCs"))
|
|
||||||
{
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
phi = fvc::flux(U);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Construct a pressure field
|
|
||||||
// If it is available read it otherwise construct from the velocity BCs
|
|
||||||
// converting fixed-value BCs to zero-gradient and vice versa.
|
|
||||||
|
|
||||||
// Allow override from command-line -pName option
|
|
||||||
const word pName = args.getOrDefault<word>("pName", "p");
|
|
||||||
|
|
||||||
// Infer the pressure BCs from the velocity
|
|
||||||
wordList pBCTypes
|
|
||||||
(
|
|
||||||
U.boundaryField().size(),
|
|
||||||
fixedValueFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(U.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
if (U.boundaryField()[patchi].fixesValue())
|
|
||||||
{
|
|
||||||
pBCTypes[patchi] = zeroGradientFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note that registerObject is false for the pressure field. The pressure
|
|
||||||
// field in this solver doesn't have a physical value during the solution.
|
|
||||||
// It shouldn't be looked up and used by sub models or boundary conditions.
|
|
||||||
Info<< "Constructing pressure field " << pName << nl << endl;
|
|
||||||
volScalarField p
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
pName,
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(sqr(dimVelocity), Zero),
|
|
||||||
pBCTypes
|
|
||||||
);
|
|
||||||
|
|
||||||
// Infer the velocity potential BCs from the pressure
|
|
||||||
wordList PhiBCTypes
|
|
||||||
(
|
|
||||||
p.boundaryField().size(),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(p.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
if (p.boundaryField()[patchi].fixesValue())
|
|
||||||
{
|
|
||||||
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Constructing velocity potential field Phi\n" << endl;
|
|
||||||
volScalarField Phi
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Phi",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimLength*dimVelocity, Zero),
|
|
||||||
PhiBCTypes
|
|
||||||
);
|
|
||||||
|
|
||||||
label PhiRefCell = 0;
|
|
||||||
scalar PhiRefValue = 0;
|
|
||||||
setRefCell
|
|
||||||
(
|
|
||||||
Phi,
|
|
||||||
potentialFlow.dict(),
|
|
||||||
PhiRefCell,
|
|
||||||
PhiRefValue
|
|
||||||
);
|
|
||||||
mesh.setFluxRequired(Phi.name());
|
|
||||||
|
|
||||||
#include "createMRF.H"
|
|
||||||
|
|
||||||
// Add solver-specific interpolations
|
// Add solver-specific interpolations
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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.
|
||||||
@ -83,6 +83,7 @@ Description
|
|||||||
\heading Options
|
\heading Options
|
||||||
\plaintable
|
\plaintable
|
||||||
-writep | write the Euler pressure
|
-writep | write the Euler pressure
|
||||||
|
-writephi | Write the final volumetric flux
|
||||||
-writePhi | Write the final velocity potential
|
-writePhi | Write the final velocity potential
|
||||||
-initialiseUBCs | Update the velocity boundaries before solving for Phi
|
-initialiseUBCs | Update the velocity boundaries before solving for Phi
|
||||||
\endplaintable
|
\endplaintable
|
||||||
@ -117,6 +118,12 @@ int main(int argc, char *argv[])
|
|||||||
"Initialise U boundary conditions"
|
"Initialise U boundary conditions"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"writephi",
|
||||||
|
"Write the final volumetric flux field"
|
||||||
|
);
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"writePhi",
|
"writePhi",
|
||||||
@ -135,6 +142,8 @@ int main(int argc, char *argv[])
|
|||||||
"Execute functionObjects"
|
"Execute functionObjects"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#include "addRegionOption.H"
|
||||||
|
#include "addCheckCaseOptions.H"
|
||||||
#include "setRootCaseLists.H"
|
#include "setRootCaseLists.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createNamedDynamicFvMesh.H"
|
#include "createNamedDynamicFvMesh.H"
|
||||||
@ -149,7 +158,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
|
||||||
@ -195,11 +203,16 @@ int main(int argc, char *argv[])
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write U and phi
|
// Write U
|
||||||
U.write();
|
U.write();
|
||||||
phi.write();
|
|
||||||
|
|
||||||
// Optionally write Phi
|
// Optionally write the volumetric flux, phi
|
||||||
|
if (args.found("writephi"))
|
||||||
|
{
|
||||||
|
phi.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optionally write velocity potential, Phi
|
||||||
if (args.found("writePhi"))
|
if (args.found("writePhi"))
|
||||||
{
|
{
|
||||||
Phi.write();
|
Phi.write();
|
||||||
|
|||||||
@ -109,7 +109,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar(Nv.dimensions(), Zero)
|
dimensionedScalar(Nv.dimensions(), Zero)
|
||||||
|
|||||||
@ -171,10 +171,7 @@ if (ign.ignited())
|
|||||||
|
|
||||||
fvOptions.correct(Su);
|
fvOptions.correct(Su);
|
||||||
|
|
||||||
// Limit the maximum Su
|
Su.clamp_range(SuMin, SuMax);
|
||||||
// ~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Su.min(SuMax);
|
|
||||||
Su.max(SuMin);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -218,7 +215,7 @@ if (ign.ignited())
|
|||||||
+ (
|
+ (
|
||||||
scalar(1)
|
scalar(1)
|
||||||
+ (2*XiShapeCoef)
|
+ (2*XiShapeCoef)
|
||||||
*(scalar(0.5) - min(max(b, scalar(0)), scalar(1)))
|
*(scalar(0.5) - clamp(b, zero_one{}))
|
||||||
)*(XiEqStar - scalar(1.001))
|
)*(XiEqStar - scalar(1.001))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("Ydefault", dimless, 1)
|
dimensionedScalar("Ydefault", dimless, 1)
|
||||||
@ -29,7 +29,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("p", dimPressure, p0)
|
dimensionedScalar("p", dimPressure, p0)
|
||||||
@ -46,7 +46,7 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("T", dimTemperature, T0)
|
dimensionedScalar("T", dimTemperature, T0)
|
||||||
|
|||||||
@ -39,13 +39,13 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
|
|
||||||
radiation->correct();
|
radiation->correct();
|
||||||
|
|
||||||
|
|||||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,14 +103,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("value"))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
|
||||||
fvPatchField<scalar>::operator=
|
|
||||||
(
|
|
||||||
scalarField("value", dict, p.size())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
fvPatchField<scalar>::operator=(patchInternalField());
|
||||||
}
|
}
|
||||||
@ -165,14 +158,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchScalarField& pmu =
|
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||||
const fvPatchScalarField& prho =
|
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
const auto& pU = patch().lookupPatchField<volVectorField>(UName_);
|
||||||
const fvPatchField<scalar>& ppsi =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
|
||||||
const fvPatchVectorField& pU =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
|
||||||
|
|
||||||
// Prandtl number reading consistent with rhoCentralFoam
|
// Prandtl number reading consistent with rhoCentralFoam
|
||||||
const dictionary& thermophysicalProperties =
|
const dictionary& thermophysicalProperties =
|
||||||
@ -207,7 +196,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
|||||||
// Write
|
// Write
|
||||||
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
|
|
||||||
os.writeEntryIfDifferent<word>("U", "U", UName_);
|
os.writeEntryIfDifferent<word>("U", "U", UName_);
|
||||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
@ -217,7 +206,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
|||||||
os.writeEntry("accommodationCoeff", accommodationCoeff_);
|
os.writeEntry("accommodationCoeff", accommodationCoeff_);
|
||||||
Twall_.writeEntry("Twall", os);
|
Twall_.writeEntry("Twall", os);
|
||||||
os.writeEntry("gamma", gamma_);
|
os.writeEntry("gamma", gamma_);
|
||||||
writeEntry("value", os);
|
fvPatchField<scalar>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -105,18 +105,15 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("value"))
|
if (this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<vector>::operator=
|
const auto* hasRefValue = dict.findEntry("refValue", keyType::LITERAL);
|
||||||
(
|
const auto* hasFrac = dict.findEntry("valueFraction", keyType::LITERAL);
|
||||||
vectorField("value", dict, p.size())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (dict.found("refValue") && dict.found("valueFraction"))
|
if (hasRefValue && hasFrac)
|
||||||
{
|
{
|
||||||
this->refValue() = vectorField("refValue", dict, p.size());
|
this->refValue().assign(*hasRefValue, p.size());
|
||||||
this->valueFraction() =
|
this->valueFraction().assign(*hasFrac, p.size());
|
||||||
scalarField("valueFraction", dict, p.size());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -155,12 +152,9 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchScalarField& pmu =
|
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||||
const fvPatchScalarField& prho =
|
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
const fvPatchField<scalar>& ppsi =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
|
||||||
|
|
||||||
Field<scalar> C1
|
Field<scalar> C1
|
||||||
(
|
(
|
||||||
@ -187,8 +181,8 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
if (curvature_)
|
if (curvature_)
|
||||||
{
|
{
|
||||||
const fvPatchTensorField& ptauMC =
|
const auto& ptauMC =
|
||||||
patch().lookupPatchField<volTensorField, tensor>(tauMCName_);
|
patch().lookupPatchField<volTensorField>(tauMCName_);
|
||||||
vectorField n(patch().nf());
|
vectorField n(patch().nf());
|
||||||
|
|
||||||
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
||||||
@ -200,7 +194,7 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchField<vector>::write(os);
|
||||||
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
||||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||||
@ -215,7 +209,7 @@ void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
|||||||
refValue().writeEntry("refValue", os);
|
refValue().writeEntry("refValue", os);
|
||||||
valueFraction().writeEntry("valueFraction", os);
|
valueFraction().writeEntry("valueFraction", os);
|
||||||
|
|
||||||
writeEntry("value", os);
|
fvPatchField<vector>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -104,11 +104,8 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchField<scalar>& psip =
|
const auto& psip = patch().lookupPatchField<volScalarField>(psiName_);
|
||||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||||
|
|
||||||
const fvPatchField<scalar>& pp =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
|
||||||
|
|
||||||
operator==(psip*pp);
|
operator==(psip*pp);
|
||||||
|
|
||||||
@ -118,11 +115,10 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
|
void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
|
|
||||||
os.writeEntryIfDifferent<word>("p", "p", pName_);
|
os.writeEntryIfDifferent<word>("p", "p", pName_);
|
||||||
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||||
writeEntry("value", os);
|
fvPatchField<scalar>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -9,7 +9,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -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);
|
|
||||||
@ -7,7 +7,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -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
|
||||||
(
|
(
|
||||||
|
|||||||
@ -10,7 +10,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -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);
|
|
||||||
@ -7,7 +7,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -19,7 +19,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,26 +88,29 @@ kappa
|
|||||||
|
|
||||||
case mtLookup:
|
case mtLookup:
|
||||||
{
|
{
|
||||||
if (mesh.foundObject<volScalarField>(kappaName_))
|
|
||||||
{
|
{
|
||||||
return patch().lookupPatchField<volScalarField, scalar>
|
const auto* ptr =
|
||||||
(
|
mesh.cfindObject<volScalarField>(kappaName_);
|
||||||
kappaName_
|
|
||||||
);
|
if (ptr)
|
||||||
|
{
|
||||||
|
return patch().patchField(*ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (mesh.foundObject<volSymmTensorField>(kappaName_))
|
|
||||||
{
|
{
|
||||||
const symmTensorField& KWall =
|
const auto* ptr =
|
||||||
patch().lookupPatchField<volSymmTensorField, scalar>
|
mesh.cfindObject<volSymmTensorField>(kappaName_);
|
||||||
(
|
|
||||||
kappaName_
|
|
||||||
);
|
|
||||||
|
|
||||||
const vectorField n(patch().nf());
|
if (ptr)
|
||||||
|
{
|
||||||
|
const symmTensorField& KWall = patch().patchField(*ptr);
|
||||||
|
|
||||||
return n & KWall & n;
|
const vectorField n(patch().nf());
|
||||||
|
|
||||||
|
return n & KWall & n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Did not find field " << kappaName_
|
<< "Did not find field " << kappaName_
|
||||||
@ -117,9 +120,6 @@ kappa
|
|||||||
<< " or volSymmTensorField."
|
<< " or volSymmTensorField."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,10 +131,8 @@ kappa
|
|||||||
mesh.lookupObject<phaseSystem>("phaseProperties")
|
mesh.lookupObject<phaseSystem>("phaseProperties")
|
||||||
);
|
);
|
||||||
|
|
||||||
tmp<scalarField> kappaEff
|
auto tkappaEff = tmp<scalarField>::New(patch().size(), Zero);
|
||||||
(
|
auto& kappaEff = tkappaEff.ref();
|
||||||
new scalarField(patch().size(), 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(fluid.phases(), phasei)
|
forAll(fluid.phases(), phasei)
|
||||||
{
|
{
|
||||||
@ -142,10 +140,10 @@ kappa
|
|||||||
|
|
||||||
const fvPatchScalarField& alpha = phase.boundaryField()[patchi];
|
const fvPatchScalarField& alpha = phase.boundaryField()[patchi];
|
||||||
|
|
||||||
kappaEff.ref() += alpha*phase.kappaEff(patchi)();
|
kappaEff += alpha*phase.kappaEff(patchi)();
|
||||||
}
|
}
|
||||||
|
|
||||||
return kappaEff;
|
return tkappaEff;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -161,9 +159,11 @@ kappa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scalarField(0);
|
// Return zero-sized (not nullptr)
|
||||||
|
return tmp<scalarField>::New();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
@ -243,14 +243,12 @@ turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
|
||||||
|
|
||||||
if (dict.found("refValue"))
|
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||||
|
|
||||||
|
if (this->readMixedEntries(dict))
|
||||||
{
|
{
|
||||||
// Full restart
|
// Full restart
|
||||||
refValue() = scalarField("refValue", dict, p.size());
|
|
||||||
refGrad() = scalarField("refGradient", dict, p.size());
|
|
||||||
valueFraction() = scalarField("valueFraction", dict, p.size());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -308,12 +306,11 @@ updateCoeffs()
|
|||||||
|
|
||||||
scalarField& Tp = *this;
|
scalarField& Tp = *this;
|
||||||
|
|
||||||
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&
|
const auto& nbrField =
|
||||||
nbrField = refCast
|
refCast
|
||||||
<const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField>
|
<
|
||||||
(
|
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
|
||||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
>(nbrPatch.lookupPatchField<volScalarField>(TnbrName_));
|
||||||
);
|
|
||||||
|
|
||||||
// Swap to obtain full local values of neighbour internal field
|
// Swap to obtain full local values of neighbour internal field
|
||||||
scalarField TcNbr(nbrField.patchInternalField());
|
scalarField TcNbr(nbrField.patchInternalField());
|
||||||
@ -330,13 +327,13 @@ updateCoeffs()
|
|||||||
scalarField qr(Tp.size(), 0.0);
|
scalarField qr(Tp.size(), 0.0);
|
||||||
if (qrName_ != "none")
|
if (qrName_ != "none")
|
||||||
{
|
{
|
||||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField qrNbr(Tp.size(), 0.0);
|
scalarField qrNbr(Tp.size(), 0.0);
|
||||||
if (qrNbrName_ != "none")
|
if (qrNbrName_ != "none")
|
||||||
{
|
{
|
||||||
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
qrNbr = nbrPatch.lookupPatchField<volScalarField>(qrNbrName_);
|
||||||
mpp.distribute(qrNbr);
|
mpp.distribute(qrNbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,7 +483,7 @@ void turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::write
|
|||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mixedFvPatchScalarField::write(os);
|
mixedFvPatchField<scalar>::write(os);
|
||||||
os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
|
os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
|
||||||
os.writeEntryIfDifferent<word>("kappa","none", kappaName_);
|
os.writeEntryIfDifferent<word>("kappa","none", kappaName_);
|
||||||
|
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if (Y.size())
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,6 +56,6 @@ if (Y.size())
|
|||||||
if (Y.size())
|
if (Y.size())
|
||||||
{
|
{
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -44,7 +44,7 @@ IOobject turbulencePropertiesHeader
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
);
|
);
|
||||||
|
|
||||||
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
||||||
|
|||||||
@ -89,17 +89,10 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phip =
|
const auto& phip = patch().lookupPatchField<surfaceScalarField>("phi");
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
|
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||||
|
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||||
const fvsPatchField<scalar>& phiap =
|
const auto& Uap = patch().lookupPatchField<volVectorField>("Ua");
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
|
||||||
|
|
||||||
const fvPatchField<vector>& Up =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>("U");
|
|
||||||
|
|
||||||
const fvPatchField<vector>& Uap =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>("Ua");
|
|
||||||
|
|
||||||
operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));
|
operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));
|
||||||
|
|
||||||
@ -109,8 +102,8 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
|
void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
writeEntry("value", os);
|
fvPatchField<scalar>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,11 +90,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phiap =
|
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||||
|
|
||||||
const fvPatchField<vector>& Up =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>("U");
|
|
||||||
|
|
||||||
scalarField Un(mag(patch().nf() & Up));
|
scalarField Un(mag(patch().nf() & Up));
|
||||||
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));
|
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));
|
||||||
@ -110,8 +107,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
|
void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchField<vector>::write(os);
|
||||||
writeEntry("value", os);
|
fvPatchField<vector>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
-I$(LIB_SRC)/regionFaModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -94,7 +94,7 @@ if (mesh.changing())
|
|||||||
{
|
{
|
||||||
if (refCells[zoneId] != -1)
|
if (refCells[zoneId] != -1)
|
||||||
{
|
{
|
||||||
validCells.append(refCells[zoneId]);
|
validCells.push_back(refCells[zoneId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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));
|
||||||
|
|||||||
@ -40,11 +40,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,11 +41,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ IOobject io
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
);
|
);
|
||||||
|
|
||||||
if (io.typeHeaderOk<IOdictionary>())
|
if (io.typeHeaderOk<IOdictionary>())
|
||||||
@ -32,4 +32,4 @@ if (io.typeHeaderOk<IOdictionary>())
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,11 +38,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||||||
|
|
||||||
fvOptions.correct(Yi);
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.clamp_min(0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].clamp_min(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
{
|
{
|
||||||
alphav =
|
alphav = clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});
|
||||||
max
|
|
||||||
(
|
|
||||||
min
|
|
||||||
(
|
|
||||||
(rho - rholSat)/(rhovSat - rholSat),
|
|
||||||
scalar(1)
|
|
||||||
),
|
|
||||||
scalar(0)
|
|
||||||
);
|
|
||||||
alphal = 1.0 - alphav;
|
alphal = 1.0 - alphav;
|
||||||
|
|
||||||
Info<< "max-min alphav: " << max(alphav).value()
|
Info<< "max-min alphav: " << max(alphav).value()
|
||||||
|
|||||||
@ -129,10 +129,5 @@ compressibleInterPhaseTransportModel turbulence
|
|||||||
// Mask field for zeroing out contributions on hole cells
|
// Mask field for zeroing out contributions on hole cells
|
||||||
#include "createCellMask.H"
|
#include "createCellMask.H"
|
||||||
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create bool field with interpolated cells
|
// Create bool field with interpolated cells
|
||||||
#include "createInterpolatedCells.H"
|
#include "createInterpolatedCells.H"
|
||||||
|
|||||||
@ -80,9 +80,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCaseLists.H"
|
#include "setRootCaseLists.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
#include "createTimeControls.H"
|
|
||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
|
|
||||||
@ -109,7 +106,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
#include "readDyMControls.H"
|
||||||
|
|
||||||
if (LTS)
|
if (LTS)
|
||||||
{
|
{
|
||||||
@ -154,40 +151,10 @@ int main(int argc, char *argv[])
|
|||||||
// Update cellMask field for blocking out hole cells
|
// Update cellMask field for blocking out hole cells
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
#include "setInterpolatedCells.H"
|
#include "setInterpolatedCells.H"
|
||||||
|
#include "correctPhiFaceMask.H"
|
||||||
faceMask =
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime());
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
|
||||||
Uf *= faceMask;
|
|
||||||
|
|
||||||
const surfaceVectorField Uint(fvc::interpolate(U));
|
|
||||||
// Update Uf and phi on new C-I faces
|
|
||||||
Uf += (1-faceMask)*Uint;
|
|
||||||
|
|
||||||
// Update Uf boundary
|
|
||||||
forAll(Uf.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
Uf.boundaryFieldRef()[patchI] =
|
|
||||||
Uint.boundaryField()[patchI];
|
|
||||||
}
|
|
||||||
|
|
||||||
phi = mesh.Sf() & Uf;
|
|
||||||
|
|
||||||
// Correct phi on individual regions
|
|
||||||
if (correctPhi)
|
|
||||||
{
|
|
||||||
#include "correctPhi.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
mixture.correct();
|
mixture.correct();
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
|
|
||||||
|
|
||||||
phi *= faceMask;
|
|
||||||
U *= cellMask;
|
|
||||||
|
|
||||||
// Make the flux relative to the mesh motion
|
// Make the flux relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
@ -202,10 +169,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "alphaControls.H"
|
#include "alphaControls.H"
|
||||||
#include "compressibleAlphaEqnSubCycle.H"
|
#include "compressibleAlphaEqnSubCycle.H"
|
||||||
|
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
rhoPhi *= faceMask;
|
rhoPhi *= faceMask;
|
||||||
|
|
||||||
turbulence.correctPhasePhi();
|
turbulence.correctPhasePhi();
|
||||||
|
|||||||
@ -10,19 +10,6 @@
|
|||||||
fvc::flux(HbyA)
|
fvc::flux(HbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ddtCorr)
|
|
||||||
{
|
|
||||||
surfaceScalarField faceMaskOld
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
phiHbyA +=
|
|
||||||
MRF.zeroFilter
|
|
||||||
(
|
|
||||||
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
MRF.makeRelative(phiHbyA);
|
MRF.makeRelative(phiHbyA);
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
|
|||||||
@ -84,7 +84,7 @@ Foam::surfaceTensionModels::liquidProperties::sigma() const
|
|||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimSigma
|
dimSigma
|
||||||
|
|||||||
@ -126,9 +126,9 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
|
|
||||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
os.writeEntry("thetaProperties", thetaProps_);
|
os.writeEntry("thetaProperties", thetaProps_);
|
||||||
writeEntry("value", os);
|
fvPatchField<scalar>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -779,7 +779,7 @@ Foam::multiphaseMixtureThermo::surfaceTensionForce() const
|
|||||||
|
|
||||||
auto sigma = sigmas_.cfind(interfacePair(alpha1, alpha2));
|
auto sigma = sigmas_.cfind(interfacePair(alpha1, alpha2));
|
||||||
|
|
||||||
if (!sigma.found())
|
if (!sigma.good())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||||
@ -907,7 +907,7 @@ void Foam::multiphaseMixtureThermo::correctContactAngle
|
|||||||
const auto tp =
|
const auto tp =
|
||||||
acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
||||||
|
|
||||||
if (!tp.found())
|
if (!tp.good())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||||
|
|||||||
@ -724,7 +724,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::laserDTRM::Rp() const
|
|||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimPower/dimVolume/pow4(dimTemperature), Zero)
|
dimensionedScalar(dimPower/dimVolume/pow4(dimTemperature), Zero)
|
||||||
|
|||||||
@ -97,7 +97,7 @@ Foam::radiation::localDensityAbsorptionEmission::aCont(const label bandI) const
|
|||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(inv(dimLength), Zero)
|
dimensionedScalar(inv(dimLength), Zero)
|
||||||
@ -130,7 +130,7 @@ Foam::radiation::localDensityAbsorptionEmission::eCont(const label bandI) const
|
|||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(inv(dimLength), Zero)
|
dimensionedScalar(inv(dimLength), Zero)
|
||||||
@ -163,7 +163,7 @@ Foam::radiation::localDensityAbsorptionEmission::ECont(const label bandI) const
|
|||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||||
|
|||||||
@ -99,17 +99,6 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDotAlphal() const
|
|||||||
Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
||||||
Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
|
Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
|
||||||
{
|
{
|
||||||
|
|
||||||
volScalarField limitedAlpha1
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha1(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField limitedAlpha2
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha2(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
|
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
|
||||||
|
|
||||||
const twoPhaseMixtureEThermo& thermo =
|
const twoPhaseMixtureEThermo& thermo =
|
||||||
@ -124,11 +113,15 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
|
|||||||
|
|
||||||
volScalarField mDotE
|
volScalarField mDotE
|
||||||
(
|
(
|
||||||
"mDotE", coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
|
"mDotE",
|
||||||
|
coeffE_*mixture_.rho1()*clamp(mixture_.alpha1(), zero_one{})
|
||||||
|
* max(T - TSat, T0)
|
||||||
);
|
);
|
||||||
volScalarField mDotC
|
volScalarField mDotC
|
||||||
(
|
(
|
||||||
"mDotC", coeffC_*mixture_.rho2()*limitedAlpha2*max(TSat - T, T0)
|
"mDotC",
|
||||||
|
coeffC_*mixture_.rho2()*clamp(mixture_.alpha2(), zero_one{})
|
||||||
|
* max(TSat - T, T0)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh_.time().outputTime())
|
if (mesh_.time().outputTime())
|
||||||
@ -148,16 +141,6 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
|
|||||||
Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
||||||
Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDotDeltaT() const
|
Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDotDeltaT() const
|
||||||
{
|
{
|
||||||
volScalarField limitedAlpha1
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha1(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField limitedAlpha2
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha2(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
|
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
|
||||||
|
|
||||||
const twoPhaseMixtureEThermo& thermo =
|
const twoPhaseMixtureEThermo& thermo =
|
||||||
@ -170,8 +153,14 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDotDeltaT() const
|
|||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
coeffC_*mixture_.rho2()*limitedAlpha2*pos(TSat - T),
|
(
|
||||||
coeffE_*mixture_.rho1()*limitedAlpha1*pos(T - TSat)
|
coeffC_*mixture_.rho2()*clamp(mixture_.alpha2(), zero_one{})
|
||||||
|
* pos(TSat - T)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coeffE_*mixture_.rho1()*clamp(mixture_.alpha1(), zero_one{})
|
||||||
|
* pos(T - TSat)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,25 +190,17 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::TSource() const
|
|||||||
|
|
||||||
const dimensionedScalar& TSat = thermo.TSat();
|
const dimensionedScalar& TSat = thermo.TSat();
|
||||||
|
|
||||||
dimensionedScalar L = mixture_.Hf2() - mixture_.Hf1();
|
const dimensionedScalar L = mixture_.Hf2() - mixture_.Hf1();
|
||||||
|
|
||||||
volScalarField limitedAlpha1
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha1(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField limitedAlpha2
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha2(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField Vcoeff
|
const volScalarField Vcoeff
|
||||||
(
|
(
|
||||||
coeffE_*mixture_.rho1()*limitedAlpha1*L*pos(T - TSat)
|
coeffE_*mixture_.rho1()*clamp(mixture_.alpha1(), zero_one{})
|
||||||
|
* L*pos(T - TSat)
|
||||||
);
|
);
|
||||||
const volScalarField Ccoeff
|
const volScalarField Ccoeff
|
||||||
(
|
(
|
||||||
coeffC_*mixture_.rho2()*limitedAlpha2*L*pos(TSat - T)
|
coeffC_*mixture_.rho2()*clamp(mixture_.alpha2(), zero_one{})
|
||||||
|
* L*pos(TSat - T)
|
||||||
);
|
);
|
||||||
|
|
||||||
TSource =
|
TSource =
|
||||||
|
|||||||
@ -167,20 +167,10 @@ Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
|||||||
Foam::temperaturePhaseChangeTwoPhaseMixtures::interfaceHeatResistance::
|
Foam::temperaturePhaseChangeTwoPhaseMixtures::interfaceHeatResistance::
|
||||||
mDotAlphal() const
|
mDotAlphal() const
|
||||||
{
|
{
|
||||||
volScalarField limitedAlpha1
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha1(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField limitedAlpha2
|
|
||||||
(
|
|
||||||
min(max(mixture_.alpha2(), scalar(0)), scalar(1))
|
|
||||||
);
|
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
(mDotc_/(limitedAlpha2 + SMALL)),
|
(mDotc_/clamp(mixture_.alpha2(), scalarMinMax(SMALL, 1))),
|
||||||
-(mDote_/(limitedAlpha1 + SMALL))
|
-(mDote_/clamp(mixture_.alpha1(), scalarMinMax(SMALL, 1)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false // Do not register
|
IOobject::NO_REGISTER
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,7 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::Cp() const
|
|||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const volScalarField limitedAlpha1
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_, zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
@ -176,13 +176,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cp
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
alpha1p*Cp1().value() + (scalar(1) - alpha1p)*Cp2().value()
|
alpha1p*Cp1().value() + (scalar(1) - alpha1p)*Cp2().value()
|
||||||
@ -194,7 +192,7 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::rho() const
|
|||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const volScalarField limitedAlpha1
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_, zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
@ -214,13 +212,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::rho
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
alpha1p*rho1().value() + (scalar(1) - alpha1p)*rho2().value()
|
alpha1p*rho1().value() + (scalar(1) - alpha1p)*rho2().value()
|
||||||
@ -232,7 +228,7 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::Cv() const
|
|||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const volScalarField limitedAlpha1
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_, zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
@ -253,13 +249,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cv
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
alpha1p*Cv1().value() + (scalar(1) - alpha1p)*Cv2().value()
|
alpha1p*Cv1().value() + (scalar(1) - alpha1p)*Cv2().value()
|
||||||
@ -339,7 +333,7 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::kappa() const
|
|||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const volScalarField limitedAlpha1
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_, zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
@ -358,13 +352,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::kappa
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
return (alpha1p*kappa1().value() + (1 - alpha1p)*kappa2().value());
|
return (alpha1p*kappa1().value() + (1 - alpha1p)*kappa2().value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,13 +394,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::kappaEff
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
return
|
return
|
||||||
(alpha1p*kappa1().value() + (1 - alpha1p)*kappa2().value()) + kappat;
|
(alpha1p*kappa1().value() + (1 - alpha1p)*kappa2().value()) + kappat;
|
||||||
|
|
||||||
@ -435,13 +425,11 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::alphaEff
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const scalarField alpha1p
|
||||||
(
|
(
|
||||||
min(max(alpha1_, scalar(0)), scalar(1))
|
clamp(alpha1_.boundaryField()[patchi], zero_one{})
|
||||||
);
|
);
|
||||||
|
|
||||||
const scalarField& alpha1p = limitedAlpha1.boundaryField()[patchi];
|
|
||||||
|
|
||||||
const scalarField rho
|
const scalarField rho
|
||||||
(
|
(
|
||||||
alpha1p*rho1().value() + (1.0 - alpha1p)*rho2().value()
|
alpha1p*rho1().value() + (1.0 - alpha1p)*rho2().value()
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
IOobject::NO_REGISTER
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimless,
|
dimless,
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,7 +36,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
|
scalarField sumPhi
|
||||||
(
|
(
|
||||||
|
|||||||
@ -7,3 +7,5 @@ volScalarField::Internal divU
|
|||||||
? fvc::div(phiCN() + mesh.phi())
|
? fvc::div(phiCN() + mesh.phi())
|
||||||
: fvc::div(phiCN())
|
: fvc::div(phiCN())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
divU *= interpolatedCells*cellMask;
|
||||||
|
|||||||
@ -103,7 +103,7 @@
|
|||||||
{
|
{
|
||||||
if (refCells[zoneId] != -1)
|
if (refCells[zoneId] != -1)
|
||||||
{
|
{
|
||||||
validCells.append(refCells[zoneId]);
|
validCells.push_back(refCells[zoneId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
bool correctPhi
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("correctPhi", true)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool checkMeshCourantNo
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("checkMeshCourantNo", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool moveMeshOuterCorrectors
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("moveMeshOuterCorrectors", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
bool massFluxInterpolation
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("massFluxInterpolation", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool adjustFringe
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("oversetAdjustPhi", false)
|
|
||||||
);
|
|
||||||
|
|
||||||
bool ddtCorr
|
|
||||||
(
|
|
||||||
pimple.dict().getOrDefault("ddtCorr", true)
|
|
||||||
);
|
|
||||||
@ -40,8 +40,12 @@ volVectorField U
|
|||||||
nonInt.insert("HbyA");
|
nonInt.insert("HbyA");
|
||||||
nonInt.insert("grad(p_rgh)");
|
nonInt.insert("grad(p_rgh)");
|
||||||
nonInt.insert("nHat");
|
nonInt.insert("nHat");
|
||||||
|
nonInt.insert("surfaceIntegrate(nHatf)");
|
||||||
|
nonInt.insert("surfaceIntegrate(phi+meshPhi)");
|
||||||
nonInt.insert("surfaceIntegrate(phi)");
|
nonInt.insert("surfaceIntegrate(phi)");
|
||||||
nonInt.insert("surfaceIntegrate(phiHbyA)");
|
nonInt.insert("surfaceIntegrate(phiHbyA)");
|
||||||
|
nonInt.insert("surfaceSum(((S|magSf)*S)");
|
||||||
|
nonInt.insert("surfaceIntegrate(((rAUf*magSf)*snGradCorr(p_rgh)))");
|
||||||
nonInt.insert("cellMask");
|
nonInt.insert("cellMask");
|
||||||
nonInt.insert("cellDisplacement");
|
nonInt.insert("cellDisplacement");
|
||||||
nonInt.insert("interpolatedCells");
|
nonInt.insert("interpolatedCells");
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2014 OpenFOAM Foundation
|
Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,14 +49,11 @@ Description
|
|||||||
#include "turbulentTransportModel.H"
|
#include "turbulentTransportModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "CorrectPhi.H"
|
|
||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
#include "cellCellStencilObject.H"
|
#include "cellCellStencilObject.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"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -76,8 +73,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
#include "createTimeControls.H"
|
|
||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createAlphaFluxes.H"
|
#include "createAlphaFluxes.H"
|
||||||
@ -97,11 +93,8 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
|
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (correctPhi)
|
|
||||||
{
|
|
||||||
#include "correctPhi.H"
|
|
||||||
}
|
|
||||||
#include "createUf.H"
|
#include "createUf.H"
|
||||||
|
#include "createControls.H"
|
||||||
|
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
#include "setInterpolatedCells.H"
|
#include "setInterpolatedCells.H"
|
||||||
@ -119,7 +112,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
#include "readDyMControls.H"
|
||||||
|
#include "readOversetDyMControls.H"
|
||||||
|
|
||||||
if (LTS)
|
if (LTS)
|
||||||
{
|
{
|
||||||
@ -158,50 +152,17 @@ int main(int argc, char *argv[])
|
|||||||
talphaPhi1Corr0.clear();
|
talphaPhi1Corr0.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
gh = (g & mesh.C()) - ghRef;
|
|
||||||
ghf = (g & mesh.Cf()) - ghRef;
|
|
||||||
|
|
||||||
// Update cellMask field for blocking out hole cells
|
// Update cellMask field for blocking out hole cells
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
#include "setInterpolatedCells.H"
|
#include "setInterpolatedCells.H"
|
||||||
|
#include "correctPhiFaceMask.H"
|
||||||
|
|
||||||
const surfaceScalarField faceMaskOld
|
gh = (g & mesh.C()) - ghRef;
|
||||||
(
|
ghf = (g & mesh.Cf()) - ghRef;
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
|
||||||
Uf *= faceMaskOld;
|
|
||||||
|
|
||||||
const surfaceVectorField Uint(fvc::interpolate(U));
|
|
||||||
// Update Uf and phi on new C-I faces
|
|
||||||
Uf += (1-faceMaskOld)*Uint;
|
|
||||||
|
|
||||||
// Update Uf boundary
|
|
||||||
forAll(Uf.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
Uf.boundaryFieldRef()[patchI] =
|
|
||||||
Uint.boundaryField()[patchI];
|
|
||||||
}
|
|
||||||
|
|
||||||
phi = mesh.Sf() & Uf;
|
|
||||||
|
|
||||||
// Correct phi on individual regions
|
|
||||||
if (correctPhi)
|
|
||||||
{
|
|
||||||
#include "correctPhi.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
mixture.correct();
|
mixture.correct();
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
phi *= faceMask;
|
|
||||||
U *= cellMask;
|
|
||||||
|
|
||||||
// Make the flux relative to the mesh motion
|
// Make the flux relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
@ -213,14 +174,14 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (adjustFringe)
|
||||||
|
{
|
||||||
|
oversetAdjustPhi(phi, U, zoneIdMass);
|
||||||
|
}
|
||||||
|
|
||||||
#include "alphaControls.H"
|
#include "alphaControls.H"
|
||||||
#include "alphaEqnSubCycle.H"
|
#include "alphaEqnSubCycle.H"
|
||||||
|
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
rhoPhi *= faceMask;
|
rhoPhi *= faceMask;
|
||||||
|
|
||||||
mixture.correct();
|
mixture.correct();
|
||||||
|
|||||||
@ -1,64 +1,31 @@
|
|||||||
{
|
{
|
||||||
rAU = 1.0/UEqn.A();
|
rAU = 1.0/UEqn.A();
|
||||||
//mesh.interpolate(rAU);
|
|
||||||
|
|
||||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
|
||||||
|
|
||||||
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 = rAU*UEqn.H();
|
|
||||||
HbyA = constrainHbyA(rAU*H, U, p_rgh);
|
|
||||||
|
|
||||||
if (massFluxInterpolation)
|
HbyA = constrainHbyA(rAU*H, U, p_rgh);
|
||||||
{
|
|
||||||
#include "interpolatedFaces.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
|
||||||
|
|
||||||
if (ddtCorr)
|
|
||||||
{
|
|
||||||
surfaceScalarField faceMaskOld
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
phiHbyA +=
|
|
||||||
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf);
|
|
||||||
}
|
|
||||||
MRF.makeRelative(phiHbyA);
|
MRF.makeRelative(phiHbyA);
|
||||||
|
|
||||||
if (p_rgh.needReference())
|
|
||||||
{
|
|
||||||
fvc::makeRelative(phiHbyA, U);
|
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
|
||||||
fvc::makeAbsolute(phiHbyA, U);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (adjustFringe)
|
|
||||||
{
|
|
||||||
fvc::makeRelative(phiHbyA, U);
|
|
||||||
oversetAdjustPhi(phiHbyA, U);
|
|
||||||
fvc::makeAbsolute(phiHbyA, U);
|
|
||||||
}
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
mixture.surfaceTensionForce()
|
mixture.surfaceTensionForce()
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(cellMask*rho)
|
||||||
)*faceMask*rAUf*mesh.magSf()
|
)*rAUf*faceMask*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
if (adjustFringe)
|
if (adjustFringe)
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phiHbyA, U);
|
oversetAdjustPhi(phiHbyA, U, zoneIdMass);
|
||||||
oversetAdjustPhi(phiHbyA, U);
|
|
||||||
fvc::makeAbsolute(phiHbyA, U);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
@ -90,6 +57,10 @@
|
|||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
if (oversetPatchErrOutput)
|
||||||
|
{
|
||||||
|
oversetPatchPhiErr(p_rghEqn, phiHbyA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
|
|
||||||
|
|
||||||
checkMeshCourantNo =
|
|
||||||
pimple.dict().getOrDefault("checkMeshCourantNo", false);
|
|
||||||
|
|
||||||
moveMeshOuterCorrectors =
|
|
||||||
pimple.dict().getOrDefault("moveMeshOuterCorrectors", false);
|
|
||||||
|
|
||||||
massFluxInterpolation =
|
|
||||||
pimple.dict().getOrDefault("massFluxInterpolation", false);
|
|
||||||
|
|
||||||
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
|
|
||||||
|
|
||||||
adjustFringe = pimple.dict().getOrDefault("oversetAdjustPhi", false);
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
CorrectPhi
|
|
||||||
(
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
p_rgh,
|
|
||||||
surfaceScalarField("rAUf", fvc::interpolate(rAU)),
|
|
||||||
divU,
|
|
||||||
pimple
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
@ -149,10 +149,5 @@ surfaceScalarField alphaPhi10
|
|||||||
// Mask field for zeroing out contributions on hole cells
|
// Mask field for zeroing out contributions on hole cells
|
||||||
#include "createCellMask.H"
|
#include "createCellMask.H"
|
||||||
|
|
||||||
surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create bool field with interpolated cells
|
// Create bool field with interpolated cells
|
||||||
#include "createInterpolatedCells.H"
|
#include "createInterpolatedCells.H"
|
||||||
|
|||||||
@ -82,9 +82,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCaseLists.H"
|
#include "setRootCaseLists.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
#include "createTimeControls.H"
|
|
||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
@ -118,7 +116,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
#include "readDyMControls.H"
|
||||||
|
|
||||||
// Store divU from the previous mesh so that it can be mapped
|
// Store divU 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
|
||||||
@ -153,40 +151,10 @@ int main(int argc, char *argv[])
|
|||||||
// Update cellMask field for blocking out hole cells
|
// Update cellMask field for blocking out hole cells
|
||||||
#include "setCellMask.H"
|
#include "setCellMask.H"
|
||||||
#include "setInterpolatedCells.H"
|
#include "setInterpolatedCells.H"
|
||||||
|
#include "correctPhiFaceMask.H"
|
||||||
faceMask =
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime());
|
|
||||||
|
|
||||||
|
|
||||||
// Zero Uf on old faceMask (H-I)
|
|
||||||
Uf *= faceMask;
|
|
||||||
|
|
||||||
const surfaceVectorField Uint(fvc::interpolate(U));
|
|
||||||
// Update Uf and phi on new C-I faces
|
|
||||||
Uf += (1-faceMask)*Uint;
|
|
||||||
|
|
||||||
// Update Uf boundary
|
|
||||||
forAll(Uf.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
Uf.boundaryFieldRef()[patchI] =
|
|
||||||
Uint.boundaryField()[patchI];
|
|
||||||
}
|
|
||||||
|
|
||||||
phi = mesh.Sf() & Uf;
|
|
||||||
|
|
||||||
if (correctPhi)
|
|
||||||
{
|
|
||||||
#include "correctPhi.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
mixture->correct();
|
mixture->correct();
|
||||||
|
|
||||||
// Zero phi on current H-I
|
|
||||||
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
|
|
||||||
|
|
||||||
phi *= faceMask;
|
|
||||||
U *= cellMask;
|
|
||||||
|
|
||||||
// Make the flux relative to the mesh motion
|
// Make the flux relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
}
|
}
|
||||||
@ -214,10 +182,6 @@ int main(int argc, char *argv[])
|
|||||||
mixture->correct();
|
mixture->correct();
|
||||||
|
|
||||||
#include "alphaEqnSubCycle.H"
|
#include "alphaEqnSubCycle.H"
|
||||||
const surfaceScalarField faceMask
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask)
|
|
||||||
);
|
|
||||||
rhoPhi *= faceMask;
|
rhoPhi *= faceMask;
|
||||||
|
|
||||||
interface.correct();
|
interface.correct();
|
||||||
|
|||||||
@ -8,16 +8,6 @@
|
|||||||
fvc::flux(HbyA)
|
fvc::flux(HbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (ddtCorr)
|
|
||||||
{
|
|
||||||
surfaceScalarField faceMaskOld
|
|
||||||
(
|
|
||||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
|
||||||
);
|
|
||||||
phiHbyA += faceMaskOld*fvc::ddtCorr(U, Uf);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p_rgh.needReference())
|
if (p_rgh.needReference())
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phiHbyA, U);
|
fvc::makeRelative(phiHbyA, U);
|
||||||
|
|||||||
@ -70,7 +70,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
|||||||
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const
|
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const
|
||||||
{
|
{
|
||||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
@ -85,7 +85,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
|||||||
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const
|
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const
|
||||||
{
|
{
|
||||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
|
|||||||
@ -82,7 +82,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField>>
|
|||||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const
|
Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const
|
||||||
{
|
{
|
||||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
|
|||||||
@ -99,7 +99,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff
|
|||||||
const volScalarField& p
|
const volScalarField& p
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()
|
limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()
|
||||||
@ -117,7 +117,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const
|
|||||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||||
volScalarField pCoeff(this->pCoeff(p));
|
volScalarField pCoeff(this->pCoeff(p));
|
||||||
|
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
(
|
(
|
||||||
@ -134,7 +134,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const
|
|||||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||||
volScalarField pCoeff(this->pCoeff(p));
|
volScalarField pCoeff(this->pCoeff(p));
|
||||||
|
|
||||||
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
|
volScalarField limitedAlpha1(clamp(alpha1_, zero_one{}));
|
||||||
volScalarField apCoeff(limitedAlpha1*pCoeff);
|
volScalarField apCoeff(limitedAlpha1*pCoeff);
|
||||||
|
|
||||||
return Pair<tmp<volScalarField>>
|
return Pair<tmp<volScalarField>>
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Foam::phaseChangeTwoPhaseMixture::New
|
|||||||
U.db(),
|
U.db(),
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false // Do not register
|
IOobject::NO_REGISTER
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ surfaceScalarField phi
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar(dimArea*dimVelocity, Zero)
|
dimensionedScalar(dimVelocity*dimArea, Zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
multiphaseSystem fluid(U, phi);
|
multiphaseSystem fluid(U, phi);
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar(dimArea*dimVelocity, Zero)
|
dimensionedScalar(dimVelocity*dimArea, Zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField rho("rho", fluid.rho());
|
volScalarField rho("rho", fluid.rho());
|
||||||
|
|||||||
@ -126,9 +126,9 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
|
|
||||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
os.writeEntry("thetaProperties", thetaProps_);
|
os.writeEntry("thetaProperties", thetaProps_);
|
||||||
writeEntry("value", os);
|
fvPatchField<scalar>::writeValueEntry(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -287,7 +287,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
|
|||||||
|
|
||||||
auto sigma = sigmas_.cfind(interfacePair(alpha1, alpha2));
|
auto sigma = sigmas_.cfind(interfacePair(alpha1, alpha2));
|
||||||
|
|
||||||
if (!sigma.found())
|
if (!sigma.good())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||||
@ -463,7 +463,7 @@ void Foam::multiphaseMixture::correctBoundaryContactAngle
|
|||||||
|
|
||||||
const auto tp = acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
const auto tp = acap.thetaProps().cfind(interfacePair(alpha1, alpha2));
|
||||||
|
|
||||||
if (!tp.found())
|
if (!tp.good())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user