Compare commits
320 Commits
PDRFoam-rc
...
OpenFOAM-v
| Author | SHA1 | Date | |
|---|---|---|---|
| c15bfde3cb | |||
| e3796745ed | |||
| c503deb72e | |||
| 03cc42414c | |||
| 155455398e | |||
| eb3c96fe30 | |||
| aaa5469261 | |||
| 3b10cd84c6 | |||
| 3cf0c58d19 | |||
| 27cc914337 | |||
| c40796843d | |||
| acd8e53310 | |||
| 6101272133 | |||
| 6595429f53 | |||
| 6eae29aa1d | |||
| 57304aeaf6 | |||
| 7d42501107 | |||
| f5e0f69bae | |||
| 98aa92a07f | |||
| 3825c4ee95 | |||
| 269d0ffd5c | |||
| b2fdc67273 | |||
| 02881f6237 | |||
| 521a9e4dd6 | |||
| e2148b587e | |||
| 7d2a9fad1a | |||
| 096b9dc52e | |||
| a3d90ae9b9 | |||
| 3b29395a66 | |||
| f39fedb7f9 | |||
| 36dd86f89a | |||
| a9f55f06ba | |||
| ba4d38da68 | |||
| 3e5056144d | |||
| b8768e2878 | |||
| 775194bea1 | |||
| 3f7c057712 | |||
| 371619bc7a | |||
| 9823ddd480 | |||
| f46c57951d | |||
| 0110e69018 | |||
| 1f84dcbac6 | |||
| ee4f7feb30 | |||
| 98abafccdb | |||
| af86d19ea5 | |||
| 89de932685 | |||
| ea12bfdb0f | |||
| b6e8768034 | |||
| 82fdeaf679 | |||
| 64fb07c5db | |||
| f54b190f31 | |||
| 05e0749d0e | |||
| 30da494e55 | |||
| ae02a86562 | |||
| 620fe96c02 | |||
| c4b0f3c63d | |||
| 2797a8be25 | |||
| 596d8fab39 | |||
| ca88abba7e | |||
| b6b4ab071d | |||
| 239a7884a6 | |||
| 7b14af4230 | |||
| 853010309d | |||
| c7bde70ecb | |||
| 1afa6f1b46 | |||
| 2941d0387d | |||
| d92edabcb6 | |||
| ab49eaf983 | |||
| b4724c37ad | |||
| 02129b0846 | |||
| 4eba7481bc | |||
| 0cc201e2b8 | |||
| 348ae6f4be | |||
| 9dda3626b3 | |||
| de9657dd20 | |||
| 88f7dd7393 | |||
| f5fe37114f | |||
| b9c174312b | |||
| c6759692ba | |||
| 53f6431c31 | |||
| 3384d37a9a | |||
| 48cdf5523b | |||
| 7788a1a01a | |||
| d3d82c6a26 | |||
| ea0afd8a35 | |||
| 1911dba4d5 | |||
| 283c94fdd0 | |||
| 1f8c6e0f5b | |||
| a857c8d3ad | |||
| 9dada5f3f2 | |||
| 7e4cd55882 | |||
| ab5c7765c4 | |||
| 1a747a12ab | |||
| e81cf778a1 | |||
| 3395cba40e | |||
| 91c1e8efe2 | |||
| 3a858ac682 | |||
| 6120e13d29 | |||
| e2c8b0b13f | |||
| 3a2e725253 | |||
| c2692e7c99 | |||
| b59ae32d68 | |||
| b0891824fa | |||
| 2f6739b140 | |||
| d5a8ca5660 | |||
| 9f26e6738f | |||
| e681c127f2 | |||
| 0ba43df9c5 | |||
| 5d9e42cb70 | |||
| 3e87a46498 | |||
| 9f5df1adba | |||
| 6c4a1b17ad | |||
| 82cc00b153 | |||
| f2d634c49f | |||
| 5ec49a3898 | |||
| f421e29c2e | |||
| ac51890051 | |||
| e8d048d777 | |||
| 02bf8928cb | |||
| 2d9b31f6a4 | |||
| 0ae17908a2 | |||
| 830a217353 | |||
| 5076e6a745 | |||
| 0cf4aede6e | |||
| 0a5a0c29d7 | |||
| 0abafd98c7 | |||
| 2990b14d89 | |||
| aeb9644db4 | |||
| 48c05e5441 | |||
| da30533a8f | |||
| eb8e0aefa5 | |||
| 6c3a868fbe | |||
| 7ce111809e | |||
| f3d715dd13 | |||
| 42bbd05992 | |||
| c7357bd1c3 | |||
| 3273e6c21a | |||
| ab00110b5c | |||
| 4a87e2d0b4 | |||
| 8be49d8683 | |||
| f62a599eef | |||
| ad75af0e50 | |||
| f44dbbc200 | |||
| 9a3d27e3df | |||
| f99ba1adbd | |||
| cb7d8cef78 | |||
| b2ab5e8ae9 | |||
| 4028738327 | |||
| 0df219d1b3 | |||
| 0ea709e5ee | |||
| 0affbceaca | |||
| edbee86271 | |||
| ec81436cce | |||
| 2dbabb242b | |||
| c9fda67b5f | |||
| 44a243a94d | |||
| efd1ac4b5f | |||
| 739c1c1d61 | |||
| 5120c51ba1 | |||
| 18c1da05fd | |||
| 3a1a160cbb | |||
| 91ede9957c | |||
| 662bed74f6 | |||
| 5022591c36 | |||
| 2a438385a3 | |||
| 3bc8ab2839 | |||
| ea2bf72740 | |||
| 17e6a14773 | |||
| 40567b844a | |||
| c0138ee8b6 | |||
| 8eef91c5e2 | |||
| 5eb48c443a | |||
| 3595e6f93c | |||
| 4d14c95567 | |||
| 0a78e685ee | |||
| 492d5cb645 | |||
| 36266a7e7d | |||
| ac2dee910d | |||
| 1177dbd111 | |||
| c410edf928 | |||
| 86a2ae4f03 | |||
| 56db12fca1 | |||
| 3375ec952a | |||
| 8fcc1b893a | |||
| 03b0ca6f2e | |||
| db6c9c7bb2 | |||
| bfea2326da | |||
| 5a5fd1a43c | |||
| 308af39136 | |||
| 86f627b9e6 | |||
| dedb1c0c90 | |||
| 399c21d76c | |||
| 0252b4d58d | |||
| b267f8b6da | |||
| 9dc3d2bf40 | |||
| eb01cab052 | |||
| b62437081e | |||
| 385f92732b | |||
| d2311437ef | |||
| 2c74298891 | |||
| 2a8e1c0865 | |||
| 8bfab7aa80 | |||
| 881eeb0214 | |||
| 7c494a6b64 | |||
| 8524d02218 | |||
| 77375a88fd | |||
| d549826528 | |||
| 8878050ff9 | |||
| f00357349c | |||
| cf9063878e | |||
| 2b7b3700c2 | |||
| 95cd8ee75c | |||
| b060378dca | |||
| 96a1b86fb9 | |||
| 57c1fceabf | |||
| cdbc3e2de6 | |||
| 6dc6d7ca9a | |||
| ed686f4ef6 | |||
| 41d6b935dd | |||
| a9f8bc079f | |||
| 3f1f191034 | |||
| c1bc839841 | |||
| 8ad448b803 | |||
| bb86eecdc4 | |||
| 100ae5c2bd | |||
| 86744913f4 | |||
| 6740925621 | |||
| 19b90a1130 | |||
| 93befa4f63 | |||
| 2dbdac109e | |||
| c9c85d9afe | |||
| fefd59f374 | |||
| 6778ba9e3d | |||
| 22b4c44fe8 | |||
| 1829f7db6e | |||
| aa971e901a | |||
| ded81f4e65 | |||
| ef0786cca0 | |||
| 16762e6d49 | |||
| 20af386290 | |||
| 82a24a39b0 | |||
| 4ad4783e5f | |||
| 644857ba9e | |||
| 21720bea12 | |||
| d4ac96cdf3 | |||
| 4a3998c698 | |||
| 13ea1b70fe | |||
| b0e6c1fcd3 | |||
| 8abac1dc4d | |||
| 7ff603d496 | |||
| 7cd3b270d8 | |||
| 497215cc26 | |||
| 05a0e7f371 | |||
| 79ea57bdc1 | |||
| eb317550fe | |||
| 2fa8e5fdf3 | |||
| c4a7563a73 | |||
| ad35fea763 | |||
| b3142ffb54 | |||
| cbfa9f685e | |||
| 21dda3254c | |||
| 5ba31cd5de | |||
| 221c3c0200 | |||
| f5a931d4b5 | |||
| 9cc497373b | |||
| 1c0714f9b8 | |||
| b99078768e | |||
| 201f117f5f | |||
| dc27daf4f4 | |||
| f8c2928a88 | |||
| 2f4d864c85 | |||
| 5c4d714b45 | |||
| 85ff3d39d4 | |||
| 67e41f02ef | |||
| cd3fa1c04b | |||
| 1f0476a84c | |||
| dbed3a0602 | |||
| 1ca99a2c94 | |||
| cd1350a87f | |||
| 6ccc587bea | |||
| cb6dedacfc | |||
| 9a2a22a03a | |||
| 3ce18cb6e2 | |||
| 3299f9ac0d | |||
| 853f50f7da | |||
| ec609b90b8 | |||
| da1e6ea8d0 | |||
| 8d3efa1cb9 | |||
| 1050314b8c | |||
| da44c100f0 | |||
| 0c985edfc8 | |||
| e8cf2a2c62 | |||
| e3c8af0c8f | |||
| 498de8a74a | |||
| a76a3d760c | |||
| d15a396a6a | |||
| bf0a48d68e | |||
| 88c256b86a | |||
| db343351f7 | |||
| 273741c052 | |||
| 9dc70ab856 | |||
| 86c1ecdf32 | |||
| d10769f5a9 | |||
| daf9af461c | |||
| fa645c2dac | |||
| 51cd7ceecb | |||
| ce45a12918 | |||
| 496792f328 | |||
| aa942aadd4 | |||
| ba9e573812 | |||
| 22832b87cb | |||
| 50d21b32f2 | |||
| 9ca6e4a548 | |||
| 175d35de22 | |||
| 6940b08822 | |||
| a6f7b0f2ee | |||
| 0256e20da3 | |||
| 23e14cd1d9 | |||
| de7bc07153 | |||
| a8c9b5936e |
4
Allwmake
4
Allwmake
@ -73,10 +73,10 @@ echo
|
||||
applications/Allwmake $targetType $*
|
||||
|
||||
# Additional components/modules
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ]
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||
then
|
||||
echo "========================================"
|
||||
echo "OpenFOAM modules disabled (prefix=false)"
|
||||
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||
echo
|
||||
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
||||
then
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Contributors to OpenFOAM
|
||||
|
||||
The following is an list of known contributors to OpenFOAM.
|
||||
The following is a list of known contributors to OpenFOAM.
|
||||
It is likely incomplete...
|
||||
|
||||
## Contributors (alphabetical by surname)
|
||||
@ -24,6 +24,7 @@ It is likely incomplete...
|
||||
- Hrvoje Jasak
|
||||
- Alexander Kabat vel Job
|
||||
- Thilo Knacke
|
||||
- Shannon Leakey
|
||||
- Tommaso Lucchini
|
||||
- Graham Macpherson
|
||||
- Alexey Matveichev
|
||||
@ -50,7 +51,7 @@ It is likely incomplete...
|
||||
- Norbert Weber
|
||||
- Henry Weller
|
||||
- Niklas Wikstrom
|
||||
- Guanyang Xue
|
||||
- Thorsten Zirwes
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
@ -3,8 +3,9 @@
|
||||
Meta-information is generally for OpenFOAM internal use only.
|
||||
|
||||
The format, content and meaning may be changed at anytime without
|
||||
notice. If any of these are changed, these are some of places that
|
||||
will need to be updated accordingly:
|
||||
prior notice.
|
||||
If any of these are changed, these are some of places that will need
|
||||
to be updated accordingly:
|
||||
|
||||
- bin/foamEtcFile
|
||||
- bin/tools/foamConfigurePaths
|
||||
@ -38,7 +39,7 @@ Format: `date +%y%m`
|
||||
|
||||
- 4-digit year-month (YYMM) integer corresponding to the major
|
||||
release or in unusual cases an intermediate release.
|
||||
Example, `1712` for the Dec-2017 release.
|
||||
Example, `2106` for the June-2021 release.
|
||||
|
||||
|
||||
#### patch
|
||||
@ -78,9 +79,9 @@ the saved information needs synchronization. The command
|
||||
|
||||
### Notes
|
||||
|
||||
The saved information is split into two separate files. The `api-info`
|
||||
contains more permanent information, whereas the `build-info` is more
|
||||
transient in nature.
|
||||
The saved information is split into two separate files.
|
||||
The `api-info` file contains more permanent information,
|
||||
whereas the `build-info` is more transient in nature.
|
||||
|
||||
----
|
||||
2020-06-23
|
||||
2021-06-09
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2012
|
||||
patch=210210
|
||||
api=2106
|
||||
patch=0
|
||||
|
||||
70
README.md
70
README.md
@ -11,7 +11,7 @@ individual and group contributors, integrations
|
||||
[governance guided activities](https://www.openfoam.com/governance/).
|
||||
|
||||
|
||||
## Copyright
|
||||
## License
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@ -27,10 +27,11 @@ may redistribute files.
|
||||
OpenCFD Ltd grants use of its OpenFOAM trademark by Third Parties on a
|
||||
licence basis. ESI Group and OpenFOAM Foundation Ltd are currently
|
||||
permitted to use the Name and agreed Domain Name. For information on
|
||||
trademark use, please refer to the [trademark policy guidelines](http://www.openfoam.com/legal/trademark-policy.php).
|
||||
trademark use, please refer to the
|
||||
[trademark policy guidelines][link trademark].
|
||||
|
||||
Please [contact OpenCFD](http://www.openfoam.com/contact) if you have
|
||||
any questions on the use of the OpenFOAM trademark.
|
||||
any questions about the use of the OpenFOAM trademark.
|
||||
|
||||
Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
@ -39,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v1912 version:
|
||||
For example, for the OpenFOAM-v2106 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v1912/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2106/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -55,6 +56,11 @@ guides:
|
||||
| [ThirdParty][repo third] | [readme][link third-readme] | [system requirements][link third-require] | [build][link third-build] |
|
||||
|
||||
|
||||
If you need to modify the versions or locations of ThirdParty
|
||||
software, please read how the
|
||||
[OpenFOAM configuration][wiki-config] is structured.
|
||||
|
||||
|
||||
## How do I know which version I am currently using?
|
||||
|
||||
The value of the `$WM_PROJECT_DIR` or even `$WM_PROJECT_VERSION` are
|
||||
@ -63,19 +69,19 @@ not guaranteed to have any correspondence to the OpenFOAM release
|
||||
information is embedded into each application. For example, as
|
||||
displayed from `blockMesh -help`:
|
||||
```
|
||||
Using: OpenFOAM-v1812.local (1812) - visit www.openfoam.com
|
||||
Build: 65d6551ff7-20190530 (patch=190531)
|
||||
Using: OpenFOAM-com (2012) - visit www.openfoam.com
|
||||
Build: b830beb5ea-20210429 (patch=210414)
|
||||
Arch: LSB;label=32;scalar=64
|
||||
```
|
||||
This output contains all of the more interesting information that we need:
|
||||
|
||||
| item | value |
|
||||
|-----------------------|---------------|
|
||||
| version | v1812.local |
|
||||
| api | 1812 |
|
||||
| commit | 65d6551ff7 |
|
||||
| author date | 20190530 |
|
||||
| patch-level | (20)190531 |
|
||||
| version | com (eg, local development branch) |
|
||||
| api | 2012 |
|
||||
| commit | b830beb5ea |
|
||||
| author date | 20210429 |
|
||||
| patch-level | (20)210414 |
|
||||
| label/scalar size | 32/64 bits |
|
||||
|
||||
The Arch information may also include the `solveScalar` size
|
||||
@ -90,19 +96,19 @@ when OpenFOAM has not yet been compiled:
|
||||
```
|
||||
$ wmake -build-info
|
||||
make
|
||||
api = 1812
|
||||
patch = 190531
|
||||
api = 2012
|
||||
patch = 210414
|
||||
branch = master
|
||||
build = 65d6551ff7-20190530
|
||||
build = 308af39136-20210426
|
||||
```
|
||||
Similar information is available with `foamEtcFile`, using the
|
||||
`-show-api` or `-show-patch` options. For example,
|
||||
```
|
||||
$ foamEtcFile -show-api
|
||||
1812
|
||||
2012
|
||||
|
||||
$ foamEtcFile -show-patch
|
||||
190531
|
||||
210414
|
||||
```
|
||||
This output will generally be the easiest to parse for scripts.
|
||||
The `$FOAM_API` convenience environment variable may not reflect the
|
||||
@ -121,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v1912
|
||||
\-- ThirdParty-v1912
|
||||
|-- OpenFOAM-v2106
|
||||
\-- ThirdParty-v2106
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -130,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
|
||||
operating system or cluster installation provides it)
|
||||
|
||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||
directory name, e.g. openfoam-sandbox1912, etc..
|
||||
directory name, e.g. openfoam-sandbox2106, etc..
|
||||
|
||||
* When we would like any additional 3rd party software to be located
|
||||
inside of the OpenFOAM directory to ensure that the installation is
|
||||
@ -150,17 +156,14 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v1912-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2106-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `1912` and the original `ThirdParty-v1912/` would be found.
|
||||
be `2106` and the original `ThirdParty-v2106/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* this is the same as the previous example, but using an unadorned
|
||||
API value. This also makes sense if the chosen version name also
|
||||
uses the unadorned API value in its naming, *eg*,
|
||||
`1912-patch190131`, `1912.19W03`
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
* permits maximum reuse for various versions, for experienced user
|
||||
who are aware of potential version incompatibilities
|
||||
* permits maximum reuse for various versions, for experienced
|
||||
users who are aware of potential version incompatibilities
|
||||
|
||||
If none of these directories are found to be suitable, it reverts to
|
||||
using PROJECT/ThirdParty as a dummy location (even if the directory
|
||||
@ -184,18 +187,21 @@ ThirdParty directory will contain either an `Allwmake` file or a
|
||||
|
||||
<!-- OpenFOAM -->
|
||||
|
||||
[link trademark]: https://www.openfoam.com/opencfd-limited-trade-mark-policy
|
||||
|
||||
[repo openfoam]: https://develop.openfoam.com/Development/openfoam/
|
||||
[repo third]: https://develop.openfoam.com/Development/ThirdParty-common/
|
||||
|
||||
[link openfoam-readme]: https://develop.openfoam.com/Development/openfoam/blob/develop/README.md
|
||||
[link openfoam-issues]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/BuildIssues.md
|
||||
[link openfoam-config]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Config.md
|
||||
[link openfoam-build]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Build.md
|
||||
[link openfoam-require]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Requirements.md
|
||||
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/README.md
|
||||
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/BUILD.md
|
||||
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
|
||||
|
||||
[wiki-config]: https://develop.openfoam.com/Development/openfoam/-/wikis/configuring
|
||||
|
||||
|
||||
## Useful Links
|
||||
|
||||
@ -203,8 +209,8 @@ ThirdParty directory will contain either an `Allwmake` file or a
|
||||
- [Documentation](http://www.openfoam.com/documentation)
|
||||
- [Reporting bugs/issues/feature requests](http://www.openfoam.com/code/bug-reporting.php)
|
||||
- [Issue tracker](https://develop.openfoam.com/Development/openfoam/-/issues)
|
||||
- [Code wiki](https://develop.openfoam.com/Development/openfoam/-/wikis/) and [general wiki](http://wiki.openfoam.com/)
|
||||
- [Community](http://www.openfoam.com/community/), [Governance](http://www.openfoam.com/governance/)
|
||||
- [Code wiki](https://develop.openfoam.com/Development/openfoam/-/wikis/) and [General wiki](http://wiki.openfoam.com/)
|
||||
- [Governance](http://www.openfoam.com/governance/), [Governance Projects](https://www.openfoam.com/governance/projects)
|
||||
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
|
||||
|
||||
Copyright 2016-2020 OpenCFD Ltd
|
||||
Copyright 2016-2021 OpenCFD Ltd
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
)
|
||||
: -betav*dpdt
|
||||
)
|
||||
- fvm::laplacian(DbThermal, hea)
|
||||
- fvm::laplacian(Db, hea)
|
||||
+ betav*fvOptions(rho, hea)
|
||||
);
|
||||
|
||||
|
||||
@ -16,7 +16,13 @@ if (ign.ignited())
|
||||
)*rho/thermo.rhou()
|
||||
: -betav*dpdt*rho/thermo.rhou()
|
||||
)
|
||||
- fvm::laplacian(DbThermal, heau)
|
||||
- fvm::laplacian(Db, heau)
|
||||
|
||||
// These terms cannot be used in partially-premixed combustion due to
|
||||
// the resultant inconsistency between ft and heau transport.
|
||||
// A possible solution would be to solve for ftu as well as ft.
|
||||
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
|
||||
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
|
||||
==
|
||||
betav*fvOptions(rho, heau)
|
||||
);
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
XiModels/XiModel/XiModel.C
|
||||
XiModels/XiModel/XiModelNew.C
|
||||
|
||||
XiModels/transport/transportTwoEqs/transportTwoEqs.C
|
||||
XiModels/fixed/fixed.C
|
||||
XiModels/algebraic/algebraic.C
|
||||
XiModels/transport/transport.C
|
||||
|
||||
XiModels/XiEqModels/XiEqModel/XiEqModel.C
|
||||
XiModels/XiEqModels/XiEqModel/XiEqModelNew.C
|
||||
|
||||
XiModels/XiEqModels/Gulder/Gulder.C
|
||||
XiModels/XiEqModels/instability2XiEq/instability2XiEq.C
|
||||
XiModels/XiEqModels/BLMgMaXiEq/BLMgMaXiEq.C
|
||||
XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C
|
||||
XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
|
||||
XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C
|
||||
|
||||
XiModels/XiGModels/XiGModel/XiGModel.C
|
||||
XiModels/XiGModels/XiGModel/XiGModelNew.C
|
||||
XiModels/XiGModels/KTS/KTS.C
|
||||
XiModels/XiGModels/instabilityG/instabilityG.C
|
||||
XiModels/XiGModels/instability2G/instability2G.C
|
||||
|
||||
PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
|
||||
|
||||
PDRModels/dragModels/PDRDragModel/PDRDragModel.C
|
||||
PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C
|
||||
PDRModels/dragModels/basic/basic.C
|
||||
PDRModels/dragModels/basicSch/basicSch.C
|
||||
|
||||
PDRModels/XiEqModels/normBasicXiSubXiEq/normBasicXiSubXiEq.C
|
||||
PDRModels/XiGModels/normBasicXiSubG/normBasicXiSubG.C
|
||||
PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C
|
||||
PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
|
||||
|
||||
laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
|
||||
|
||||
/*PDRFoamAutoRefine.C*/
|
||||
PDRFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/PDRFoam
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -82,11 +81,8 @@ Description
|
||||
#include "PDRDragModel.H"
|
||||
#include "ignition.H"
|
||||
#include "bound.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "dynamicRefineFvMesh.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -99,24 +95,22 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "readCombustionProperties.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
scalar StCoNum = 0.0;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -125,62 +119,33 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "\n\nTime = " << runTime.timeName() << endl;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
fvc::makeAbsolute(phi, rho, U);
|
||||
|
||||
// Flux estimate for introduced faces.
|
||||
volVectorField rhoU("rhoU", rho*U);
|
||||
|
||||
bool meshChanged = mesh.controlledUpdate();
|
||||
|
||||
if (runTime.write() && meshChanged)
|
||||
{
|
||||
betav.write();
|
||||
betai.write();
|
||||
Blong.write();
|
||||
Bv.write();
|
||||
Lobs.write();
|
||||
CT.write();
|
||||
drag->writeFields();
|
||||
flameWrinkling->writeFields();
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, rho, U);
|
||||
}
|
||||
|
||||
if (pimple.firstIter())
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "bEqn.H"
|
||||
#include "ftEqn.H"
|
||||
#include "EauEqn.H"
|
||||
#include "EaEqn.H"
|
||||
|
||||
if (!ign.ignited())
|
||||
{
|
||||
thermo.heu() == thermo.he();
|
||||
}
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "bEqn.H"
|
||||
#include "ftEqn.H"
|
||||
#include "EauEqn.H"
|
||||
#include "EaEqn.H"
|
||||
|
||||
if (!ign.ignited())
|
||||
{
|
||||
thermo.heu() == thermo.he();
|
||||
}
|
||||
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
@ -190,14 +155,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
Info<< "End\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
216
applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C
Normal file
216
applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C
Normal file
@ -0,0 +1,216 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
PDRFoam
|
||||
|
||||
Description
|
||||
Solver for compressible premixed/partially-premixed combustion with
|
||||
turbulence modelling.
|
||||
|
||||
Combusting RANS code using the b-Xi two-equation model.
|
||||
Xi may be obtained by either the solution of the Xi transport
|
||||
equation or from an algebraic expression. Both approaches are
|
||||
based on Gulder's flame speed correlation which has been shown
|
||||
to be appropriate by comparison with the results from the
|
||||
spectral model.
|
||||
|
||||
Strain effects are incorporated directly into the Xi equation
|
||||
but not in the algebraic approximation. Further work need to be
|
||||
done on this issue, particularly regarding the enhanced removal rate
|
||||
caused by flame compression. Analysis using results of the spectral
|
||||
model will be required.
|
||||
|
||||
For cases involving very lean Propane flames or other flames which are
|
||||
very strain-sensitive, a transport equation for the laminar flame
|
||||
speed is present. This equation is derived using heuristic arguments
|
||||
involving the strain time scale and the strain-rate at extinction.
|
||||
the transport velocity is the same as that for the Xi equation.
|
||||
|
||||
For large flames e.g. explosions additional modelling for the flame
|
||||
wrinkling due to surface instabilities may be applied.
|
||||
|
||||
PDR (porosity/distributed resistance) modelling is included to handle
|
||||
regions containing blockages which cannot be resolved by the mesh.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "psiuReactionThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "XiModel.H"
|
||||
#include "PDRDragModel.H"
|
||||
#include "ignition.H"
|
||||
#include "bound.H"
|
||||
#include "dynamicRefineFvMesh.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Solver for compressible premixed/partially-premixed combustion with"
|
||||
" turbulence modelling."
|
||||
);
|
||||
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "readCombustionProperties.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
turbulence->validate();
|
||||
scalar StCoNum = 0.0;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
bool hasChanged = false;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
// Indicators for refinement.
|
||||
// Note: before ++runTime only for post-processing reasons.
|
||||
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
|
||||
volScalarField normalisedGradP
|
||||
(
|
||||
"normalisedGradP",
|
||||
tmagGradP()/max(tmagGradP())
|
||||
);
|
||||
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
|
||||
tmagGradP.clear();
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "\n\nTime = " << runTime.timeName() << endl;
|
||||
|
||||
{
|
||||
// Make the fluxes absolute
|
||||
fvc::makeAbsolute(phi, rho, U);
|
||||
|
||||
// Test : disable refinement for some cells
|
||||
bitSet& protectedCell =
|
||||
refCast<dynamicRefineFvMesh>(mesh).protectedCell();
|
||||
|
||||
if (protectedCell.empty())
|
||||
{
|
||||
protectedCell.setSize(mesh.nCells());
|
||||
protectedCell = false;
|
||||
}
|
||||
|
||||
forAll(betav, celli)
|
||||
{
|
||||
if (betav[celli] < 0.99)
|
||||
{
|
||||
protectedCell.set(celli);
|
||||
}
|
||||
}
|
||||
|
||||
// Flux estimate for introduced faces.
|
||||
volVectorField rhoU("rhoU", rho*U);
|
||||
|
||||
// Do any mesh changes
|
||||
bool meshChanged = mesh.update();
|
||||
|
||||
|
||||
if (meshChanged)
|
||||
{
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
if (runTime.write() && hasChanged)
|
||||
{
|
||||
betav.write();
|
||||
Lobs.write();
|
||||
CT.write();
|
||||
drag->writeFields();
|
||||
flameWrinkling->writeFields();
|
||||
hasChanged = false;
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, rho, U);
|
||||
}
|
||||
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "bEqn.H"
|
||||
#include "ftEqn.H"
|
||||
#include "huEqn.H"
|
||||
#include "hEqn.H"
|
||||
|
||||
if (!ign.ignited())
|
||||
{
|
||||
hu == h;
|
||||
}
|
||||
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "End\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,150 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicXiSubXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(basicSubGrid, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::basicSubGrid::basicSubGrid
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
|
||||
B_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"B",
|
||||
Su.mesh().facesInstance(),
|
||||
Su.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
Su.mesh()
|
||||
),
|
||||
|
||||
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::basicSubGrid::~basicSubGrid()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
|
||||
{
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
|
||||
volScalarField magU(mag(U));
|
||||
volVectorField Uhat
|
||||
(
|
||||
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
|
||||
);
|
||||
|
||||
const scalarField Cw = pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
volScalarField N
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"N",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
);
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
|
||||
|
||||
volSymmTensorField ns
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"ns",
|
||||
U.mesh().time().timeName(),
|
||||
U.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U.mesh(),
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
);
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
|
||||
|
||||
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
|
||||
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
|
||||
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
|
||||
|
||||
volScalarField XiSubEq
|
||||
(
|
||||
scalar(1)
|
||||
+ max(2.2*sqrt(b), min(0.34*magU/up*sqrt(b), scalar(1.6)))
|
||||
* min(n, scalar(1))
|
||||
);
|
||||
|
||||
return (XiSubEq*XiEqModel_->XiEq());
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::basicSubGrid::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
return XiEqModel_->read(XiEqModelCoeffs_);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::basicSubGrid
|
||||
|
||||
Description
|
||||
Basic sub-grid obstacle flame-wrinkling enhancement factor model.
|
||||
Details supplied by J Puttock 2/7/06.
|
||||
|
||||
<b> Sub-grid flame area generation </b>
|
||||
|
||||
\f$ n = N - \hat{\dwea{\vec{U}}}.n_{s}.\hat{\dwea{\vec{U}}} \f$
|
||||
\f$ n_{r} = \sqrt{n} \f$
|
||||
|
||||
where:
|
||||
|
||||
\f$ \hat{\dwea{\vec{U}}} = \dwea{\vec{U}} / \vert \dwea{\vec{U}}
|
||||
\vert \f$
|
||||
|
||||
\f$ b = \hat{\dwea{\vec{U}}}.B.\hat{\dwea{\vec{U}}} / n_{r} \f$
|
||||
|
||||
where:
|
||||
|
||||
\f$ B \f$ is the file "B".
|
||||
|
||||
\f$ N \f$ is the file "N".
|
||||
|
||||
\f$ n_{s} \f$ is the file "ns".
|
||||
|
||||
The flame area enhancement factor \f$ \Xi_{sub} \f$ is expected to
|
||||
approach:
|
||||
|
||||
\f[
|
||||
\Xi_{{sub}_{eq}} =
|
||||
1 + max(2.2 \sqrt{b}, min(0.34 \frac{\vert \dwea{\vec{U}}
|
||||
\vert}{{\vec{U}}^{'}}, 1.6)) \times min(\frac{n}{4}, 1)
|
||||
\f]
|
||||
|
||||
|
||||
SourceFiles
|
||||
basicSubGrid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef basicSubGrid_H
|
||||
#define basicSubGrid_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class basicSubGrid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class basicSubGrid
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- tblock
|
||||
volSymmTensorField B_;
|
||||
|
||||
//- Equilibrium Xi model due to turbulence
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basicSubGrid(const basicSubGrid&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basicSubGrid&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("basicSubGrid");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
basicSubGrid
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~basicSubGrid();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,219 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "normBasicXiSubXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "ignition.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(normBasicSubGrid, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, normBasicSubGrid, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::normBasicSubGrid::normBasicSubGrid
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, modelType,thermo, turbulence, Su),
|
||||
Cxpe1_(XiEqModelCoeffs_.get<scalar>("Cxpe1")),
|
||||
Cxpe2_(XiEqModelCoeffs_.get<scalar>("Cxpe2")),
|
||||
Cxpe3_(XiEqModelCoeffs_.get<scalar>("Cxpe3")),
|
||||
Cxpe4_(XiEqModelCoeffs_.get<scalar>("Cxpe4"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::normBasicSubGrid::~normBasicSubGrid()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::normBasicSubGrid::XiEq() const
|
||||
{
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
const volScalarField& b = mesh.lookupObject<volScalarField>("b");
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
const volSymmTensorField& Bv =
|
||||
mesh.lookupObject<volSymmTensorField>("Bv");
|
||||
|
||||
volScalarField magU(mag(U));
|
||||
|
||||
const scalarField Cw(pow(mesh.V(), 2.0/3.0));
|
||||
|
||||
auto tN = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
);
|
||||
auto& N = tN.ref();
|
||||
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
|
||||
|
||||
auto tns = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tns",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
);
|
||||
auto& ns = tns.ref();
|
||||
|
||||
auto tB = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tB",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor(Bv.dimensions(), Zero)
|
||||
);
|
||||
auto& B = tB.ref();
|
||||
|
||||
//calculating flame normal
|
||||
|
||||
volVectorField flNormal
|
||||
(
|
||||
"flNormal",
|
||||
fvc::reconstruct(fvc::snGrad(b)*mesh.magSf())
|
||||
);
|
||||
|
||||
volScalarField mgb("mgb", mag(flNormal));
|
||||
|
||||
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
|
||||
|
||||
const volScalarField bc(b*(1.0-b));
|
||||
|
||||
dMgb += 1.0e-8*
|
||||
(bc*mgb)().weightedAverage(mesh.V())
|
||||
/(bc.weightedAverage(mesh.V()) + SMALL);
|
||||
|
||||
mgb += dMgb;
|
||||
flNormal /= mgb;
|
||||
|
||||
B.primitiveFieldRef() = Bv.primitiveField()*sqrt(Cw);
|
||||
volScalarField Ntemp("Ntemp", N);
|
||||
volScalarField Np("Np", max(N - (flNormal & ns & flNormal), scalar(1)));
|
||||
|
||||
// B_ is Bv*sqrt(Cw)
|
||||
volScalarField bl("bl",(flNormal & B & flNormal)/sqrt(Np));
|
||||
bl.min(1.0);
|
||||
|
||||
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
|
||||
|
||||
IOdictionary combustionProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
ignition ign(combustionProperties, mesh.time(), mesh);
|
||||
|
||||
dimensionedVector ignLoc("ignLoc", dimLength, ign.sites()[0].location());
|
||||
|
||||
dimensionedScalar filtRad2
|
||||
(
|
||||
"filtRad2",
|
||||
dimLength,
|
||||
6.0*ign.sites()[0].diameter()
|
||||
);
|
||||
|
||||
const volScalarField filDist(mag(mesh.C() - ignLoc));
|
||||
|
||||
const volScalarField filterMult
|
||||
(
|
||||
pos(filDist - filtRad2)*neg(bl - 0.99)*pos(N - 1e-3)
|
||||
);
|
||||
|
||||
tmp<volScalarField> XiSubEq
|
||||
(
|
||||
scalar(1)
|
||||
+ min( min(Cxpe1_, Cxpe2_*magU/up)*sqrt(bl), Cxpe3_)
|
||||
* filterMult
|
||||
);
|
||||
|
||||
return XiSubEq;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::normBasicSubGrid::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
XiEqModelCoeffs_.readEntry("Cxpe1", Cxpe1_);
|
||||
XiEqModelCoeffs_.readEntry("Cxpe2", Cxpe2_);
|
||||
XiEqModelCoeffs_.readEntry("Cxpe3", Cxpe3_);
|
||||
XiEqModelCoeffs_.readEntry("Cxpe4", Cxpe4_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,117 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::normBasicSubGrid
|
||||
|
||||
Description
|
||||
|
||||
|
||||
SourceFiles
|
||||
normBasicSubGrid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef normBasicSubGrid_H
|
||||
#define normBasicSubGrid_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class normBasicSubGrid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class normBasicSubGrid
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
// Constants in the equilibrium Xp equation
|
||||
scalar Cxpe1_;
|
||||
scalar Cxpe2_;
|
||||
scalar Cxpe3_;
|
||||
scalar Cxpe4_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
normBasicSubGrid(const normBasicSubGrid&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const normBasicSubGrid&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("normBasicSubGrid");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
normBasicSubGrid
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~normBasicSubGrid();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,115 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicXiSubG.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
defineTypeNameAndDebug(basicSubGrid, 0);
|
||||
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::basicSubGrid::basicSubGrid
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiGModel(XiGProperties, thermo, turbulence, Su),
|
||||
k1(XiGModelCoeffs_.get<scalar>("k1")),
|
||||
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::basicSubGrid::~basicSubGrid()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volVectorField& U = db.lookupObject<volVectorField>("U");
|
||||
const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
|
||||
tmp<volScalarField> tGtot = XiGModel_->G();
|
||||
volScalarField& Gtot = tGtot.ref();
|
||||
|
||||
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
|
||||
scalarField N(Nv.primitiveField()*Cw);
|
||||
|
||||
forAll(N, celli)
|
||||
{
|
||||
if (N[celli] > 1e-3)
|
||||
{
|
||||
Gtot[celli] += k1*mag(U[celli])/Lobs[celli];
|
||||
}
|
||||
}
|
||||
|
||||
return tGtot;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::Db() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
|
||||
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
|
||||
return XiGModel_->Db()
|
||||
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModel::read(XiGProperties);
|
||||
|
||||
XiGModelCoeffs_.readEntry("k1", k1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,138 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiGModels::basicSubGrid
|
||||
|
||||
Description
|
||||
|
||||
Basic sub-grid obstacle flame-wrinkling generation rate coefficient model.
|
||||
Details supplied by J Puttock 2/7/06.
|
||||
|
||||
\f$ G_{sub} \f$ denotes the generation coefficient and it is given by
|
||||
|
||||
\f[
|
||||
G_{sub} = k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{obs}}
|
||||
\frac{/Xi_{{sub}_{eq}}-1}{/Xi_{sub}}
|
||||
\f]
|
||||
|
||||
and the removal:
|
||||
|
||||
\f[
|
||||
- k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{sub}}
|
||||
\frac{\Xi_{sub}-1}{\Xi_{sub}}
|
||||
\f]
|
||||
|
||||
Finally, \f$ G_{sub} \f$ is added to generation rate \f$ G_{in} \f$
|
||||
due to the turbulence.
|
||||
|
||||
SourceFiles
|
||||
basicSubGrid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef basicSubGrid_H
|
||||
#define basicSubGrid_H
|
||||
|
||||
#include "XiGModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class basicSubGrid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class basicSubGrid
|
||||
:
|
||||
public XiGModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Sub-grid generation rate coefficient
|
||||
scalar k1;
|
||||
|
||||
//- Xi generation rate model due to turbulence
|
||||
autoPtr<XiGModel> XiGModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basicSubGrid(const basicSubGrid&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basicSubGrid&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("basicSubGridG");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
basicSubGrid
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~basicSubGrid();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiGProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiGModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,270 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "normBasicXiSubG.H"
|
||||
#include "zeroGradientFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
defineTypeNameAndDebug(normBasicSubGrid, 0);
|
||||
addToRunTimeSelectionTable(XiGModel, normBasicSubGrid, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::normBasicSubGrid::normBasicSubGrid
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
|
||||
// Bv_
|
||||
// (
|
||||
// IOobject
|
||||
// (
|
||||
// "Bv",
|
||||
// Su.mesh().facesInstance(),
|
||||
// Su.mesh(),
|
||||
// IOobject::MUST_READ,
|
||||
// IOobject::NO_WRITE
|
||||
// ),
|
||||
// Su.mesh()
|
||||
// ),
|
||||
k1_(XiGModelCoeffs_.get<scalar>("k1")),
|
||||
kb1_(XiGModelCoeffs_.get<scalar>("kb1")),
|
||||
kbe_(XiGModelCoeffs_.get<scalar>("kbe")),
|
||||
kbx_(XiGModelCoeffs_.get<scalar>("kbx")),
|
||||
k2_(XiGModelCoeffs_.get<scalar>("k2")),
|
||||
LOverCw_(XiGModelCoeffs_.get<scalar>("LOverCw"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::normBasicSubGrid::G() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
const volVectorField& U = db.lookupObject<volVectorField>("U");
|
||||
const volScalarField& b = db.lookupObject<volScalarField>("b");
|
||||
const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
|
||||
const volScalarField& St = db.lookupObject<volScalarField>("St");
|
||||
const volSymmTensorField& nsv = db.lookupObject<volSymmTensorField>("nsv");
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
const volSymmTensorField& Bv = db.lookupObject<volSymmTensorField>("Bv");
|
||||
|
||||
const scalarField Cw(pow(Su_.mesh().V(), 2.0/3.0));
|
||||
volScalarField CwVol
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"CwVol",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionSet(dimLength),
|
||||
Cw,
|
||||
zeroGradientFvPatchField<scalar>::typeName
|
||||
);
|
||||
CwVol.correctBoundaryConditions();
|
||||
|
||||
if (!db.foundObject<volScalarField>("Ep"))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Looking for Ep in db that does not exist" << nl
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
const volScalarField& Ep = db.lookupObject<volScalarField>("Ep");
|
||||
const volScalarField& Xp = db.lookupObject<volScalarField>("Xp");
|
||||
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
|
||||
|
||||
//tmp<volScalarField> tGtot = XiGModel_->G();
|
||||
auto tGtot = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tGtot",
|
||||
Su_.mesh().time().timeName(),
|
||||
Su_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
Su_.mesh(),
|
||||
dimensionedScalar(inv(dimTime), Zero)
|
||||
);
|
||||
auto& Gtot = tGtot.ref();
|
||||
|
||||
//calculating flame normal
|
||||
|
||||
volVectorField flNormal(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()));
|
||||
volScalarField mgb("mgb", mag(flNormal));
|
||||
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
|
||||
{
|
||||
volScalarField bc(b*(1.0-b));
|
||||
|
||||
dMgb += 1.0e-8*
|
||||
(bc*mgb)().weightedAverage(mesh.V())
|
||||
/(bc.weightedAverage(mesh.V()) + SMALL);
|
||||
}
|
||||
mgb += dMgb;
|
||||
flNormal /= mgb;
|
||||
|
||||
|
||||
auto tN = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
Su_.mesh().time().timeName(),
|
||||
Su_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
Su_.mesh(),
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
);
|
||||
auto& N = tN.ref();
|
||||
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
|
||||
|
||||
auto tns = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tns",
|
||||
Su_.mesh().time().timeName(),
|
||||
Su_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
Su_.mesh(),
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
);
|
||||
auto& ns = tns.ref();
|
||||
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
|
||||
|
||||
auto tB = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tB",
|
||||
Su_.mesh().time().timeName(),
|
||||
Su_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
Su_.mesh(),
|
||||
dimensionedSymmTensor(Bv.dimensions(), Zero)
|
||||
);
|
||||
auto& B = tB.ref();
|
||||
|
||||
B.primitiveFieldRef() = Bv.primitiveField()*sqrt(Cw);
|
||||
|
||||
volScalarField Np(max(N - (flNormal & ns & flNormal), scalar(1)));
|
||||
|
||||
// B_ is Bv*sqrt(Cw)
|
||||
volScalarField bl("bl",(flNormal & B & flNormal)/sqrt(Np));
|
||||
bl.min(1.0);
|
||||
|
||||
volScalarField flSpeed("flSpeed", ((U & flNormal) + St)*b/(b+SMALL)) ;
|
||||
|
||||
volScalarField up("up", sqrt((2.0/3.0)*turbulence_.k()));
|
||||
|
||||
const volScalarField Gtot1
|
||||
(
|
||||
"Gtot1",
|
||||
(
|
||||
k1_ + kb1_*min(pow(bl, kbe_), kbx_)
|
||||
)*mag(flSpeed)/(max(Lobs, LOverCw_*CwVol))
|
||||
);
|
||||
|
||||
const volScalarField Gtot2("Gtot2", k2_*Ep*Su_*Xi/(Xp - 0.999));
|
||||
|
||||
const volScalarField value(pos(N - 1.e-3)*neg(bl - 0.99));
|
||||
|
||||
Gtot = value*Gtot1+(1.0 - value)*Gtot2;
|
||||
|
||||
|
||||
/// if (Xi.mesh().time().outputTime())
|
||||
/// {
|
||||
/// Gtot.write();
|
||||
/// bl.write();
|
||||
/// Lobs.write();
|
||||
/// flSpeed.write();
|
||||
/// N.write();
|
||||
/// }
|
||||
|
||||
return tGtot;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::normBasicSubGrid::Db() const
|
||||
{
|
||||
// Not used //
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
|
||||
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
|
||||
|
||||
//return turbulence_.muEff()
|
||||
return Db + rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiGModels::normBasicSubGrid::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModel::read(XiGProperties);
|
||||
|
||||
XiGModelCoeffs_.readEntry("k1", k1_);
|
||||
XiGModelCoeffs_.readEntry("kb1", kb1_);
|
||||
XiGModelCoeffs_.readEntry("kbe", kbe_);
|
||||
XiGModelCoeffs_.readEntry("kbx", kbx_);
|
||||
XiGModelCoeffs_.readEntry("k2", k2_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,132 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiGModel::normBasicSubGrid
|
||||
|
||||
Description
|
||||
|
||||
|
||||
SourceFiles
|
||||
normBasicSubGrid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef normBasicSubGrid_H
|
||||
#define normBasicSubGrid_H
|
||||
|
||||
#include "XiGModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class normBasicSubGrid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class normBasicSubGrid
|
||||
:
|
||||
public XiGModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Sub-grid generation rate coefficient
|
||||
scalar k1_;
|
||||
|
||||
//- Sub-grid generation rate coefficient - * sqrt(b)
|
||||
scalar kb1_;
|
||||
|
||||
//- Sub-grid generation rate coefficient - * b
|
||||
scalar kbe_;
|
||||
|
||||
//- Sub-grid generation rate upper limit coefficient - * b
|
||||
scalar kbx_;
|
||||
|
||||
//- Sub-grid generation rate coefficient
|
||||
scalar k2_;
|
||||
|
||||
//- Maximum Lobs/CellWidth
|
||||
scalar LOverCw_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
normBasicSubGrid(const normBasicSubGrid&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const normBasicSubGrid&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("normBasicSubGridG");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
normBasicSubGrid
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~normBasicSubGrid() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiGProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiGModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -81,7 +81,7 @@ Foam::PDRDragModel::~PDRDragModel()
|
||||
|
||||
bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
|
||||
{
|
||||
PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs");
|
||||
PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
PDRDragModelCoeffs_.readEntry("drag", on_);
|
||||
|
||||
@ -89,10 +89,4 @@ bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
|
||||
}
|
||||
|
||||
|
||||
void Foam::PDRDragModel::writeFields() const
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -57,9 +57,10 @@ class PDRDragModel
|
||||
:
|
||||
public regIOobject
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
// Protected data
|
||||
|
||||
dictionary PDRDragModelCoeffs_;
|
||||
|
||||
@ -71,7 +72,9 @@ protected:
|
||||
bool on_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
PDRDragModel(const PDRDragModel&) = delete;
|
||||
@ -143,7 +146,7 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Return true if the drag model is switched on
|
||||
bool on() const noexcept
|
||||
bool on() const
|
||||
{
|
||||
return on_;
|
||||
}
|
||||
@ -158,16 +161,17 @@ public:
|
||||
using regIOobject::read;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& PDRProperties);
|
||||
virtual bool read(const dictionary& PDRProperties) = 0;
|
||||
|
||||
//- Write Data
|
||||
virtual bool writeData(Ostream&) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Write fields
|
||||
virtual void writeFields() const;
|
||||
virtual void writeFields() const
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -56,7 +56,8 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<PDRDragModel>(cstrIter()(dict, turbulence, rho, U, phi));
|
||||
return autoPtr<PDRDragModel>
|
||||
(cstrIter()(dict, turbulence, rho, U, phi));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,20 +93,24 @@ Foam::PDRDragModels::basic::~basic()
|
||||
|
||||
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
|
||||
{
|
||||
auto tDragDcu = tmp<volSymmTensorField>::New
|
||||
tmp<volSymmTensorField> tDragDcu
|
||||
(
|
||||
IOobject
|
||||
new volSymmTensorField
|
||||
(
|
||||
"tDragDcu",
|
||||
U_.mesh().time().constant(),
|
||||
IOobject
|
||||
(
|
||||
"tDragDcu",
|
||||
U_.mesh().time().constant(),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
|
||||
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
|
||||
)
|
||||
);
|
||||
auto& DragDcu = tDragDcu.ref();
|
||||
|
||||
volSymmTensorField& DragDcu = tDragDcu.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
@ -123,20 +127,24 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
|
||||
{
|
||||
auto tGk = tmp<volScalarField>::New
|
||||
tmp<volScalarField> tGk
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"tGk",
|
||||
U_.mesh().time().constant(),
|
||||
IOobject
|
||||
(
|
||||
"tGk",
|
||||
U_.mesh().time().constant(),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
)
|
||||
);
|
||||
auto& Gk = tGk.ref();
|
||||
|
||||
volScalarField& Gk = tGk.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
@ -151,7 +159,6 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
|
||||
+ Csk*betav*turbulence_.muEff()*sqr(Aw_)*magSqr(U_);
|
||||
}
|
||||
|
||||
|
||||
return tGk;
|
||||
}
|
||||
|
||||
@ -173,5 +180,4 @@ void Foam::PDRDragModels::basic::writeFields() const
|
||||
CR_.write();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -99,7 +99,7 @@ class basic
|
||||
:
|
||||
public PDRDragModel
|
||||
{
|
||||
// Private Data
|
||||
// Private data
|
||||
|
||||
dimensionedScalar Csu;
|
||||
dimensionedScalar Csk;
|
||||
|
||||
@ -1,296 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicSch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace PDRDragModels
|
||||
{
|
||||
defineTypeNameAndDebug(basicSch, 0);
|
||||
addToRunTimeSelectionTable(PDRDragModel, basicSch, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::PDRDragModels::basicSch::basicSch
|
||||
(
|
||||
const dictionary& PDRProperties,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
PDRDragModel(PDRProperties,turbulence, rho, U, phi),
|
||||
Csu("Csu", dimless, PDRDragModelCoeffs_),
|
||||
Csk("Csk", dimless, PDRDragModelCoeffs_),
|
||||
Aw_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Aw",
|
||||
U_.mesh().facesInstance(),
|
||||
U_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh()
|
||||
),
|
||||
|
||||
CR_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"CR",
|
||||
U_.mesh().facesInstance(),
|
||||
U_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh()
|
||||
),
|
||||
nrCoef_(PDRDragModelCoeffs_.get<scalar>("nrCoef")),
|
||||
nrExp2_(PDRDragModelCoeffs_.get<scalar>("nrExp2")),
|
||||
lCoef_(PDRDragModelCoeffs_.get<scalar>("lCoef")),
|
||||
maxSchFac_(PDRDragModelCoeffs_.get<scalar>("maxSchFac")),
|
||||
subGridSchelkin_(PDRDragModelCoeffs_.get<bool>("subGridSchelkin"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::PDRDragModels::basicSch::~basicSch()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basicSch::Dcu() const
|
||||
{
|
||||
auto tDragDcu = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tDragDcu",
|
||||
U_.mesh().time().constant(),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
|
||||
);
|
||||
auto& DragDcu = tDragDcu.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
const volScalarField& betav =
|
||||
U_.db().lookupObject<volScalarField>("betav");
|
||||
|
||||
DragDcu =
|
||||
(0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*sqr(Aw_);
|
||||
}
|
||||
|
||||
return tDragDcu;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basicSch::Gk() const
|
||||
{
|
||||
auto tGk = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tGk",
|
||||
U_.mesh().time().constant(),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
);
|
||||
auto& Gk = tGk.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
const volScalarField& betav =
|
||||
U_.db().lookupObject<volScalarField>("betav");
|
||||
|
||||
const volSymmTensorField& CT =
|
||||
U_.db().lookupObject<volSymmTensorField>("CT");
|
||||
|
||||
Gk =
|
||||
(0.5*rho_)*mag(U_)*(U_ & CT & U_)
|
||||
+ Csk*betav*turbulence_.muEff()*sqr(Aw_)*magSqr(U_);
|
||||
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
Gk *= this->SchelkinFactor();
|
||||
}
|
||||
}
|
||||
|
||||
return tGk;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::PDRDragModels::basicSch::SchelkinFactor() const
|
||||
{
|
||||
const volScalarField& Su_ = U_.db().lookupObject<volScalarField>("Su");
|
||||
const volScalarField& rhou_ = U_.db().lookupObject<volScalarField>("rhou");
|
||||
const volScalarField& muu_ = U_.db().lookupObject<volScalarField>("muu");
|
||||
|
||||
auto tfac = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tfac",
|
||||
U_.mesh().time().constant(),
|
||||
U_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
auto& schFac = tfac.ref();
|
||||
|
||||
const volScalarField& k = turbulence_.k();
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
|
||||
const volScalarField up(sqrt((2.0/3.0)*k));
|
||||
const volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
|
||||
|
||||
volScalarField Rs(Su_*l*rhou_/muu_);
|
||||
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
schFac = max
|
||||
(
|
||||
1.0,
|
||||
min
|
||||
(
|
||||
maxSchFac_,
|
||||
pow(Rs, 2.0 * SchelkinExponent(nrCoef_, nrExp2_, Su_))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return tfac;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basicSch::SchelkinExponent
|
||||
(
|
||||
const scalar nrCoef,
|
||||
const scalar nrExp,
|
||||
const volScalarField& Su
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = Su.mesh();
|
||||
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
|
||||
auto tN = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
);
|
||||
auto& N = tN.ref();
|
||||
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
auto tns = tmp<volSymmTensorField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tns",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
);
|
||||
auto& ns = tns.ref();
|
||||
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
const volVectorField Uhat
|
||||
(
|
||||
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
|
||||
);
|
||||
|
||||
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1.0))));
|
||||
|
||||
//Re use tN
|
||||
N.primitiveFieldRef() =
|
||||
nrCoef*((scalar(1.0) - pow(nrExp, nr))/(1.0 - nrExp) - scalar(1.0));
|
||||
|
||||
return tN;
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool Foam::PDRDragModels::basicSch::read(const dictionary& PDRProperties)
|
||||
{
|
||||
PDRDragModel::read(PDRProperties);
|
||||
|
||||
PDRDragModelCoeffs_.readEntry("Csu", Csu.value());
|
||||
PDRDragModelCoeffs_.readEntry("Csk", Csk.value());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Foam::PDRDragModels::basicSch::writeFields() const
|
||||
{
|
||||
Aw_.write();
|
||||
CR_.write();
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,141 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::PDRDragModels::basicSch
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
basicSch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef basicSch_H
|
||||
#define basicSch_H
|
||||
|
||||
#include "PDRDragModel.H"
|
||||
#include "XiEqModel.H"
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace PDRDragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class basicSch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class basicSch
|
||||
:
|
||||
public PDRDragModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
dimensionedScalar Csu;
|
||||
dimensionedScalar Csk;
|
||||
volScalarField Aw_;
|
||||
volSymmTensorField CR_;
|
||||
|
||||
//- Schelkin effect Model constants
|
||||
const scalar nrCoef_;
|
||||
const scalar nrExp2_;
|
||||
const scalar lCoef_;
|
||||
const scalar maxSchFac_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basicSch(const basicSch&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basicSch&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("basicSch");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
basicSch
|
||||
(
|
||||
const dictionary& PDRProperties,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~basicSch();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the momentum drag coefficient
|
||||
virtual tmp<volSymmTensorField> Dcu() const;
|
||||
|
||||
//- Return the momentum drag turbulence generation rate
|
||||
virtual tmp<volScalarField> Gk() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& PDRProperties);
|
||||
|
||||
//- Write fields
|
||||
void writeFields() const;
|
||||
|
||||
//- Return the Schelkin factor for drag turbulence generation rate
|
||||
tmp<volScalarField> SchelkinFactor() const;
|
||||
|
||||
//- Return the sub-grid Schelkin effect exponent
|
||||
tmp<volScalarField> SchelkinExponent
|
||||
(
|
||||
const scalar,
|
||||
const scalar,
|
||||
const volScalarField&
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace PDRDragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,8 +5,8 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -29,7 +29,6 @@ License
|
||||
#include "PDRkEpsilon.H"
|
||||
#include "PDRDragModel.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -71,40 +70,16 @@ PDRkEpsilon::PDRkEpsilon
|
||||
modelName
|
||||
),
|
||||
|
||||
C5_(coeffDict_.get<scalar>("C5")),
|
||||
C6_(coeffDict_.get<scalar>("C6")),
|
||||
maxLOverCellW_(coeffDict_.get<scalar>("maxLOverCellW")),
|
||||
lCoef_(coeffDict_.get<scalar>("lCoef")),
|
||||
noTurbUntil_
|
||||
C4_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
dimensioned<scalar>::getOrAddToDict
|
||||
(
|
||||
"noTurbUntil",
|
||||
"C4",
|
||||
coeffDict_,
|
||||
0.0
|
||||
0.1
|
||||
)
|
||||
),
|
||||
LOverLobs_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"LOverLobs",
|
||||
coeffDict_,
|
||||
0.2
|
||||
)
|
||||
),
|
||||
LOverMobs_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"LOverMobs",
|
||||
coeffDict_,
|
||||
0.0
|
||||
)
|
||||
),
|
||||
bMin_(coeffDict_.get<scalar>("bMin")),
|
||||
flameFilteredG_(coeffDict_.get<bool>("flameFilteredG"))
|
||||
{}
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
@ -119,9 +94,7 @@ bool PDRkEpsilon::read()
|
||||
{
|
||||
if (RASModel::read())
|
||||
{
|
||||
noTurbUntil_.readIfPresent(coeffDict_);
|
||||
LOverLobs_.readIfPresent(coeffDict_);
|
||||
LOverMobs_.readIfPresent(coeffDict_);
|
||||
C4_.readIfPresent(coeffDict_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -137,12 +110,16 @@ void PDRkEpsilon::correct()
|
||||
nut_ = Cmu_*sqr(k_)/epsilon_;
|
||||
nut_.correctBoundaryConditions();
|
||||
|
||||
// Re-calculate thermal diffusivity
|
||||
//***HGWalphat_ = mut_/Prt_;
|
||||
//alphat_.correctBoundaryConditions();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RASModel::correct();
|
||||
|
||||
volScalarField divU("divU",fvc::div(phi_/fvc::interpolate(rho_)));
|
||||
volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_)));
|
||||
|
||||
if (mesh_.moving())
|
||||
{
|
||||
@ -150,9 +127,7 @@ void PDRkEpsilon::correct()
|
||||
}
|
||||
|
||||
tmp<volTensorField> tgradU = fvc::grad(U_);
|
||||
|
||||
volScalarField G(GName(), rho_*nut_*(tgradU() && dev(twoSymm(tgradU()))));
|
||||
|
||||
tgradU.clear();
|
||||
|
||||
// Update epsilon and G at the wall
|
||||
@ -166,102 +141,59 @@ void PDRkEpsilon::correct()
|
||||
const volScalarField& Lobs =
|
||||
U_.db().lookupObject<volScalarField>("Lobs");
|
||||
|
||||
const volVectorField& U = mesh_.lookupObject<volVectorField>("U");
|
||||
|
||||
const volScalarField& b = mesh_.lookupObject<volScalarField>("b");
|
||||
|
||||
const scalarField Cw(pow(mesh_.V(), 2.0/3.0));
|
||||
|
||||
const PDRDragModel& drag =
|
||||
U_.db().lookupObject<PDRDragModel>("PDRDragModel");
|
||||
|
||||
volScalarField GR(drag.Gk());
|
||||
|
||||
volScalarField LD
|
||||
volScalarField LI
|
||||
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)));
|
||||
|
||||
// Dissipation equation
|
||||
tmp<fvScalarMatrix> epsEqn
|
||||
(
|
||||
"LD",
|
||||
(LOverLobs_)*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL))
|
||||
betav*fvm::ddt(rho_, epsilon_)
|
||||
+ fvm::div(phi_, epsilon_)
|
||||
- fvm::laplacian(rho_*DepsilonEff(), epsilon_)
|
||||
==
|
||||
C1_*betav*G*epsilon_/k_
|
||||
+ 1.5*pow(Cmu_, 3.0/4.0)*GR*sqrt(k_)/LI
|
||||
- fvm::SuSp(((2.0/3.0)*C1_)*betav*rho_*divU, epsilon_)
|
||||
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
|
||||
);
|
||||
|
||||
LD.primitiveFieldRef() = min(LD.primitiveField(), maxLOverCellW_*sqrt(Cw));
|
||||
epsEqn.ref().relax();
|
||||
|
||||
const volScalarField LI(lCoef_*pow(k_, 3.0/2.0)/epsilon_);
|
||||
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
|
||||
|
||||
IOdictionary combustionProperties
|
||||
solve(epsEqn);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
|
||||
|
||||
// Turbulent kinetic energy equation
|
||||
|
||||
tmp<fvScalarMatrix> kEqn
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
mesh_.time().constant(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
betav*fvm::ddt(rho_, k_)
|
||||
+ fvm::div(phi_, k_)
|
||||
- fvm::laplacian(rho_*DkEff(), k_)
|
||||
==
|
||||
betav*G + GR
|
||||
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
|
||||
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
|
||||
);
|
||||
|
||||
ignition ign(combustionProperties, mesh_.time(), U.mesh());
|
||||
kEqn.ref().relax();
|
||||
solve(kEqn);
|
||||
bound(k_, kMin_);
|
||||
|
||||
dimensionedVector ignLoc("ignLoc", dimLength, ign.sites()[0].location());
|
||||
|
||||
dimensionedScalar filtRad2
|
||||
(
|
||||
"filtRad2",
|
||||
dimLength,
|
||||
6.0*ign.sites()[0].diameter()
|
||||
);
|
||||
|
||||
if (flameFilteredG_)
|
||||
{
|
||||
const volScalarField filDist(mag(mesh_.C() - ignLoc));
|
||||
const volScalarField filterG(pos(filDist - filtRad2));
|
||||
const volScalarField filterdivU(pos(filDist - filtRad2));
|
||||
const volScalarField filterGR(pos(filDist - filtRad2)*pos(b - bMin_));
|
||||
|
||||
G *= filterG;
|
||||
GR *= filterGR;
|
||||
divU *= filterdivU;
|
||||
}
|
||||
|
||||
volScalarField Cl(C5_ + (C6_*((LI - LD)/LI)));
|
||||
Cl.max(0.0);
|
||||
|
||||
if (mesh_.time() > noTurbUntil_)
|
||||
{
|
||||
tmp<fvScalarMatrix> epsEqn
|
||||
(
|
||||
betav*fvm::ddt(rho_, epsilon_)
|
||||
+ fvm::div(phi_, epsilon_)
|
||||
- fvm::laplacian(rho_*DepsilonEff(), epsilon_)
|
||||
==
|
||||
C1_*betav*G*epsilon_/k_
|
||||
+ Cl*(epsilon_/k_)*GR
|
||||
- fvm::SuSp(((2.0/3.0)*C1_+C3_)*betav*rho_*divU, epsilon_)
|
||||
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
|
||||
);
|
||||
|
||||
epsEqn.ref().relax();
|
||||
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
|
||||
solve(epsEqn);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
|
||||
tmp<fvScalarMatrix> kEqn
|
||||
(
|
||||
betav*fvm::ddt(rho_, k_)
|
||||
+ fvm::div(phi_, k_)
|
||||
- fvm::laplacian(rho_*DkEff(), k_)
|
||||
==
|
||||
(betav*G + GR)
|
||||
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
|
||||
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
|
||||
);
|
||||
|
||||
kEqn.ref().relax();
|
||||
solve(kEqn);
|
||||
bound(k_, kMin_);
|
||||
}
|
||||
// Re-calculate viscosity
|
||||
nut_ = Cmu_*sqr(k_)/epsilon_;
|
||||
nut_.correctBoundaryConditions();
|
||||
|
||||
// Re-calculate thermal diffusivity
|
||||
//***HGWalphat_ = mut_/Prt_;
|
||||
//alphat_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,6 +30,30 @@ Description
|
||||
Standard k-epsilon turbulence model with additional source terms
|
||||
corresponding to PDR basic drag model (\link basic.H \endlink)
|
||||
|
||||
The default model coefficients correspond to the following:
|
||||
\verbatim
|
||||
PDRkEpsilonCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
C3 -0.33; // only for compressible
|
||||
C4 0.1;
|
||||
sigmak 1.0; // only for compressible
|
||||
sigmaEps 1.3;
|
||||
Prt 1.0; // only for compressible
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
The turbulence source term \f$ G_{R} \f$ appears in the
|
||||
\f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to
|
||||
interaction with unresolved obstacles.
|
||||
|
||||
In the \f$ \epsilon \f$ equation \f$ C_{1} G_{R} \f$ is added as a source
|
||||
term.
|
||||
|
||||
In the \f$ \kappa \f$ equation \f$ G_{R} \f$ is added as a source term.
|
||||
|
||||
SourceFiles
|
||||
PDRkEpsilon.C
|
||||
|
||||
@ -40,7 +63,6 @@ SourceFiles
|
||||
#define compressiblePDRkEpsilon_H
|
||||
|
||||
#include "kEpsilon.H"
|
||||
#include "ignition.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -66,18 +88,10 @@ class PDRkEpsilon
|
||||
>
|
||||
>
|
||||
{
|
||||
// Private Data
|
||||
// Private data
|
||||
|
||||
// Model coefficients
|
||||
scalar C5_;
|
||||
scalar C6_;
|
||||
scalar maxLOverCellW_;
|
||||
scalar lCoef_;
|
||||
dimensionedScalar noTurbUntil_;
|
||||
dimensionedScalar LOverLobs_;
|
||||
dimensionedScalar LOverMobs_;
|
||||
scalar bMin_;
|
||||
bool flameFilteredG_;
|
||||
dimensionedScalar C4_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -36,9 +36,10 @@ Description
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
scalarField sumPhi
|
||||
(
|
||||
fvc::surfaceSum(mag(phiSt))().primitiveField()/rho.primitiveField()
|
||||
fvc::surfaceSum(mag(phiSt))().primitiveField()
|
||||
/ rho.primitiveField()
|
||||
);
|
||||
|
||||
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
betav*fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
betav*rho*g
|
||||
|
||||
@ -1,258 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "BLMgMaXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(BLMgMaXiEq, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, BLMgMaXiEq, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::BLMgMaXiEq::BLMgMaXiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
|
||||
kaCoef_(XiEqModelCoeffs_.get<scalar>("kaCoef")),
|
||||
lowK0_(XiEqModelCoeffs_.get<scalar>("lowK0")),
|
||||
lowKg_(XiEqModelCoeffs_.get<scalar>("lowKg")),
|
||||
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
|
||||
alphaCoefP_(XiEqModelCoeffs_.get<scalar>("alphaCoefP")),
|
||||
betaCoefP_(XiEqModelCoeffs_.get<scalar>("betaCoefP")),
|
||||
alphaCoefN_(XiEqModelCoeffs_.get<scalar>("alphaCoefN")),
|
||||
betaCoefN_(XiEqModelCoeffs_.get<scalar>("betaCoefN")),
|
||||
maLim_(XiEqModelCoeffs_.get<scalar>("maLim")),
|
||||
maLim1_(XiEqModelCoeffs_.get<scalar>("maLim1")),
|
||||
quenchCoef_(XiEqModelCoeffs_.get<scalar>("quenchCoef")),
|
||||
quenchExp_(XiEqModelCoeffs_.get<scalar>("quenchExp")),
|
||||
quenchM_(XiEqModelCoeffs_.get<scalar>("quenchM")),
|
||||
quenchRate1_(XiEqModelCoeffs_.get<scalar>("quenchRate1")),
|
||||
quenchRate2_(XiEqModelCoeffs_.get<scalar>("quenchRate2")),
|
||||
lCoef_(XiEqModelCoeffs_.get<scalar>("lCoef")),
|
||||
SuMin_(0.01*Su.average()),
|
||||
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
|
||||
nrExp_(XiEqModelCoeffs_.get<scalar>("nrExp")),
|
||||
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin")),
|
||||
MaModel
|
||||
(
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
Su.mesh().time().constant(),
|
||||
Su.mesh(),
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
),
|
||||
thermo
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::BLMgMaXiEq::~BLMgMaXiEq()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::BLMgMaXiEq::XiEq() const
|
||||
{
|
||||
const volScalarField& k = turbulence_.k();
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
volScalarField up("up", sqrt((2.0/3.0)*k));
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
up.primitiveFieldRef() +=
|
||||
calculateSchelkinEffect(uPrimeCoef_, nrExp_);
|
||||
}
|
||||
|
||||
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
|
||||
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
|
||||
|
||||
volScalarField upBySu("upBySu", up/(Su_ + SuMin_));
|
||||
volScalarField K("K", kaCoef_*upBySu*upBySu/sqrt(Rl));
|
||||
volScalarField Ma("Ma", MaModel.Ma());
|
||||
|
||||
volScalarField regime("regime", MaModel.Ma()*scalar(0.0));
|
||||
|
||||
auto tXiEq = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"XiEq",
|
||||
epsilon.time().timeName(),
|
||||
epsilon.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
epsilon.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
const objectRegistry& db = Su_.db();
|
||||
|
||||
const volScalarField& b = db.lookupObject<volScalarField>("b");
|
||||
|
||||
const volScalarField multiP1(0.0*pos(b - 0.99) + 1.0*neg(b - 0.99));
|
||||
const volScalarField multiP2(1.0*pos(b - 0.01) + 0.0*neg(b - 0.01));
|
||||
|
||||
volScalarField& xieq = tXiEq.ref();
|
||||
|
||||
forAll(xieq, celli)
|
||||
{
|
||||
scalar alpha;
|
||||
scalar beta;
|
||||
scalar gulderMa;
|
||||
|
||||
if (Ma[celli]>= 0)
|
||||
{
|
||||
gulderMa =
|
||||
1.0
|
||||
+ (0.1402 - 0.007*Ma[celli])
|
||||
* upBySu[celli]*sqrt(upBySu[celli]/K[celli]);
|
||||
|
||||
regime[celli] = multiP1[celli]*multiP2[celli];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gulderMa =
|
||||
1.0
|
||||
+ (0.005*Ma[celli]*Ma[celli]+0.01*Ma[celli] + 0.125)
|
||||
* upBySu[celli]*sqrt(upBySu[celli]/K[celli]);
|
||||
|
||||
regime[celli] = 2*multiP1[celli]*multiP2[celli];
|
||||
}
|
||||
|
||||
|
||||
if (K[celli] < (lowK0_ + lowKg_*Ma[celli]) )
|
||||
{
|
||||
xieq[celli] = gulderMa;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Ma[celli] >= 0.0)
|
||||
{
|
||||
alpha = alphaCoefP_*(maLim_ - Ma[celli]);
|
||||
beta = betaCoefP_*(maLim_ - Ma[celli]);
|
||||
regime[celli] = 3*multiP1[celli]*multiP2[celli];
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = alphaCoefN_*(maLim1_ - Ma[celli]) ;
|
||||
beta = betaCoefN_*(maLim_ + Ma[celli]);
|
||||
regime[celli] = 4*multiP1[celli]*multiP2[celli];
|
||||
}
|
||||
xieq[celli] = XiEqCoef_*alpha*pow(K[celli], beta)*upBySu[celli];
|
||||
}
|
||||
|
||||
if (Ma[celli] > -3.0 && Ma[celli] < 11.0)
|
||||
{
|
||||
scalar K0p8 = quenchCoef_*pow( Ma[celli] - quenchM_, quenchExp_);
|
||||
scalar quenchRate = quenchRate1_ + quenchRate2_*Ma[celli];
|
||||
if (K[celli] > (K0p8 - 0.223/quenchRate))
|
||||
{
|
||||
xieq[celli] *= 0.8*exp(-quenchRate*(K[celli] - K0p8));
|
||||
regime[celli] = 5*multiP1[celli]*multiP2[celli];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(xieq.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& xieqp = xieq.boundaryFieldRef()[patchi];
|
||||
const scalarField& Kp = K.boundaryField()[patchi];
|
||||
const scalarField& Map = Ma.boundaryField()[patchi];
|
||||
const scalarField& upBySup = upBySu.boundaryField()[patchi];
|
||||
|
||||
forAll(xieqp, facei)
|
||||
{
|
||||
scalar alpha;
|
||||
scalar beta;
|
||||
|
||||
if (Map[facei] > 0.0)
|
||||
{
|
||||
alpha = alphaCoefP_*(maLim_ - Map[facei]);
|
||||
beta = betaCoefP_*(maLim_ - Map[facei]);
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = alphaCoefN_*(maLim_ - Map[facei]);
|
||||
beta = betaCoefN_*(maLim_ + Map[facei]);
|
||||
}
|
||||
xieqp[facei] =
|
||||
XiEqCoef_*alpha*pow(Kp[facei], beta)*upBySup[facei];
|
||||
|
||||
if (Map[facei] > -3.0 && Map[facei] < 11.0)
|
||||
{
|
||||
scalar K0p8 = quenchCoef_*pow(Map[facei] - quenchM_, quenchExp_);
|
||||
scalar quenchRate = quenchRate1_ + quenchRate2_*Ma[facei];
|
||||
|
||||
if (Kp[facei] > (K0p8 - 0.223/quenchRate))
|
||||
{
|
||||
xieqp[facei] *= 0.8*exp(-quenchRate*(Kp[facei] - K0p8));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<<
|
||||
"Markstein Number out of range for Quench Formulation" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tXiEq;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::BLMgMaXiEq::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,147 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModel::BLMgMaXiEq
|
||||
|
||||
Description
|
||||
Model for XiEq based on Bradley, Lawes and Mansour (2011)
|
||||
Cobustion and Falme, 158, 123 correlation
|
||||
with a linear correction function to give a plausible profile for XiEq.
|
||||
See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar
|
||||
flame speed model.
|
||||
|
||||
SourceFiles
|
||||
BLMgMaXiEq.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef BLMgMaXiEq_H
|
||||
#define BLMgMaXiEq_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
#include "SCOPELaminarFlameSpeed.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class BLMgMaXiEq Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class BLMgMaXiEq
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Model constants
|
||||
|
||||
scalar kaCoef_;
|
||||
scalar lowK0_;
|
||||
scalar lowKg_;
|
||||
scalar XiEqCoef_;
|
||||
scalar alphaCoefP_;
|
||||
scalar betaCoefP_;
|
||||
scalar alphaCoefN_;
|
||||
scalar betaCoefN_;
|
||||
scalar maLim_;
|
||||
scalar maLim1_;
|
||||
scalar quenchCoef_, quenchExp_, quenchM_;
|
||||
scalar quenchRate1_, quenchRate2_;
|
||||
scalar lCoef_;
|
||||
|
||||
//- Minimum Su
|
||||
dimensionedScalar SuMin_;
|
||||
|
||||
//- Schelkin effect Model constants
|
||||
scalar uPrimeCoef_;
|
||||
scalar nrExp_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
//- The SCOPE laminar flame speed model used to obtain the
|
||||
// Marstein number. Note: the laminar flame speed need not be
|
||||
// obtained form the same model.
|
||||
laminarFlameSpeedModels::SCOPE MaModel;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
BLMgMaXiEq(const BLMgMaXiEq&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const BLMgMaXiEq&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("BLMgMaXiEq");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
BLMgMaXiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~BLMgMaXiEq();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,8 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,21 +45,22 @@ namespace XiEqModels
|
||||
Foam::XiEqModels::Gulder::Gulder
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
|
||||
SuMin_(0.01*Su.average()),
|
||||
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
|
||||
nrExp_(XiEqModelCoeffs_.get<scalar>("nrExp")),
|
||||
subGridSchelkin_
|
||||
(
|
||||
XiEqModelCoeffs_.get<bool>("subGridSchelkin")
|
||||
)
|
||||
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::Gulder::~Gulder()
|
||||
{}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
|
||||
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_, nrExp_);
|
||||
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
}
|
||||
|
||||
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
|
||||
@ -97,7 +97,6 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
|
||||
|
||||
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
|
||||
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
|
||||
XiEqModelCoeffs_.readEntry("nrExp", nrExp_);
|
||||
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
|
||||
|
||||
return true;
|
||||
|
||||
@ -55,7 +55,7 @@ class Gulder
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private Data
|
||||
// Private data
|
||||
|
||||
//- Model constant
|
||||
scalar XiEqCoef_;
|
||||
@ -66,8 +66,6 @@ class Gulder
|
||||
//- Schelkin effect Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
scalar nrExp_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
@ -93,7 +91,6 @@ public:
|
||||
Gulder
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -101,7 +98,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Gulder() = default;
|
||||
virtual ~Gulder();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -111,6 +108,7 @@ public:
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SCOPEBlendXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(SCOPEBlend, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::SCOPEBlend::SCOPEBlend
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqModelL_
|
||||
(
|
||||
XiEqModel::New
|
||||
(
|
||||
XiEqModelCoeffs_.subDict("XiEqModelL"),
|
||||
thermo,
|
||||
turbulence,
|
||||
Su
|
||||
)
|
||||
),
|
||||
XiEqModelH_
|
||||
(
|
||||
XiEqModel::New
|
||||
(
|
||||
XiEqModelCoeffs_.subDict("XiEqModelH"),
|
||||
thermo,
|
||||
turbulence,
|
||||
Su
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::SCOPEBlend::~SCOPEBlend()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEBlend::XiEq() const
|
||||
{
|
||||
return pow
|
||||
(
|
||||
pow4(1.0/XiEqModelL_->XiEq()) + pow4(1.0/XiEqModelH_->XiEq()),
|
||||
-0.25
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,123 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::SCOPEBlend
|
||||
|
||||
Description
|
||||
Simple SCOPEBlendXiEq model for XiEq based on SCOPEXiEqs correlation
|
||||
with a linear correction function to give a plausible profile for XiEq.
|
||||
See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE
|
||||
laminar flame speed model.
|
||||
|
||||
SourceFiles
|
||||
SCOPEBlend.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SCOPEBlend_H
|
||||
#define SCOPEBlend_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class SCOPEBlend Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class SCOPEBlend
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Low turbulence intensity equilibrium Xi model
|
||||
autoPtr<XiEqModel> XiEqModelL_;
|
||||
|
||||
//- High turbulence intensity equilibrium Xi model
|
||||
autoPtr<XiEqModel> XiEqModelH_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
SCOPEBlend(const SCOPEBlend&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const SCOPEBlend&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("SCOPEBlend");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
SCOPEBlend
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~SCOPEBlend();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,159 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SCOPEXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(SCOPEXiEq, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
|
||||
XiEqExp_(XiEqModelCoeffs_.get<scalar>("XiEqExp")),
|
||||
lCoef_(XiEqModelCoeffs_.get<scalar>("lCoef")),
|
||||
SuMin_(0.01*Su.average()),
|
||||
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
|
||||
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin")),
|
||||
MaModel
|
||||
(
|
||||
Su.mesh().lookupObject<IOdictionary>("combustionProperties"),
|
||||
thermo
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
{
|
||||
const volScalarField& k = turbulence_.k();
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
|
||||
volScalarField up(sqrt((2.0/3.0)*k));
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
}
|
||||
|
||||
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
|
||||
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
|
||||
|
||||
volScalarField upBySu(up/(Su_ + SuMin_));
|
||||
volScalarField K(0.157*upBySu/sqrt(Rl));
|
||||
volScalarField Ma(MaModel.Ma());
|
||||
|
||||
tmp<volScalarField> tXiEq
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"XiEq",
|
||||
epsilon.time().timeName(),
|
||||
epsilon.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
epsilon.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& xieq = tXiEq.ref();
|
||||
|
||||
forAll(xieq, celli)
|
||||
{
|
||||
if (Ma[celli] > 0.01)
|
||||
{
|
||||
xieq[celli] =
|
||||
XiEqCoef_*pow(K[celli]*Ma[celli], -XiEqExp_)*upBySu[celli];
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField::Boundary& xieqBf = xieq.boundaryFieldRef();
|
||||
|
||||
forAll(xieq.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& xieqp = xieqBf[patchi];
|
||||
const scalarField& Kp = K.boundaryField()[patchi];
|
||||
const scalarField& Map = Ma.boundaryField()[patchi];
|
||||
const scalarField& upBySup = upBySu.boundaryField()[patchi];
|
||||
|
||||
forAll(xieqp, facei)
|
||||
{
|
||||
if (Ma[facei] > 0.01)
|
||||
{
|
||||
xieqp[facei] =
|
||||
XiEqCoef_*pow(Kp[facei]*Map[facei], -XiEqExp_)
|
||||
*upBySup[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tXiEq;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
|
||||
XiEqModelCoeffs_.readEntry("XiEqExp", XiEqExp_);
|
||||
XiEqModelCoeffs_.readEntry("lCoef", lCoef_);
|
||||
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
|
||||
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::SCOPEXiEq
|
||||
|
||||
Description
|
||||
Simple SCOPEXiEq model for XiEq based on SCOPEXiEqs correlation
|
||||
with a linear correction function to give a plausible profile for XiEq.
|
||||
See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar
|
||||
flame speed model.
|
||||
|
||||
SourceFiles
|
||||
SCOPEXiEq.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SCOPEXiEq_H
|
||||
#define SCOPEXiEq_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
#include "SCOPELaminarFlameSpeed.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class SCOPEXiEq Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class SCOPEXiEq
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Model constant
|
||||
scalar XiEqCoef_;
|
||||
|
||||
// Model constant
|
||||
scalar XiEqExp_;
|
||||
|
||||
// Model constant
|
||||
scalar lCoef_;
|
||||
|
||||
//- Minimum Su
|
||||
dimensionedScalar SuMin_;
|
||||
|
||||
//- Schelkin effect Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
//- The SCOPE laminar flame speed model used to obtain the
|
||||
// Marstein number. Note: the laminar flame speed need not be
|
||||
// obtained form the same model.
|
||||
laminarFlameSpeedModels::SCOPE MaModel;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
SCOPEXiEq(const SCOPEXiEq&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const SCOPEXiEq&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("SCOPEXiEq");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
SCOPEXiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~SCOPEXiEq();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,8 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,7 +41,6 @@ namespace Foam
|
||||
Foam::XiEqModel::XiEqModel
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -52,7 +50,7 @@ Foam::XiEqModel::XiEqModel
|
||||
(
|
||||
XiEqProperties.subDict
|
||||
(
|
||||
XiEqProperties.get<word>(modelType) + "Coeffs"
|
||||
XiEqProperties.get<word>("XiEqModel") + "Coeffs"
|
||||
)
|
||||
),
|
||||
thermo_(thermo),
|
||||
@ -71,51 +69,56 @@ Foam::XiEqModel::~XiEqModel()
|
||||
|
||||
bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
|
||||
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
|
||||
XiEqModelCoeffs_ = XiEqProperties.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Foam::XiEqModel::writeFields() const
|
||||
{}
|
||||
{
|
||||
//***HGW It is not clear why B is written here
|
||||
if (Su_.mesh().foundObject<volSymmTensorField>("B"))
|
||||
{
|
||||
const volSymmTensorField& B =
|
||||
Su_.mesh().lookupObject<volSymmTensorField>("B");
|
||||
B.write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>Foam::XiEqModel::calculateSchelkinEffect
|
||||
(
|
||||
const scalar uPrimeCoef,
|
||||
const scalar nrExp
|
||||
) const
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
{
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
|
||||
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
|
||||
auto tN = tmp<volScalarField>::New
|
||||
tmp<volScalarField> tN
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"tN",
|
||||
mesh.time().timeName(),
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
)
|
||||
);
|
||||
auto& N = tN.ref();
|
||||
|
||||
volScalarField& N = tN.ref();
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
auto tns = tmp<volSymmTensorField>::New
|
||||
volSymmTensorField ns
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -128,8 +131,6 @@ Foam::tmp<Foam::volScalarField>Foam::XiEqModel::calculateSchelkinEffect
|
||||
mesh,
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
);
|
||||
auto& ns = tns.ref();
|
||||
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
const volVectorField Uhat
|
||||
@ -143,8 +144,10 @@ Foam::tmp<Foam::volScalarField>Foam::XiEqModel::calculateSchelkinEffect
|
||||
|
||||
const scalarField upLocal(uPrimeCoef*sqrt((U & CT & U)*cellWidth));
|
||||
|
||||
//Re use tN
|
||||
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, nrExp)) - 1.0);
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0));
|
||||
|
||||
// Re use tN
|
||||
N.primitiveFieldRef() = upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0);
|
||||
|
||||
return tN;
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -29,6 +28,12 @@ Class
|
||||
|
||||
Description
|
||||
Base-class for all XiEq models used by the b-XiEq combustion model.
|
||||
The available models are :
|
||||
\link basicXiSubXiEq.H \endlink
|
||||
\link Gulder.H \endlink
|
||||
\link instabilityXiEq.H \endlink
|
||||
\link SCOPEBlendXiEq.H \endlink
|
||||
\link SCOPEXiEq.H \endlink
|
||||
|
||||
SourceFiles
|
||||
XiEqModel.C
|
||||
@ -54,9 +59,10 @@ namespace Foam
|
||||
|
||||
class XiEqModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
// Protected data
|
||||
|
||||
//- Dictionary
|
||||
dictionary XiEqModelCoeffs_;
|
||||
@ -71,7 +77,9 @@ protected:
|
||||
const volScalarField& Su_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiEqModel(const XiEqModel&) = delete;
|
||||
@ -95,14 +103,12 @@ public:
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
),
|
||||
(
|
||||
XiEqProperties,
|
||||
modelType,
|
||||
thermo,
|
||||
turbulence,
|
||||
Su
|
||||
@ -116,7 +122,6 @@ public:
|
||||
static autoPtr<XiEqModel> New
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -129,7 +134,6 @@ public:
|
||||
XiEqModel
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -143,14 +147,13 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const = 0;
|
||||
virtual tmp<volScalarField> XiEq() const
|
||||
{
|
||||
return turbulence_.muEff();
|
||||
}
|
||||
|
||||
// Only used by sperseded modles
|
||||
tmp<volScalarField> calculateSchelkinEffect
|
||||
(
|
||||
const scalar uPrimeCoef,
|
||||
const scalar nrExp
|
||||
) const;
|
||||
//- Return the sub-grid Schelkin effect
|
||||
tmp<volScalarField> calculateSchelkinEffect(const scalar) const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties) = 0;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,15 +33,14 @@ License
|
||||
Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const word& modelName,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
{
|
||||
const word modelType(dict.get<word>(modelName));
|
||||
const word modelType(dict.get<word>("XiEqModel"));
|
||||
|
||||
Info<< "Selecting flame-wrinkling model Eq " << modelType << endl;
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
@ -50,16 +49,13 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
modelName,
|
||||
"XiEqModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<XiEqModel>(cstrIter()
|
||||
(
|
||||
dict, modelName, thermo, turbulence, Su)
|
||||
);
|
||||
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,133 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "instability2XiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(instability2XiEq, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, instability2XiEq, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::instability2XiEq::instability2XiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
|
||||
saModel_
|
||||
(
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
Su.mesh().time().constant(),
|
||||
Su.mesh(),
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
),
|
||||
thermo
|
||||
),
|
||||
CIn_(saModel_.CIn()),
|
||||
defaultCIn_(XiEqModelCoeffs_.get<scalar>("defaultCIn")),
|
||||
XiEqInFade_(XiEqModelCoeffs_.get<scalar>("XiEqInFade")),
|
||||
XiEqModel_
|
||||
(
|
||||
XiEqModel::New(XiEqModelCoeffs_, modelType, thermo, turbulence, Su)
|
||||
)
|
||||
{
|
||||
if (CIn_ <= 0.0)
|
||||
{
|
||||
CIn_ = defaultCIn_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability2XiEq::XiEq() const
|
||||
{
|
||||
IOdictionary combustionProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
Su_.mesh().time().constant(),
|
||||
Su_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
ignition ign(combustionProperties, Su_.mesh().time(), Su_.mesh());
|
||||
|
||||
//const scalar ignTim = ign.sites()[0].tmIgn();
|
||||
const scalar curTime = Su_.mesh().time().value();
|
||||
const scalar deltaT = Su_.mesh().time().deltaTValue();
|
||||
const scalar ignTim = curTime - deltaT - ign.sites()[0].time();
|
||||
|
||||
volScalarField turbXiEq(XiEqModel_->XiEq());
|
||||
|
||||
volScalarField XiEqIn1("XiEqIn1", 0.0*turbXiEq);
|
||||
|
||||
dimensionedScalar CIn("CIn", dimensionSet(0, -2, 1, 0, 0, 0, 0), CIn_);
|
||||
dimensionedScalar ignTm("ignTm", dimTime, ignTim);
|
||||
XiEqIn1 = exp(CIn*Su_*Su_*ignTm) - 1.0;
|
||||
|
||||
return
|
||||
(
|
||||
1.0 + sqrt(XiEqInFade_*sqr(XiEqIn1) + sqr(turbXiEq - 1.0))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::instability2XiEq::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
XiEqModelCoeffs_.readEntry("defaultCIn", defaultCIn_);
|
||||
XiEqModelCoeffs_.readEntry("XiEqInFade", XiEqInFade_);
|
||||
|
||||
return XiEqModel_->read(XiEqModelCoeffs_);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,132 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::instability2XiEq
|
||||
|
||||
Description
|
||||
|
||||
|
||||
SourceFiles
|
||||
instability2XiEq.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef instability2XiEq_H
|
||||
#define instability2XiEq_H
|
||||
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "SCOPELaminarFlameSpeed.H"
|
||||
#include "ignitionSite.H"
|
||||
#include "ignition.H"
|
||||
#include "Time.H"
|
||||
#include "fvMesh.H"
|
||||
#include "XiEqModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class instability2 Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class instability2XiEq
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Laminar burning speed
|
||||
laminarFlameSpeedModels::SCOPE saModel_;
|
||||
|
||||
//- GIn (initial instability G)divided by Su^2. Read from fuel file
|
||||
scalar CIn_;
|
||||
|
||||
//- Default CIn if not in fuel file
|
||||
scalar defaultCIn_;
|
||||
|
||||
//- Determines how fast XiEqIn fades out as turbulence comes in
|
||||
scalar XiEqInFade_;
|
||||
|
||||
//- Equilibrium Xi model due to all other effects
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
instability2XiEq(const instability2XiEq&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const instability2XiEq&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("instability2XiEq");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
instability2XiEq
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~instability2XiEq() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "instabilityXiEq.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
defineTypeNameAndDebug(instability, 0);
|
||||
addToRunTimeSelectionTable(XiEqModel, instability, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::instability::instability
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqIn(XiEqModelCoeffs_.get<scalar>("XiEqIn")),
|
||||
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiEqModels::instability::~instability()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
|
||||
{
|
||||
volScalarField turbXiEq(XiEqModel_->XiEq());
|
||||
return XiEqIn/turbXiEq + turbXiEq;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiEqModels::instability::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModel::read(XiEqProperties);
|
||||
|
||||
XiEqModelCoeffs_.readEntry("XiEqIn", XiEqIn);
|
||||
|
||||
return XiEqModel_->read(XiEqModelCoeffs_);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,119 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiEqModels::instability
|
||||
|
||||
Description
|
||||
This is the equilibrium level of the flame wrinkling generated by
|
||||
instability. It is a constant (default 2.5). It is used in
|
||||
\link XiModel.H \endlink.
|
||||
|
||||
SourceFiles
|
||||
instability.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef instability_H
|
||||
#define instability_H
|
||||
|
||||
#include "XiEqModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiEqModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class instability Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class instability
|
||||
:
|
||||
public XiEqModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Equilibrium Xi due to instability only
|
||||
scalar XiEqIn;
|
||||
|
||||
//- Equilibrium Xi model due to all other effects
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
instability(const instability&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const instability&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("instability");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
instability
|
||||
(
|
||||
const dictionary& XiEqProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~instability();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiEqModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,17 +45,22 @@ namespace XiGModels
|
||||
Foam::XiGModels::KTS::KTS
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
|
||||
XiGModel(XiGProperties, thermo, turbulence, Su),
|
||||
GEtaCoef_(XiGModelCoeffs_.get<scalar>("GEtaCoef"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::KTS::~KTS()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
|
||||
@ -70,15 +74,6 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::Db() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
|
||||
//return turbulence_.muEff();
|
||||
return Db1;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModel::read(XiGProperties);
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -28,8 +27,8 @@ Class
|
||||
Foam::XiGModels::KTS
|
||||
|
||||
Description
|
||||
Simple Kolmogorov time-scale (KTS) model for the flame-wrinkling
|
||||
generation rate.
|
||||
Simple Kolmogorov time-scale (KTS) model for the flame-wrinling generation
|
||||
rate.
|
||||
|
||||
SourceFiles
|
||||
KTS.C
|
||||
@ -56,7 +55,7 @@ class KTS
|
||||
:
|
||||
public XiGModel
|
||||
{
|
||||
// Private Data
|
||||
// Private data
|
||||
|
||||
scalar GEtaCoef_;
|
||||
|
||||
@ -82,7 +81,6 @@ public:
|
||||
KTS
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -90,7 +88,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~KTS() = default;
|
||||
virtual ~KTS();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -98,9 +96,6 @@ public:
|
||||
//- Return the flame-wrinkling generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiGProperties);
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,7 +41,6 @@ namespace Foam
|
||||
Foam::XiGModel::XiGModel
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -51,7 +50,7 @@ Foam::XiGModel::XiGModel
|
||||
(
|
||||
XiGProperties.subDict
|
||||
(
|
||||
XiGProperties.get<word>(modelType) + "Coeffs"
|
||||
XiGProperties.get<word>("XiGModel") + "Coeffs"
|
||||
)
|
||||
),
|
||||
thermo_(thermo),
|
||||
@ -70,7 +69,7 @@ Foam::XiGModel::~XiGModel()
|
||||
|
||||
bool Foam::XiGModel::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs");
|
||||
XiGModelCoeffs_ = XiGProperties.optionalSubDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -28,6 +28,9 @@ Class
|
||||
|
||||
Description
|
||||
Base-class for all Xi generation models used by the b-Xi combustion model.
|
||||
See Technical Report SH/RE/01R for details on the PDR modelling. For details
|
||||
on the use of XiGModel see \link XiModel.H \endlink. The model available is
|
||||
\link instabilityG.H \endlink
|
||||
|
||||
SourceFiles
|
||||
XiGModel.C
|
||||
@ -53,9 +56,10 @@ namespace Foam
|
||||
|
||||
class XiGModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
// Protected data
|
||||
|
||||
dictionary XiGModelCoeffs_;
|
||||
|
||||
@ -64,7 +68,9 @@ protected:
|
||||
const volScalarField& Su_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiGModel(const XiGModel&) = delete;
|
||||
@ -88,14 +94,12 @@ public:
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
),
|
||||
(
|
||||
XiGProperties,
|
||||
modelType,
|
||||
thermo,
|
||||
turbulence,
|
||||
Su
|
||||
@ -109,7 +113,6 @@ public:
|
||||
static autoPtr<XiGModel> New
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -122,7 +125,6 @@ public:
|
||||
XiGModel
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -135,11 +137,14 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling genration rate
|
||||
//- Return the flame-wrinkling generation rate
|
||||
virtual tmp<volScalarField> G() const = 0;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const = 0;
|
||||
virtual tmp<volScalarField> Db() const
|
||||
{
|
||||
return turbulence_.muEff();
|
||||
}
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiGProperties) = 0;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -33,15 +33,14 @@ License
|
||||
Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const word& modelName,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
{
|
||||
const word modelType(dict.get<word>(modelName));
|
||||
const word modelType(dict.get<word>("XiGModel"));
|
||||
|
||||
Info<< "Selecting flame-wrinkling model for G " << modelType << endl;
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
@ -50,16 +49,13 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
modelName,
|
||||
"XiGModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<XiGModel>(cstrIter()
|
||||
(
|
||||
dict, modelName, thermo, turbulence, Su)
|
||||
);
|
||||
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,165 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IFstream.H"
|
||||
#include "instability2G.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
defineTypeNameAndDebug(instability2G, 0);
|
||||
addToRunTimeSelectionTable(XiGModel, instability2G, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::instability2G::instability2G
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
|
||||
saModel_
|
||||
(
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
Su.mesh().time().constant(),
|
||||
Su.mesh(),
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
),
|
||||
thermo
|
||||
),
|
||||
CIn_(saModel_.CIn()),
|
||||
defaultCIn_(XiGModelCoeffs_.get<scalar>("defaultCIn")),
|
||||
GInFade_(XiGModelCoeffs_.get<scalar>("GInFade")),
|
||||
GInMult_(XiGModelCoeffs_.get<scalar>("GInMult")),
|
||||
lambdaIn_("lambdaIn", XiGModelCoeffs_),
|
||||
XiGModel_
|
||||
(
|
||||
XiGModel::New(XiGModelCoeffs_, modelType, thermo, turbulence, Su)
|
||||
)
|
||||
{
|
||||
if (CIn_ <= 0.0)
|
||||
{
|
||||
CIn_ = defaultCIn_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instability2G::G() const
|
||||
{
|
||||
IOdictionary combustionProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
Su_.mesh().time().constant(),
|
||||
Su_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
ignition ign(combustionProperties, Su_.mesh().time(), Su_.mesh());
|
||||
|
||||
scalar curTime = Su_.mesh().time().value();
|
||||
scalar deltaT = Su_.mesh().time().deltaTValue();
|
||||
const scalar ignTim = curTime - deltaT - ign.sites()[0].time();
|
||||
|
||||
volScalarField turbXiG(XiGModel_->G());
|
||||
|
||||
volScalarField GIn("GIn", 0.0*turbXiG);
|
||||
|
||||
forAll (GIn, i)
|
||||
{
|
||||
GIn[i] = CIn_*Su_[i]*Su_[i]*exp(CIn_*Su_[i]*Su_[i]*ignTim)*GInMult_;
|
||||
}
|
||||
|
||||
dimensionedScalar CIn("CIn", dimensionSet(0, -2, 1, 0, 0, 0, 0), CIn_);
|
||||
dimensionedScalar ignTm("ignTm", dimTime, ignTim);
|
||||
|
||||
GIn = CIn*Su_*Su_*exp(CIn*Su_*Su_*ignTm)*GInMult_;
|
||||
|
||||
GIn *=
|
||||
(
|
||||
GIn /
|
||||
(
|
||||
GIn
|
||||
+ GInFade_*turbXiG
|
||||
+ dimensionedScalar("GSmall", inv(dimTime), SMALL)
|
||||
)
|
||||
);
|
||||
|
||||
return (GIn + turbXiG);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instability2G::Db() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
|
||||
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
|
||||
|
||||
//return turbulence_.muEff()
|
||||
return Db1
|
||||
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiGModels::instability2G::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModel::read(XiGProperties);
|
||||
|
||||
XiGModelCoeffs_.readEntry("defaultCIn", defaultCIn_);
|
||||
XiGModelCoeffs_.readEntry("GInFade", GInFade_);
|
||||
XiGModelCoeffs_.readEntry("GInMult", GInMult_);
|
||||
XiGModelCoeffs_.readEntry("lambdaIn", lambdaIn_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,142 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiGModels::instability2G
|
||||
|
||||
Description
|
||||
Flame-surface instabilityG flame-wrinkling generation rate coefficient model
|
||||
used in \link XiModel.H \endlink.
|
||||
|
||||
SourceFiles
|
||||
instability2G.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef instability2G_H
|
||||
#define instability2G_H
|
||||
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "SCOPELaminarFlameSpeed.H"
|
||||
#include "XiGModel.H"
|
||||
#include "ignitionSite.H"
|
||||
#include "ignition.H"
|
||||
#include "Time.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiGModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class instability2G Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class instability2G
|
||||
:
|
||||
public XiGModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
laminarFlameSpeedModels::SCOPE saModel_;
|
||||
|
||||
// GIn (inituial instability G)divided by Su^2. Read from fuel file
|
||||
scalar CIn_;
|
||||
|
||||
//- Default CIn if not in fuel file
|
||||
scalar defaultCIn_;
|
||||
|
||||
// Determine how fast GIn fades out as turbulence starts
|
||||
scalar GInFade_;
|
||||
|
||||
// Set GIn large so that XiEq determines Xi value.
|
||||
// Son increase byfactor:
|
||||
scalar GInMult_;
|
||||
|
||||
//- The instability2G length-scale
|
||||
dimensionedScalar lambdaIn_;
|
||||
|
||||
//- Xi generation rate model due to all other processes
|
||||
autoPtr<XiGModel> XiGModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
instability2G(const instability2G&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const instability2G&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("instability2G");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
instability2G
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~instability2G() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiGProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiGModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,16 +45,21 @@ namespace XiGModels
|
||||
Foam::XiGModels::instabilityG::instabilityG
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
)
|
||||
:
|
||||
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
|
||||
GIn_("GIn", XiGModelCoeffs_),
|
||||
lambdaIn_("lambdaIn", XiGModelCoeffs_),
|
||||
XiGModel_(XiGModel::New(XiGModelCoeffs_,modelType,thermo, turbulence, Su))
|
||||
XiGModel(XiGProperties, thermo, turbulence, Su),
|
||||
GIn_("GIn", dimless/dimTime, XiGModelCoeffs_),
|
||||
lambdaIn_("lambdaIn", dimLength, XiGModelCoeffs_),
|
||||
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiGModels::instabilityG::~instabilityG()
|
||||
{}
|
||||
|
||||
|
||||
@ -71,14 +76,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
|
||||
const volScalarField& Xp = db.lookupObject<volScalarField>("Xp");
|
||||
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
|
||||
|
||||
//// OLD return turbulence_.muEff()
|
||||
return Db1
|
||||
+ rho*Su_*(Xp*Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
|
||||
return XiGModel_->Db()
|
||||
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,6 +30,8 @@ Description
|
||||
Flame-surface instabilityG flame-wrinkling generation rate coefficient model
|
||||
used in \link XiModel.H \endlink.
|
||||
|
||||
See Technical Report SH/RE/01R for details on the PDR modelling.
|
||||
|
||||
SourceFiles
|
||||
instabilityG.C
|
||||
|
||||
@ -56,9 +57,9 @@ class instabilityG
|
||||
:
|
||||
public XiGModel
|
||||
{
|
||||
// Private Data
|
||||
// Private data
|
||||
|
||||
//- Flame instabilityG wrinling generation rate coefficient
|
||||
//- Flame instabilityG wrinkling generation rate coefficient
|
||||
dimensionedScalar GIn_;
|
||||
|
||||
//- InstabilityG length-scale
|
||||
@ -89,7 +90,6 @@ public:
|
||||
instabilityG
|
||||
(
|
||||
const dictionary& XiGProperties,
|
||||
const word& modelType,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su
|
||||
@ -97,7 +97,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~instabilityG() = default;
|
||||
virtual ~instabilityG();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -73,19 +73,7 @@ Foam::XiModel::XiModel
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
b.mesh()
|
||||
),
|
||||
Xp_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Xp",
|
||||
b.time().timeName(),
|
||||
b.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
b.mesh()
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -95,8 +95,8 @@ SourceFiles
|
||||
#include "IOdictionary.H"
|
||||
#include "psiuReactionThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "multivariateSurfaceInterpolationScheme.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -110,9 +110,10 @@ namespace Foam
|
||||
|
||||
class XiModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
// Protected data
|
||||
|
||||
dictionary XiModelCoeffs_;
|
||||
|
||||
@ -126,11 +127,10 @@ protected:
|
||||
//- Flame wrinkling field
|
||||
volScalarField Xi_;
|
||||
|
||||
//- Flame wrinkling field for the subgrid obstacles
|
||||
volScalarField Xp_;
|
||||
|
||||
private:
|
||||
|
||||
// Protected Member Functions
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiModel(const XiModel&) = delete;
|
||||
@ -215,31 +215,19 @@ public:
|
||||
return Xi_;
|
||||
}
|
||||
|
||||
//- Return the obstacle-flame-wrinkling Xp
|
||||
virtual const volScalarField& Xp() const
|
||||
{
|
||||
return Xp_;
|
||||
}
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const
|
||||
{
|
||||
const objectRegistry& db = Su_.db();
|
||||
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
|
||||
//return turbulence_.muEff();
|
||||
return Db1;
|
||||
return turbulence_.muEff();
|
||||
}
|
||||
|
||||
//- Add Xi to the multivariateSurfaceInterpolationScheme table
|
||||
// if required
|
||||
void addXi
|
||||
virtual void addXi
|
||||
(
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable& fields
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable&
|
||||
)
|
||||
{
|
||||
fields.add(Xi_);
|
||||
fields.add(Xp_);
|
||||
}
|
||||
{}
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
virtual void correct() = 0;
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "algebraic.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
defineTypeNameAndDebug(algebraic, 0);
|
||||
addToRunTimeSelectionTable(XiModel, algebraic, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::algebraic::algebraic
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
|
||||
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
|
||||
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
|
||||
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::algebraic::~algebraic()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiModels::algebraic::Db() const
|
||||
{
|
||||
return XiGModel_->Db();
|
||||
}
|
||||
|
||||
|
||||
void Foam::XiModels::algebraic::correct()
|
||||
{
|
||||
volScalarField XiEqEta(XiEqModel_->XiEq());
|
||||
volScalarField GEta(XiGModel_->G());
|
||||
|
||||
volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
|
||||
|
||||
volScalarField XiEqStar(R/(R - GEta));
|
||||
|
||||
Xi_ == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiModels::algebraic::read(const dictionary& XiProperties)
|
||||
{
|
||||
XiModel::read(XiProperties);
|
||||
|
||||
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,133 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiModels::algebraic
|
||||
|
||||
Description
|
||||
Simple algebraic model for Xi based on Gulders correlation
|
||||
with a linear correction function to give a plausible profile for Xi.
|
||||
See report TR/HGW/10 for details on the Weller two equations model.
|
||||
See \link XiModel.H \endlink for more details on flame wrinkling modelling.
|
||||
|
||||
SourceFiles
|
||||
algebraic.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef algebraic_H
|
||||
#define algebraic_H
|
||||
|
||||
#include "XiModel.H"
|
||||
#include "XiEqModel.H"
|
||||
#include "XiGModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class algebraic Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class algebraic
|
||||
:
|
||||
public XiModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
scalar XiShapeCoef;
|
||||
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
autoPtr<XiGModel> XiGModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
algebraic(const algebraic&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const algebraic&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("algebraic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
algebraic
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~algebraic();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
virtual void correct();
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiProperties);
|
||||
|
||||
//- Write fields of the XiEq model
|
||||
virtual void writeFields()
|
||||
{
|
||||
XiEqModel_().writeFields();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,74 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixed.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
defineTypeNameAndDebug(fixed, 0);
|
||||
addToRunTimeSelectionTable(XiModel, fixed, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::fixed::fixed
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::fixed::~fixed()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::XiModels::fixed::read(const dictionary& XiProperties)
|
||||
{
|
||||
return XiModel::read(XiProperties);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
117
applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H
Normal file
117
applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H
Normal file
@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiModels::fixed
|
||||
|
||||
Description
|
||||
Fixed value model for Xi. See \link XiModel.H \endlink for more details
|
||||
on flame wrinkling modelling.
|
||||
|
||||
SourceFiles
|
||||
fixed.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixed_H
|
||||
#define fixed_H
|
||||
|
||||
#include "XiModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fixed Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class fixed
|
||||
:
|
||||
public XiModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
fixed(const fixed&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const fixed&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("fixed");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
fixed
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~fixed();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
virtual void correct()
|
||||
{}
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiProperties);
|
||||
|
||||
//- Write fields of the XiEq model
|
||||
virtual void writeFields()
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "transport.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvmDdt.H"
|
||||
#include "fvcLaplacian.H"
|
||||
#include "fvmDiv.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
defineTypeNameAndDebug(transport, 0);
|
||||
addToRunTimeSelectionTable(XiModel, transport, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::transport::transport
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
|
||||
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
|
||||
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
|
||||
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::transport::~transport()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiModels::transport::Db() const
|
||||
{
|
||||
return XiGModel_->Db();
|
||||
}
|
||||
|
||||
|
||||
void Foam::XiModels::transport::correct
|
||||
(
|
||||
const fv::convectionScheme<scalar>& mvConvection
|
||||
)
|
||||
{
|
||||
volScalarField XiEqEta(XiEqModel_->XiEq());
|
||||
volScalarField GEta(XiGModel_->G());
|
||||
|
||||
volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
|
||||
|
||||
volScalarField XiEqStar(R/(R - GEta));
|
||||
|
||||
volScalarField XiEq
|
||||
(
|
||||
1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0)
|
||||
);
|
||||
|
||||
volScalarField G(R*(XiEq - 1.0)/XiEq);
|
||||
|
||||
const objectRegistry& db = b_.db();
|
||||
const volScalarField& betav = db.lookupObject<volScalarField>("betav");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const surfaceScalarField& phiSt =
|
||||
db.lookupObject<surfaceScalarField>("phiSt");
|
||||
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
|
||||
const surfaceScalarField& nf = db.lookupObject<surfaceScalarField>("nf");
|
||||
|
||||
surfaceScalarField phiXi
|
||||
(
|
||||
"phiXi",
|
||||
phiSt
|
||||
+ (
|
||||
- fvc::interpolate(fvc::laplacian(Db, b_)/mgb)*nf
|
||||
+ fvc::interpolate(rho_)*fvc::interpolate(Su_*(1.0/Xi_ - Xi_))*nf
|
||||
)
|
||||
);
|
||||
|
||||
solve
|
||||
(
|
||||
betav*fvm::ddt(rho_, Xi_)
|
||||
+ mvConvection.fvmDiv(phi_, Xi_)
|
||||
+ fvm::div(phiXi, Xi_)
|
||||
- fvm::Sp(fvc::div(phiXi), Xi_)
|
||||
==
|
||||
betav*rho_*R
|
||||
- fvm::Sp(betav*rho_*(R - G), Xi_)
|
||||
);
|
||||
|
||||
// Correct boundedness of Xi
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Xi_.max(1.0);
|
||||
Xi_ = min(Xi_, 2.0*XiEq);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiModels::transport::read(const dictionary& XiProperties)
|
||||
{
|
||||
XiModel::read(XiProperties);
|
||||
|
||||
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiModels::transport
|
||||
|
||||
Description
|
||||
Simple transport model for Xi based on Gulders correlation
|
||||
with a linear correction function to give a plausible profile for Xi.
|
||||
See report TR/HGW/10 for details on the Weller two equations model.
|
||||
See \link XiModel.H \endlink for more details on flame wrinkling modelling.
|
||||
|
||||
SourceFiles
|
||||
transport.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transport_H
|
||||
#define transport_H
|
||||
|
||||
#include "XiModel.H"
|
||||
#include "XiEqModel.H"
|
||||
#include "XiGModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class transport Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class transport
|
||||
:
|
||||
public XiModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
scalar XiShapeCoef;
|
||||
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
autoPtr<XiGModel> XiGModel_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
transport(const transport&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const transport&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("transport");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
transport
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~transport();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Add Xi to the multivariateSurfaceInterpolationScheme table
|
||||
virtual void addXi
|
||||
(
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable& fields
|
||||
)
|
||||
{
|
||||
fields.add(Xi_);
|
||||
}
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
virtual void correct()
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
//- Correct the flame-wrinkling Xi using the given convection scheme
|
||||
virtual void correct(const fv::convectionScheme<scalar>& mvConvection);
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiProperties);
|
||||
|
||||
//- Write fields of the XiEq model
|
||||
virtual void writeFields()
|
||||
{
|
||||
XiEqModel_().writeFields();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,258 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "transportTwoEqs.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
defineTypeNameAndDebug(transportTwoEqs, 0);
|
||||
addToRunTimeSelectionTable(XiModel, transportTwoEqs, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::transportTwoEqs::transportTwoEqs
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
|
||||
XiShapeCoef_(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
|
||||
CpfiDot_(XiModelCoeffs_.get<scalar>("CpfiDot")),
|
||||
CpfiCross_(XiModelCoeffs_.get<scalar>("CpfiCross")),
|
||||
GEtaExp_(XiModelCoeffs_.get<scalar>("GEtaExp")),
|
||||
LOverCw_(XiModelCoeffs_.get<scalar>("LOverCw")),
|
||||
XiEqModel_
|
||||
(
|
||||
XiEqModel::New(XiProperties, "XiEqModel", thermo, turbulence, Su)
|
||||
),
|
||||
XiGModel_(XiGModel::New(XiProperties, "XiGModel", thermo, turbulence, Su)),
|
||||
XpEqModel_
|
||||
(
|
||||
XiEqModel::New(XiProperties, "XpEqModel", thermo, turbulence, Su)
|
||||
),
|
||||
XpGModel_
|
||||
(
|
||||
XiGModel::New(XiProperties, "XpGModel", thermo, turbulence, Su)
|
||||
),
|
||||
Ep_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Ep",
|
||||
b.time().timeName(),
|
||||
b.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
b.mesh()
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::XiModels::transportTwoEqs::~transportTwoEqs()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiModels::transportTwoEqs::Db() const
|
||||
{
|
||||
return XiGModel_->Db();
|
||||
}
|
||||
|
||||
|
||||
void Foam::XiModels::transportTwoEqs::correct
|
||||
(
|
||||
const fv::convectionScheme<scalar>& mvConvection
|
||||
)
|
||||
{
|
||||
const volScalarField XiEqEta(XiEqModel_->XiEq());
|
||||
volScalarField GEta(XiGModel_->G());
|
||||
|
||||
GEta *= max( 1.0, exp( GEtaExp_*(1.0 - (Xi_ - 1.0)/(XiEqEta - 0.999)))) ;
|
||||
|
||||
const volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
|
||||
|
||||
const volScalarField XiEqStar(R/(R - GEta));
|
||||
|
||||
const volScalarField XiEq
|
||||
(
|
||||
1.0 + (1.0 + (2*XiShapeCoef_)*(0.5 - b_))*(XiEqStar - 1.0)
|
||||
);
|
||||
|
||||
const volScalarField G(R*(XiEq - 1.0)/XiEq);
|
||||
|
||||
|
||||
const objectRegistry& db = b_.db();
|
||||
const volScalarField& betav = db.lookupObject<volScalarField>("betav");
|
||||
const volScalarField& p = db.lookupObject<volScalarField>("p");
|
||||
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
|
||||
const surfaceScalarField& phiSt =
|
||||
db.lookupObject<surfaceScalarField>("phiSt");
|
||||
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
|
||||
const surfaceScalarField& nf = db.lookupObject<surfaceScalarField>("nf");
|
||||
|
||||
surfaceScalarField phiXi
|
||||
(
|
||||
"phiXi",
|
||||
phiSt
|
||||
+ (
|
||||
- fvc::interpolate(fvc::laplacian(Db, b_)/mgb)*nf
|
||||
+ fvc::interpolate(rho_)
|
||||
* fvc::interpolate(Su_*(1.0/(Xi_*Xp_) - (Xi_*Xp_)))*nf
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar zero
|
||||
(
|
||||
"zero",
|
||||
dimensionSet(2, -6, -2, 0, 0, 0, 0),
|
||||
scalar(0.0)
|
||||
);
|
||||
|
||||
const volScalarField Gpfi
|
||||
(
|
||||
CpfiDot_
|
||||
* sqrt(max(fvc::grad(rho_)&fvc::grad(p), zero))
|
||||
/ rho_*b_*(1.0-b_)
|
||||
|
||||
+ CpfiCross_
|
||||
* sqrt(mag(fvc::grad(rho_)^fvc::grad(p)))
|
||||
/ rho_*b_*(1.0-b_)
|
||||
);
|
||||
|
||||
fvScalarMatrix XiEqn_
|
||||
(
|
||||
betav*fvm::ddt(rho_, Xi_)
|
||||
+ mvConvection.fvmDiv(phi_, Xi_)
|
||||
+ fvm::div(phiXi, Xi_)
|
||||
- fvm::Sp(fvc::div(phiXi), Xi_)
|
||||
==
|
||||
betav*rho_*(R + Gpfi )
|
||||
- fvm::Sp(betav*rho_*(R - G), Xi_)
|
||||
);
|
||||
|
||||
XiEqn_.relax();
|
||||
XiEqn_.solve();
|
||||
|
||||
// Correct boundedness of Xi
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Xi_.max(1.0);
|
||||
Xi_ = min(Xi_, 2.0*XiEq);
|
||||
|
||||
// Calculation of Xp generated by obstacles
|
||||
volScalarField XpEqEta("XpEqEta",XpEqModel_->XiEq());
|
||||
|
||||
const volScalarField GpEta("GpEta", XpGModel_->G());
|
||||
|
||||
const volScalarField Rp("Rp", GpEta*XpEqEta/(XpEqEta - 0.999));
|
||||
|
||||
const volScalarField XpEq
|
||||
(
|
||||
"XpEq",
|
||||
1.0 + (1.0 + (2*XiShapeCoef_)*(0.5 - b_))*(XpEqEta - 1.0)
|
||||
);
|
||||
|
||||
const volScalarField Gpp("Gpp", Rp*(XpEq - 1.0)/XpEq);
|
||||
|
||||
|
||||
fvScalarMatrix XpEqn_
|
||||
(
|
||||
betav*fvm::ddt(rho_, Xp_)
|
||||
+ mvConvection.fvmDiv(phi_, Xp_)
|
||||
+ fvm::div(phiXi, Xp_)
|
||||
- fvm::Sp(fvc::div(phiXi), Xp_)
|
||||
==
|
||||
betav*rho_*Rp
|
||||
- fvm::Sp(betav*rho_*(Rp - Gpp), Xp_)
|
||||
);
|
||||
|
||||
XpEqn_.relax();
|
||||
XpEqn_.solve();
|
||||
|
||||
Xp_.max(1.0);
|
||||
Xp_ = min(Xp_, 20.0*XpEq);
|
||||
|
||||
// Calculate Ep
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
const scalarField Cw(pow(Su_.mesh().V(), 2.0/3.0));
|
||||
volScalarField LI(Lobs);
|
||||
|
||||
LI.primitiveFieldRef() = max(LI.primitiveField(),LOverCw_*sqrt(Cw));
|
||||
|
||||
fvScalarMatrix EpEqn_
|
||||
(
|
||||
betav*fvm::ddt(rho_, Ep_)
|
||||
+ mvConvection.fvmDiv(phi_, Ep_)
|
||||
+ fvm::div(phiXi, Ep_)
|
||||
- fvm::Sp(fvc::div(phiXi), Ep_)
|
||||
==
|
||||
betav*rho_*Gpp*Xp_/LI
|
||||
- fvm::Sp(betav*rho_*Rp, Ep_)
|
||||
);
|
||||
|
||||
EpEqn_.relax();
|
||||
EpEqn_.solve();
|
||||
|
||||
Ep_.max(0.0);
|
||||
Ep_.min(100000.0);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::XiModels::transportTwoEqs::read(const dictionary& XiProperties)
|
||||
{
|
||||
XiModel::read(XiProperties);
|
||||
|
||||
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef_);
|
||||
XiModelCoeffs_.readEntry("CpfiDot", CpfiDot_);
|
||||
XiModelCoeffs_.readEntry("CpfiCross", CpfiCross_);
|
||||
XiModelCoeffs_.readEntry("GEtaExp", GEtaExp_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,154 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::XiModels::transportTwoEqs
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
transportTwoEqs.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transportTwoEqs_H
|
||||
#define transportTwoEqs_H
|
||||
|
||||
#include "XiModel.H"
|
||||
#include "XiEqModel.H"
|
||||
#include "XiGModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace XiModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class transportTwoEqs Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class transportTwoEqs
|
||||
:
|
||||
public XiModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
scalar XiShapeCoef_;
|
||||
scalar CpfiDot_;
|
||||
scalar CpfiCross_;
|
||||
scalar GEtaExp_;
|
||||
|
||||
//- Maximum Lobs/CellWidth
|
||||
scalar LOverCw_;
|
||||
|
||||
//- Equilibrium for Xi (turbulence)
|
||||
autoPtr<XiEqModel> XiEqModel_;
|
||||
|
||||
//- Generation for Xi (turbulence)
|
||||
autoPtr<XiGModel> XiGModel_;
|
||||
|
||||
//- Equilibrium for Xp (obstacles)
|
||||
autoPtr<XiEqModel> XpEqModel_;
|
||||
|
||||
//- Generation for Xp (obstacles)
|
||||
autoPtr<XiGModel> XpGModel_;
|
||||
|
||||
//- Dissipation length scale for subgrid obstacles
|
||||
volScalarField Ep_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
transportTwoEqs(const transportTwoEqs&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const transportTwoEqs&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("transportTwoEqs");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
transportTwoEqs
|
||||
(
|
||||
const dictionary& XiProperties,
|
||||
const psiuReactionThermo& thermo,
|
||||
const compressible::RASModel& turbulence,
|
||||
const volScalarField& Su,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& b,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~transportTwoEqs();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
virtual void correct()
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
//- Correct the flame-wrinkling Xi using the given convection scheme
|
||||
virtual void correct(const fv::convectionScheme<scalar>& mvConvection);
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiProperties);
|
||||
|
||||
//- Write fields of the XiEq model
|
||||
virtual void writeFields()
|
||||
{
|
||||
XiEqModel_().writeFields();
|
||||
XpEqModel_().writeFields();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace XiModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,20 +5,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,ft_b_h_hu)")
|
||||
mesh.divScheme("div(phi,ft_b_ha_hau)")
|
||||
)
|
||||
);
|
||||
|
||||
rhou = thermo.rhou();
|
||||
muu = thermo.muu();
|
||||
|
||||
volScalarField Db("Db", turbulence->mut());
|
||||
const volScalarField DbThermal
|
||||
(
|
||||
"DbAlpha",
|
||||
turbulence->alphaEff()
|
||||
//thermo.alpha() + turbulence->mut()/Prt
|
||||
);
|
||||
volScalarField Db("Db", turbulence->muEff());
|
||||
|
||||
if (ign.ignited())
|
||||
{
|
||||
@ -26,31 +17,30 @@ if (ign.ignited())
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Su = unstrainedLaminarFlameSpeed()();
|
||||
|
||||
// Wrinkling due to turbulence
|
||||
const volScalarField& Xi = flameWrinkling->Xi();
|
||||
|
||||
// Wrinkling due to obstacles
|
||||
const volScalarField& Xp = flameWrinkling->Xp();
|
||||
|
||||
// Progress variable
|
||||
// progress variable
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
c = (1.0 - b);
|
||||
volScalarField c("c", 1.0 - b);
|
||||
|
||||
// Unburnt gas density
|
||||
// ~~~~~~~~~~~~~~~~~~~
|
||||
volScalarField rhou(thermo.rhou());
|
||||
|
||||
// Calculate flame normal etc.
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
//volVectorField n(fvc::grad(b));
|
||||
volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()));
|
||||
|
||||
volScalarField mgb("mgb", mag(n));
|
||||
volScalarField ddtb("ddtb",fvc::ddt(b));
|
||||
|
||||
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
|
||||
|
||||
{
|
||||
volScalarField bc(b*c);
|
||||
|
||||
dMgb += 1.0e-8*
|
||||
dMgb += 1.0e-3*
|
||||
(bc*mgb)().weightedAverage(mesh.V())
|
||||
/(bc.weightedAverage(mesh.V()) + SMALL);
|
||||
}
|
||||
@ -64,7 +54,6 @@ if (ign.ignited())
|
||||
surfaceScalarField nf("nf", mesh.Sf() & nfVec);
|
||||
n /= mgb;
|
||||
|
||||
|
||||
#include "StCorr.H"
|
||||
|
||||
// Calculate turbulent flame speed flux
|
||||
@ -75,6 +64,8 @@ if (ign.ignited())
|
||||
|
||||
Db = flameWrinkling->Db();
|
||||
|
||||
// Create b equation
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
fvScalarMatrix bEqn
|
||||
(
|
||||
betav*fvm::ddt(rho, b)
|
||||
@ -84,7 +75,6 @@ if (ign.ignited())
|
||||
- fvm::laplacian(Db, b)
|
||||
==
|
||||
betav*fvOptions(rho, b)
|
||||
// + betav*rhou*St*StCorr*mag(fvc::grad(b))
|
||||
);
|
||||
|
||||
|
||||
@ -92,16 +82,17 @@ if (ign.ignited())
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#include "ignite.H"
|
||||
|
||||
// Solve for b
|
||||
// ~~~~~~~~~~~
|
||||
bEqn.relax();
|
||||
|
||||
fvOptions.constrain(bEqn);
|
||||
|
||||
bEqn.solve();
|
||||
b.max(0.0);
|
||||
b.min(1.0);
|
||||
|
||||
fvOptions.correct(b);
|
||||
|
||||
Info<< "min(b) = " << min(b).value() << nl
|
||||
<< "max(b) = " << max(b).value() << endl;
|
||||
Info<< "min(b) = " << min(b).value() << endl;
|
||||
|
||||
if (composition.contains("ft"))
|
||||
{
|
||||
@ -118,14 +109,8 @@ if (ign.ignited())
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
// Correct the flame-wrinkling, smoothing
|
||||
// Correct the flame-wrinkling
|
||||
flameWrinkling->correct(mvConvection);
|
||||
St = Xp*Xi*Su*combustFlag;
|
||||
|
||||
if (PDRProperties.getOrDefault("smoothSt", false))
|
||||
{
|
||||
const scalar coeff = PDRProperties.get<scalar>("smoothStCoeff");
|
||||
fvc::smooth(St, coeff);
|
||||
}
|
||||
St = Xi*Su;
|
||||
}
|
||||
|
||||
@ -1,2 +1 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
scalar pMin = thermo.getOrDefault<scalar>("pMin", 0);
|
||||
|
||||
@ -1,303 +1,218 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<psiuReactionThermo> pThermo
|
||||
autoPtr<psiuReactionThermo> pThermo
|
||||
(
|
||||
psiuReactionThermo::New(mesh)
|
||||
);
|
||||
psiuReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "ha", "ea");
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
psiuReactionThermo::New(mesh)
|
||||
);
|
||||
psiuReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "ha", "ea");
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
volScalarField& b = composition.Y("b");
|
||||
Info<< "min(b) = " << min(b).value() << endl;
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
volScalarField rhou
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
(
|
||||
compressible::New<compressible::RASModel>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhou",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rhou()
|
||||
);
|
||||
volScalarField muu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"muu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.muu()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
volScalarField& b = composition.Y("b");
|
||||
|
||||
volScalarField combustFlag
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustFlag",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading fields betav, betai\n" << endl;
|
||||
volScalarField betav
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"betav",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volSymmTensorField betai
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"betai",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field Bv\n" << endl;
|
||||
volSymmTensorField Bv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bv",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading fields Nv,nsv\n" << endl;
|
||||
volScalarField Nv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Nv",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volSymmTensorField nsv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nsv",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading fields Blong\n" << endl;
|
||||
volSymmTensorField Blong
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Blong",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "\nCreating field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
(
|
||||
compressible::New<compressible::RASModel>
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
Info<< "Creating the unstrained laminar flame speed\n" << endl;
|
||||
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
|
||||
(
|
||||
laminarFlameSpeed::New(thermo)
|
||||
);
|
||||
|
||||
Info<< "Reading strained laminar flame speed field Su\n" << endl;
|
||||
volScalarField Su
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field Lobs\n" << endl;
|
||||
volScalarField Lobs
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Lobs",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field CT\n" << endl;
|
||||
volSymmTensorField CT
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"CT",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
IOdictionary PDRProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"PDRProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
//- Create the drag model
|
||||
autoPtr<PDRDragModel> drag = PDRDragModel::New
|
||||
(
|
||||
PDRProperties,
|
||||
turbulence,
|
||||
rho,
|
||||
U,
|
||||
phi
|
||||
);
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
//- Create the flame-wrinkling model
|
||||
autoPtr<XiModel> flameWrinkling = XiModel::New
|
||||
|
||||
Info<< "Creating the unstrained laminar flame speed\n" << endl;
|
||||
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
|
||||
(
|
||||
laminarFlameSpeed::New(thermo)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading strained laminar flame speed field Su\n" << endl;
|
||||
volScalarField Su
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
PDRProperties,
|
||||
thermo,
|
||||
turbulence,
|
||||
Su,
|
||||
rho,
|
||||
b,
|
||||
phi
|
||||
);
|
||||
"Su",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Calculating turbulent flame speed field St\n" << endl;
|
||||
volScalarField St
|
||||
Info<< "Reading field betav\n" << endl;
|
||||
volScalarField betav
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"St",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
flameWrinkling->Xi()*Su
|
||||
);
|
||||
"betav",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
if (composition.contains("ft"))
|
||||
{
|
||||
fields.add(composition.Y("ft"));
|
||||
}
|
||||
|
||||
fields.add(b);
|
||||
fields.add(thermo.he());
|
||||
fields.add(thermo.heu());
|
||||
flameWrinkling->addXi(fields);
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
volScalarField c
|
||||
Info<< "Reading field Lobs\n" << endl;
|
||||
volScalarField Lobs
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"c",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
scalar(1) - b
|
||||
);
|
||||
"Lobs",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field CT\n" << endl;
|
||||
volSymmTensorField CT
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"CT",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field Nv\n" << endl;
|
||||
volScalarField Nv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Nv",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field nsv\n" << endl;
|
||||
volSymmTensorField nsv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nsv",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
IOdictionary PDRProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"PDRProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
//- Create the drag model
|
||||
autoPtr<PDRDragModel> drag = PDRDragModel::New
|
||||
(
|
||||
PDRProperties,
|
||||
*turbulence,
|
||||
rho,
|
||||
U,
|
||||
phi
|
||||
);
|
||||
|
||||
//- Create the flame-wrinkling model
|
||||
autoPtr<XiModel> flameWrinkling = XiModel::New
|
||||
(
|
||||
PDRProperties,
|
||||
thermo,
|
||||
*turbulence,
|
||||
Su,
|
||||
rho,
|
||||
b,
|
||||
phi
|
||||
);
|
||||
|
||||
Info<< "Calculating turbulent flame speed field St\n" << endl;
|
||||
volScalarField St
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"St",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
flameWrinkling->Xi()*Su
|
||||
);
|
||||
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
if (composition.contains("ft"))
|
||||
{
|
||||
fields.add(composition.Y("ft"));
|
||||
}
|
||||
|
||||
fields.add(b);
|
||||
fields.add(thermo.he());
|
||||
fields.add(thermo.heu());
|
||||
flameWrinkling->addXi(fields);
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
@ -5,8 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,34 +47,6 @@ namespace laminarFlameSpeedModels
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
static void readPolynomialCoeffs
|
||||
(
|
||||
Polynomial<7>& coeffs,
|
||||
const word& keyword,
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
{
|
||||
coeffs[0] = dict.get<scalar>(keyword + "0");
|
||||
coeffs[1] = dict.get<scalar>(keyword + "1");
|
||||
coeffs[2] = dict.get<scalar>(keyword + "2");
|
||||
coeffs[3] = dict.get<scalar>(keyword + "3");
|
||||
coeffs[4] = dict.get<scalar>(keyword + "4");
|
||||
coeffs[5] = dict.get<scalar>(keyword + "5");
|
||||
coeffs[6] = dict.get<scalar>(keyword + "6");
|
||||
}
|
||||
|
||||
// TBD: support direct reading of all coeffs?
|
||||
}
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
|
||||
@ -104,22 +75,35 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
|
||||
(
|
||||
dictionary
|
||||
(
|
||||
IFstream(dict.get<fileName>("fuelFile"))()
|
||||
).subDict(typeName + "Coeffs")
|
||||
IFstream
|
||||
(
|
||||
dict.get<fileName>("fuelFile")
|
||||
)()
|
||||
).optionalSubDict(typeName + "Coeffs")
|
||||
),
|
||||
LFL_
|
||||
(
|
||||
coeffsDict_.getCompat<scalar>
|
||||
(
|
||||
"lowerFlammabilityLimit",
|
||||
{{"lowerFlamabilityLimit", 1712}}
|
||||
)
|
||||
),
|
||||
UFL_
|
||||
(
|
||||
coeffsDict_.getCompat<scalar>
|
||||
(
|
||||
"upperFlammabilityLimit",
|
||||
{{"upperFlamabilityLimit", 1712}}
|
||||
)
|
||||
),
|
||||
LFL_(coeffsDict_.get<scalar>("lowerFlamabilityLimit")),
|
||||
UFL_(coeffsDict_.get<scalar>("upperFlamabilityLimit")),
|
||||
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
|
||||
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
|
||||
Texp_(),
|
||||
pexp_(),
|
||||
CIn_(coeffsDict_.getOrDefault<scalar>("CIn", 0)),
|
||||
Texp_(coeffsDict_.get<scalar>("Texp")),
|
||||
pexp_(coeffsDict_.get<scalar>("pexp")),
|
||||
MaPolyL_(coeffsDict_.subDict("lowerMaPolynomial")),
|
||||
MaPolyU_(coeffsDict_.subDict("upperMaPolynomial"))
|
||||
{
|
||||
readPolynomialCoeffs(Texp_, "Texp", coeffsDict_);
|
||||
readPolynomialCoeffs(pexp_, "pexp", coeffsDict_);
|
||||
|
||||
SuPolyL_.ll = max(SuPolyL_.ll, LFL_) + SMALL;
|
||||
SuPolyU_.ul = min(SuPolyU_.ul, UFL_) - SMALL;
|
||||
|
||||
@ -132,7 +116,7 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
|
||||
if (debug)
|
||||
{
|
||||
Info<< "phi Su (T = Tref, p = pref)" << endl;
|
||||
const label n = 200;
|
||||
label n = 200;
|
||||
for (int i=0; i<n; i++)
|
||||
{
|
||||
scalar phi = (2.0*i)/n;
|
||||
@ -156,7 +140,7 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::polyPhi
|
||||
const polynomial& a
|
||||
)
|
||||
{
|
||||
const scalar x = phi - 1.0;
|
||||
scalar x = phi - 1.0;
|
||||
|
||||
return
|
||||
a[0]
|
||||
@ -211,34 +195,28 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::SuRef
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Ma
|
||||
(
|
||||
scalar phi
|
||||
) const
|
||||
{
|
||||
if (phi < LFL_ || phi > UFL_)
|
||||
if (phi < MaPolyL_.ll)
|
||||
{
|
||||
// Return 0 beyond the flamibility limits
|
||||
return scalar(0);
|
||||
}
|
||||
else if (phi < MaPolyL_.ll)
|
||||
{
|
||||
// Use linear interpolation between the low end of the
|
||||
// lower polynomial and the lower flammability limit
|
||||
return MaPolyL_.llv*(phi - LFL_)/(MaPolyL_.ll - LFL_);
|
||||
// Beyond the lower limit assume Ma is constant
|
||||
return MaPolyL_.llv;
|
||||
}
|
||||
else if (phi > MaPolyU_.ul)
|
||||
{
|
||||
// Use linear interpolation between the upper end of the
|
||||
// upper polynomial and the upper flammability limit
|
||||
return MaPolyU_.ulv*(UFL_ - phi)/(UFL_ - MaPolyU_.ul);
|
||||
// Beyond the upper limit assume Ma is constant
|
||||
return MaPolyU_.ulv;
|
||||
}
|
||||
else if (phi < MaPolyL_.lu)
|
||||
else if (phi < SuPolyL_.lu)
|
||||
{
|
||||
// Evaluate the lower polynomial
|
||||
return polyPhi(phi, MaPolyL_);
|
||||
}
|
||||
else if (phi > MaPolyU_.lu)
|
||||
else if (phi > SuPolyU_.lu)
|
||||
{
|
||||
// Evaluate the upper polynomial
|
||||
return polyPhi(phi, MaPolyU_);
|
||||
@ -263,13 +241,10 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
scalar phi
|
||||
) const
|
||||
{
|
||||
constexpr scalar Tref = 300.0;
|
||||
constexpr scalar pRef = 1.013e5;
|
||||
static const scalar Tref = 300.0;
|
||||
static const scalar pRef = 1.013e5;
|
||||
|
||||
const scalar Texp = Texp_.value(phi-1.0);
|
||||
const scalar pexp = pexp_.value(phi-1.0);
|
||||
|
||||
return SuRef(phi)*pow((Tu/Tref), Texp)*pow((p/pRef), pexp);
|
||||
return SuRef(phi)*pow((Tu/Tref), Texp_)*pow((p/pRef), pexp_);
|
||||
}
|
||||
|
||||
|
||||
@ -280,29 +255,35 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
scalar phi
|
||||
) const
|
||||
{
|
||||
auto tSu0 = tmp<volScalarField>::New
|
||||
tmp<volScalarField> tSu0
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"Su0",
|
||||
p.time().timeName(),
|
||||
p.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
IOobject
|
||||
(
|
||||
"Su0",
|
||||
p.time().timeName(),
|
||||
p.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
)
|
||||
);
|
||||
auto& Su0 = tSu0.ref();
|
||||
|
||||
volScalarField& Su0 = tSu0.ref();
|
||||
|
||||
forAll(Su0, celli)
|
||||
{
|
||||
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi);
|
||||
}
|
||||
|
||||
forAll(Su0.boundaryField(), patchi)
|
||||
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
|
||||
|
||||
forAll(Su0Bf, patchi)
|
||||
{
|
||||
scalarField& Su0p = Su0.boundaryFieldRef()[patchi];
|
||||
scalarField& Su0p = Su0Bf[patchi];
|
||||
const scalarField& pp = p.boundaryField()[patchi];
|
||||
const scalarField& Tup = Tu.boundaryField()[patchi];
|
||||
|
||||
@ -323,29 +304,35 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
const volScalarField& phi
|
||||
) const
|
||||
{
|
||||
auto tSu0 = tmp<volScalarField>::New
|
||||
tmp<volScalarField> tSu0
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"Su0",
|
||||
p.time().timeName(),
|
||||
p.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
IOobject
|
||||
(
|
||||
"Su0",
|
||||
p.time().timeName(),
|
||||
p.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
)
|
||||
);
|
||||
auto& Su0 = tSu0.ref();
|
||||
|
||||
volScalarField& Su0 = tSu0.ref();
|
||||
|
||||
forAll(Su0, celli)
|
||||
{
|
||||
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli]);
|
||||
}
|
||||
|
||||
forAll(Su0.boundaryField(), patchi)
|
||||
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
|
||||
|
||||
forAll(Su0Bf, patchi)
|
||||
{
|
||||
scalarField& Su0p = Su0.boundaryFieldRef()[patchi];
|
||||
scalarField& Su0p = Su0Bf[patchi];
|
||||
const scalarField& pp = p.boundaryField()[patchi];
|
||||
const scalarField& Tup = Tu.boundaryField()[patchi];
|
||||
const scalarField& phip = phi.boundaryField()[patchi];
|
||||
@ -366,40 +353,40 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::CIn() const noexcept
|
||||
{
|
||||
return CIn_ ;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
|
||||
(
|
||||
const volScalarField& phi
|
||||
) const
|
||||
{
|
||||
auto tMa = tmp<volScalarField>::New
|
||||
tmp<volScalarField> tMa
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"Ma",
|
||||
phi.time().timeName(),
|
||||
phi.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
phi.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
IOobject
|
||||
(
|
||||
"Ma",
|
||||
phi.time().timeName(),
|
||||
phi.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
phi.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
)
|
||||
);
|
||||
auto& ma = tMa.ref();
|
||||
|
||||
volScalarField& ma = tMa.ref();
|
||||
|
||||
forAll(ma, celli)
|
||||
{
|
||||
ma[celli] = Ma(phi[celli]);
|
||||
}
|
||||
|
||||
forAll(ma.boundaryField(), patchi)
|
||||
volScalarField::Boundary& maBf = ma.boundaryFieldRef();
|
||||
|
||||
forAll(maBf, patchi)
|
||||
{
|
||||
scalarField& map = ma.boundaryFieldRef()[patchi];
|
||||
scalarField& map = maBf[patchi];
|
||||
const scalarField& phip = phi.boundaryField()[patchi];
|
||||
|
||||
forAll(map, facei)
|
||||
@ -423,8 +410,7 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
|
||||
(
|
||||
dimensionedScalar
|
||||
(
|
||||
"stoichiometricAirFuelMassRatio",
|
||||
psiuReactionThermo_
|
||||
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
|
||||
)*ft/(scalar(1) - ft)
|
||||
);
|
||||
}
|
||||
@ -432,18 +418,21 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
|
||||
{
|
||||
const fvMesh& mesh = psiuReactionThermo_.p().mesh();
|
||||
|
||||
return tmp<volScalarField>::New
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
IOobject
|
||||
new volScalarField
|
||||
(
|
||||
"Ma",
|
||||
mesh.time().timeName(),
|
||||
IOobject
|
||||
(
|
||||
"Ma",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
|
||||
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -462,8 +451,7 @@ Foam::laminarFlameSpeedModels::SCOPE::operator()() const
|
||||
psiuReactionThermo_.Tu(),
|
||||
dimensionedScalar
|
||||
(
|
||||
"stoichiometricAirFuelMassRatio",
|
||||
psiuReactionThermo_
|
||||
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
|
||||
)*ft/(scalar(1) - ft)
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -66,7 +65,6 @@ SourceFiles
|
||||
#define SCOPE_H
|
||||
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "Polynomial.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -107,7 +105,7 @@ class SCOPE
|
||||
scalar lu;
|
||||
|
||||
//- Construct from dictionary
|
||||
explicit polynomial(const dictionary& polyDict);
|
||||
polynomial(const dictionary& polyDict);
|
||||
};
|
||||
|
||||
|
||||
@ -125,14 +123,11 @@ class SCOPE
|
||||
//- Upper Su polynomial
|
||||
polynomial SuPolyU_;
|
||||
|
||||
//- Temperature correction exponents
|
||||
Polynomial<7> Texp_;
|
||||
//- Temperature correction exponent
|
||||
scalar Texp_;
|
||||
|
||||
//- Pressure correction exponents
|
||||
Polynomial<7> pexp_;
|
||||
|
||||
//- Additional coefficient
|
||||
scalar CIn_;
|
||||
//- Pressure correction exponent
|
||||
scalar pexp_;
|
||||
|
||||
//- Lower Ma polynomial
|
||||
polynomial MaPolyL_;
|
||||
@ -141,25 +136,25 @@ class SCOPE
|
||||
polynomial MaPolyU_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
// Private member functions
|
||||
|
||||
//- Polynomial evaluated from the given equivalence ratio
|
||||
//- and polynomial coefficients
|
||||
// and polynomial coefficients
|
||||
static inline scalar polyPhi(scalar phi, const polynomial& a);
|
||||
|
||||
//- Laminar flame speed evaluated from the given equivalence ratio
|
||||
//- at the reference temperature and pressure
|
||||
// at the reference temperature and pressure
|
||||
inline scalar SuRef(scalar phi) const;
|
||||
|
||||
//- Markstein evaluated from the given equivalence ratio
|
||||
inline scalar Ma(scalar phi) const;
|
||||
|
||||
//- Laminar flame speed evaluated from the given equivalence ratio
|
||||
//- corrected for temperature and pressure dependence
|
||||
// corrected for temperature and pressure dependence
|
||||
inline scalar Su0pTphi(scalar p, scalar Tu, scalar phi) const;
|
||||
|
||||
//- Laminar flame speed evaluated from the given uniform
|
||||
//- equivalence ratio corrected for temperature and pressure dependence
|
||||
// equivalence ratio corrected for temperature and pressure dependence
|
||||
tmp<volScalarField> Su0pTphi
|
||||
(
|
||||
const volScalarField& p,
|
||||
@ -168,7 +163,7 @@ class SCOPE
|
||||
) const;
|
||||
|
||||
//- Laminar flame speed evaluated from the given equivalence ratio
|
||||
//- distribution corrected for temperature and pressure dependence
|
||||
// distribution corrected for temperature and pressure dependence
|
||||
tmp<volScalarField> Su0pTphi
|
||||
(
|
||||
const volScalarField& p,
|
||||
@ -177,14 +172,13 @@ class SCOPE
|
||||
) const;
|
||||
|
||||
//- Return the Markstein number
|
||||
//- evaluated from the given equivalence ratio
|
||||
// evaluated from the given equivalence ratio
|
||||
tmp<volScalarField> Ma(const volScalarField& phi) const;
|
||||
|
||||
//- No copy construct
|
||||
SCOPE(const SCOPE&) = delete;
|
||||
//- Construct as copy (not implemented)
|
||||
SCOPE(const SCOPE&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const SCOPE&) = delete;
|
||||
void operator=(const SCOPE&);
|
||||
|
||||
|
||||
public:
|
||||
@ -197,8 +191,8 @@ public:
|
||||
//- Construct from dictionary and psiuReactionThermo
|
||||
SCOPE
|
||||
(
|
||||
const dictionary& dict,
|
||||
const psiuReactionThermo& ct
|
||||
const dictionary&,
|
||||
const psiuReactionThermo&
|
||||
);
|
||||
|
||||
|
||||
@ -208,9 +202,6 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return CIn
|
||||
scalar CIn() const noexcept;
|
||||
|
||||
//- Return the Markstein number
|
||||
tmp<volScalarField> Ma() const;
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
|
||||
volVectorField HbyA(constrainHbyA(invA & UEqn.H(), U, p));
|
||||
|
||||
if (pimple.transonic())
|
||||
@ -9,7 +8,12 @@ if (pimple.transonic())
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)*(fvc::flux(HbyA))
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
fvc::flux(HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
@ -36,7 +40,10 @@ else
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::flux(rho*HbyA)
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
@ -59,8 +66,6 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
p.max(pMin);
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "continuityErrs.H"
|
||||
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
readTimeControls
|
||||
|
||||
Description
|
||||
Read the control parameters used by setDeltaT.
|
||||
Modified for PDRFoam to include maxDeltaTRatio.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
const bool adjustTimeStep =
|
||||
runTime.controlDict().getOrDefault("adjustTimeStep", false);
|
||||
|
||||
scalar maxCo =
|
||||
runTime.controlDict().getOrDefault<scalar>("maxCo", 1);
|
||||
|
||||
scalar maxDeltaT =
|
||||
runTime.controlDict().getOrDefault<scalar>("maxDeltaT", GREAT);
|
||||
|
||||
scalar maxDeltaTRatio =
|
||||
runTime.controlDict().getOrDefault<scalar>("maxDeltaTRatio", 1.2);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +1,38 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
rhoEqn
|
||||
|
||||
Description
|
||||
Solve the continuity for density.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
{
|
||||
solve(betav*fvm::ddt(rho) + fvc::div(phi));
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -36,8 +36,7 @@ Description
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
|
||||
scalar deltaTFact =
|
||||
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), maxDeltaTRatio);
|
||||
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dynamicFvMesh::defaultRegion,
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dynamicFvMesh::defaultRegion,
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
|
||||
@ -23,6 +23,7 @@ surfaceScalarField phiHbyA
|
||||
+ phig
|
||||
);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
|
||||
@ -11,5 +11,6 @@ wmake $targetType
|
||||
wmake $targetType compressibleInterDyMFoam
|
||||
wmake $targetType compressibleInterFilmFoam
|
||||
wmake $targetType compressibleInterIsoFoam
|
||||
wmake $targetType overCompressibleInterDyMFoam
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -83,7 +83,7 @@ VoFPatchTransfer::VoFPatchTransfer
|
||||
pbm.size() - film.regionMesh().globalData().processorPatches().size()
|
||||
);
|
||||
|
||||
wordReList patchNames;
|
||||
wordRes patchNames;
|
||||
if (coeffDict_.readIfPresent("patches", patchNames))
|
||||
{
|
||||
patchIDs_ = pbm.patchSet(patchNames).sortedToc();
|
||||
|
||||
@ -144,10 +144,11 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
|
||||
),
|
||||
curTimeIndex_(-1)
|
||||
{
|
||||
fieldNames_.setSize(2);
|
||||
fieldNames_.resize(2);
|
||||
fieldNames_[0] = "U";
|
||||
fieldNames_[1] = "T";
|
||||
applied_.setSize(fieldNames_.size(), false);
|
||||
|
||||
fv::option::resetApplied();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,10 +41,6 @@ bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict)
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
overCompressibleInterDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/overCompressibleInterDyMFoam
|
||||
@ -0,0 +1,40 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../../VoF \
|
||||
-I../../interFoam/overInterDyMFoam \
|
||||
-I../twoPhaseMixtureThermo \
|
||||
-I../VoFphaseCompressibleTurbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \
|
||||
-I$(LIB_SRC)/overset/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-ltwoPhaseMixtureThermo \
|
||||
-ltwoPhaseSurfaceTension \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lVoFphaseCompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-loverset \
|
||||
-lwaveModels
|
||||
@ -0,0 +1,28 @@
|
||||
{
|
||||
fvScalarMatrix TEqn
|
||||
(
|
||||
fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T)
|
||||
- fvm::laplacian(turbulence.alphaEff(), T)
|
||||
+ (
|
||||
divUp()// - contErr/rho*p
|
||||
+ (fvc::ddt(rho, K) + fvc::div(rhoPhi, K))() - contErr*K
|
||||
)
|
||||
*(
|
||||
alpha1()/mixture.thermo1().Cv()()
|
||||
+ alpha2()/mixture.thermo2().Cv()()
|
||||
)
|
||||
==
|
||||
fvOptions(rho, T)
|
||||
);
|
||||
|
||||
TEqn.relax();
|
||||
|
||||
fvOptions.constrain(TEqn);
|
||||
|
||||
TEqn.solve();
|
||||
|
||||
fvOptions.correct(T);
|
||||
|
||||
mixture.correctThermo();
|
||||
mixture.correct();
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
|
||||
- fvm::Sp(contErr, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
+ turbulence.divDevRhoReff(U)
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
cellMask*fvc::reconstruct
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
volScalarField::Internal Sp
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dgdt.dimensions(), Zero)
|
||||
);
|
||||
|
||||
volScalarField::Internal Su
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dgdt.dimensions(), Zero)
|
||||
);
|
||||
|
||||
forAll(dgdt, celli)
|
||||
{
|
||||
if (dgdt[celli] > 0.0)
|
||||
{
|
||||
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
||||
}
|
||||
else if (dgdt[celli] < 0.0)
|
||||
{
|
||||
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField::Internal divU
|
||||
(
|
||||
mesh.moving()
|
||||
? fvc::div(phi + mesh.phi())
|
||||
: fvc::div(phi)
|
||||
);
|
||||
@ -0,0 +1,138 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Reading field p_rgh\n" << endl;
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
|
||||
twoPhaseMixtureThermo mixture(U, phi);
|
||||
|
||||
volScalarField& alpha1(mixture.alpha1());
|
||||
volScalarField& alpha2(mixture.alpha2());
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
const volScalarField& rho1 = mixture.thermo1().rho();
|
||||
const volScalarField& rho2 = mixture.thermo2().rho();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
alpha1*rho1 + alpha2*rho2
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
"pMin",
|
||||
dimPressure,
|
||||
mixture
|
||||
);
|
||||
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
#include "gh.H"
|
||||
|
||||
|
||||
// Mass flux
|
||||
// Initialisation does not matter because rhoPhi is reset after the
|
||||
// alpha1 solution before it is used in the U equation.
|
||||
surfaceScalarField rhoPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
fvc::interpolate(rho)*phi
|
||||
);
|
||||
|
||||
volScalarField dgdt(alpha1*fvc::div(phi));
|
||||
|
||||
#include "createAlphaFluxes.H"
|
||||
|
||||
// Construct compressible turbulence model
|
||||
compressibleInterPhaseTransportModel turbulence
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
rhoPhi,
|
||||
alphaPhi10,
|
||||
mixture
|
||||
);
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// Overset specific
|
||||
|
||||
// Add solver-specific interpolations
|
||||
{
|
||||
wordHashSet& nonInt =
|
||||
const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
|
||||
|
||||
nonInt.insert("HbyA");
|
||||
nonInt.insert("grad(p_rgh)");
|
||||
nonInt.insert("nHat");
|
||||
nonInt.insert("surfaceIntegrate(phi)");
|
||||
nonInt.insert("surfaceIntegrate(phiHbyA)");
|
||||
nonInt.insert("cellMask");
|
||||
nonInt.insert("cellDisplacement");
|
||||
nonInt.insert("interpolatedCells");
|
||||
nonInt.insert("cellInterpolationWeight");
|
||||
nonInt.insert("pcorr");
|
||||
}
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
@ -0,0 +1,240 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
overCompressibleInterDyMFoam
|
||||
|
||||
Group
|
||||
grpMultiphaseSolvers
|
||||
|
||||
Description
|
||||
Solver for two compressible, non-isothermal, immiscible fluids using VOF
|
||||
(i.e. volume of fluid) phase-fraction based interface capturing approach.
|
||||
|
||||
This solver supports dynamic mesh motions including overset cases.
|
||||
|
||||
The momentum and other fluid properties are of the "mixture" and a single
|
||||
momentum equation is solved.
|
||||
|
||||
Either mixture or two-phase transport modelling may be selected. In the
|
||||
mixture approach, a single laminar, RAS or LES model is selected to model
|
||||
the momentum stress. In the Euler-Euler two-phase approach separate
|
||||
laminar, RAS or LES selected models are selected for each of the phases.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "CMULES.H"
|
||||
#include "EulerDdtScheme.H"
|
||||
#include "CrankNicolsonDdtScheme.H"
|
||||
#include "subCycle.H"
|
||||
#include "compressibleInterPhaseTransportModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
#include "cellCellStencilObject.H"
|
||||
#include "localMin.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "transform.H"
|
||||
#include "fvMeshSubset.H"
|
||||
#include "oversetAdjustPhi.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Solver for two compressible, non-isothermal, immiscible fluids"
|
||||
" using VOF phase-fraction based interface capturing approach.\n"
|
||||
"Supports dynamic mesh motions including overset cases."
|
||||
);
|
||||
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createTimeControls.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "createFields.H"
|
||||
|
||||
volScalarField& p = mixture.p();
|
||||
volScalarField& T = mixture.T();
|
||||
const volScalarField& psi1 = mixture.thermo1().psi();
|
||||
const volScalarField& psi2 = mixture.thermo2().psi();
|
||||
|
||||
#include "correctPhi.H"
|
||||
#include "createUf.H"
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
|
||||
// Do not apply previous time-step mesh compression flux
|
||||
// if the mesh topology changed
|
||||
if (mesh.topoChanging())
|
||||
{
|
||||
talphaPhi1Corr0.clear();
|
||||
}
|
||||
|
||||
gh = (g & mesh.C()) - ghRef;
|
||||
ghf = (g & mesh.Cf()) - ghRef;
|
||||
|
||||
// Update cellMask field for blocking out hole cells
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.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();
|
||||
|
||||
// Zero phi on current H-I
|
||||
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
|
||||
|
||||
phi *= faceMask;
|
||||
U *= cellMask;
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
#include "alphaControls.H"
|
||||
#include "compressibleAlphaEqnSubCycle.H"
|
||||
|
||||
const surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
rhoPhi *= faceMask;
|
||||
|
||||
turbulence.correctPhasePhi();
|
||||
|
||||
#include "UEqn.H"
|
||||
volScalarField divUp("divUp", fvc::div(fvc::absolute(phi, U), p));
|
||||
#include "TEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence.correct();
|
||||
}
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,177 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
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);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*faceMask*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
|
||||
|
||||
tmp<fvScalarMatrix> p_rghEqnComp1;
|
||||
tmp<fvScalarMatrix> p_rghEqnComp2;
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
#include "rhofs.H"
|
||||
|
||||
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
|
||||
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
|
||||
|
||||
p_rghEqnComp1 =
|
||||
pos(alpha1)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
|
||||
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
|
||||
)/rho1
|
||||
- fvc::ddt(alpha1) - fvc::div(alphaPhi1)
|
||||
+ (alpha1/rho1)
|
||||
*correction
|
||||
(
|
||||
psi1*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
|
||||
)
|
||||
);
|
||||
p_rghEqnComp1.ref().relax();
|
||||
|
||||
p_rghEqnComp2 =
|
||||
pos(alpha2)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
|
||||
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
|
||||
)/rho2
|
||||
- fvc::ddt(alpha2) - fvc::div(alphaPhi2)
|
||||
+ (alpha2/rho2)
|
||||
*correction
|
||||
(
|
||||
psi2*fvm::ddt(p_rgh)
|
||||
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
|
||||
)
|
||||
);
|
||||
p_rghEqnComp2.ref().relax();
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "rhofs.H"
|
||||
|
||||
p_rghEqnComp1 =
|
||||
pos(alpha1)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
|
||||
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
|
||||
)/rho1
|
||||
- fvc::ddt(alpha1) - fvc::div(alphaPhi1)
|
||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh))
|
||||
);
|
||||
|
||||
p_rghEqnComp2 =
|
||||
pos(alpha2)
|
||||
*(
|
||||
(
|
||||
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
|
||||
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
|
||||
)/rho2
|
||||
- fvc::ddt(alpha2) - fvc::div(alphaPhi2)
|
||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh))
|
||||
);
|
||||
}
|
||||
|
||||
// Cache p_rgh prior to solve for density update
|
||||
volScalarField p_rgh_0(p_rgh);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqnIncomp
|
||||
(
|
||||
fvc::div(phiHbyA)
|
||||
- fvm::laplacian(rAUf, p_rgh)
|
||||
);
|
||||
|
||||
solve
|
||||
(
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
|
||||
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
|
||||
);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
||||
p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
|
||||
|
||||
dgdt =
|
||||
(
|
||||
alpha1*(p_rghEqnComp2 & p_rgh)
|
||||
- alpha2*(p_rghEqnComp1 & p_rgh)
|
||||
);
|
||||
|
||||
phi = phiHbyA + p_rghEqnIncomp.flux();
|
||||
|
||||
U =
|
||||
cellMask*
|
||||
(
|
||||
HbyA
|
||||
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf)
|
||||
);
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Uf = fvc::interpolate(U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
Uf += n*(fvc::absolute(phi, U)/mesh.magSf() - (n & Uf));
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
// Zero faces H-I for transport Eq after pEq
|
||||
phi *= faceMask;
|
||||
|
||||
// Update densities from change in p_rgh
|
||||
mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0));
|
||||
mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0));
|
||||
|
||||
rho = alpha1*rho1 + alpha2*rho2;
|
||||
|
||||
// Correct p_rgh for consistency with p and the updated densities
|
||||
p_rgh = p - rho*gh;
|
||||
p_rgh.correctBoundaryConditions();
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -59,24 +59,23 @@ class multiphaseMixtureThermo
|
||||
{
|
||||
public:
|
||||
|
||||
//- Symmetric pair of interface names
|
||||
class interfacePair
|
||||
:
|
||||
public Pair<word>
|
||||
{
|
||||
public:
|
||||
|
||||
struct hash
|
||||
{
|
||||
label operator()(const interfacePair& key) const
|
||||
{
|
||||
return word::hash()(key.first()) + word::hash()(key.second());
|
||||
}
|
||||
};
|
||||
// Always use symmetric hashing
|
||||
using hasher = Pair<word>::symmHasher;
|
||||
|
||||
// Always use symmetric hashing (alias)
|
||||
using hash = Pair<word>::symmHasher;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
interfacePair() {} // = default
|
||||
interfacePair() = default;
|
||||
|
||||
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
||||
:
|
||||
@ -97,11 +96,7 @@ public:
|
||||
const interfacePair& b
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
((a.first() == b.first()) && (a.second() == b.second()))
|
||||
|| ((a.first() == b.second()) && (a.second() == b.first()))
|
||||
);
|
||||
return (0 != Pair<word>::compare(a, b));
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
@ -117,7 +112,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Dictionary of phases
|
||||
PtrDictionary<phaseModel> phases_;
|
||||
@ -140,7 +135,7 @@ private:
|
||||
const dimensionedScalar deltaN_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
// Private Member Functions
|
||||
|
||||
void calcAlphas();
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude\
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
@ -14,13 +15,15 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/multiphase/interFoam
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-ldynamicFvMesh \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lcompressibleTransportModels \
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,16 +42,14 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "subCycle.H"
|
||||
#include "multiphaseSystem.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
#include "radiationModel.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "fvcDDt.H"
|
||||
#include "zeroField.H"
|
||||
#include "CorrectPhi.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -70,14 +68,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createDyMControls.H"
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
|
||||
#include "initCorrectPhi.H"
|
||||
#include "createUfIfPresent.H"
|
||||
|
||||
#include "createFvOptions.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
@ -89,7 +91,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "readDyMControls.H"
|
||||
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
@ -105,6 +108,28 @@ int main(int argc, char *argv[])
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
gh = (g & mesh.C()) - ghRef;
|
||||
ghf = (g & mesh.Cf()) - ghRef;
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
// Calculate absolute flux
|
||||
// from the mapped surface velocity
|
||||
phi = mesh.Sf() & Uf();
|
||||
|
||||
#include "correctPhi.H"
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "UEqn.H"
|
||||
#include "YEqns.H"
|
||||
#include "TEqn.H"
|
||||
|
||||
@ -1,17 +1,31 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
if (correctPhi)
|
||||
{
|
||||
rAU.ref() = 1.0/UEqn.A();
|
||||
}
|
||||
else
|
||||
{
|
||||
rAU = 1.0/UEqn.A();
|
||||
}
|
||||
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU()));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
HbyA = rAU()*UEqn.H();
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
+ fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
fvc::makeRelative(phiHbyA, U);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
@ -50,7 +64,7 @@
|
||||
|
||||
p_rgh.relax();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU()*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
@ -58,6 +72,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
// Correct Uf if the mesh is moving
|
||||
fvc::correctUf(Uf, U, phi);
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
p == p_rgh + rho*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
@ -70,4 +92,9 @@
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
|
||||
if (!correctPhi)
|
||||
{
|
||||
rAU.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,9 +97,15 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
|
||||
);
|
||||
|
||||
#include "correctPhi.H"
|
||||
if (correctPhi)
|
||||
{
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
#include "createUf.H"
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
if (!LTS)
|
||||
@ -108,9 +114,6 @@ int main(int argc, char *argv[])
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
|
||||
@ -4,7 +4,9 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType phaseChangeTwoPhaseMixtures
|
||||
|
||||
wmake $targetType
|
||||
wmake $targetType interPhaseChangeDyMFoam
|
||||
wmake $targetType overInterPhaseChangeDyMFoam
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
overInterPhaseChangeDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/overInterPhaseChangeDyMFoam
|
||||
@ -0,0 +1,35 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../../interFoam/overInterDyMFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I../phaseChangeTwoPhaseMixtures/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \
|
||||
-I$(LIB_SRC)/overset/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lphaseChangeTwoPhaseMixtures \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-loverset \
|
||||
-lwaveModels
|
||||
@ -0,0 +1,31 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
|
||||
- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
|
||||
+ turbulence->divDevRhoReff(rho, U)
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
cellMask*fvc::reconstruct
|
||||
(
|
||||
(
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
p_rgh,
|
||||
surfaceScalarField("rAUf", fvc::interpolate(rAU)),
|
||||
divU,
|
||||
pimple
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
@ -0,0 +1,158 @@
|
||||
Info<< "Reading field p_rgh\n" << endl;
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
|
||||
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
|
||||
autoPtr<phaseChangeTwoPhaseMixture> mixture =
|
||||
phaseChangeTwoPhaseMixture::New(U, phi);
|
||||
|
||||
volScalarField& alpha1(mixture->alpha1());
|
||||
volScalarField& alpha2(mixture->alpha2());
|
||||
|
||||
const dimensionedScalar& rho1 = mixture->rho1();
|
||||
const dimensionedScalar& rho2 = mixture->rho2();
|
||||
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
alpha1*rho1 + alpha2*rho2
|
||||
);
|
||||
rho.oldTime();
|
||||
|
||||
|
||||
// Construct interface from alpha1 distribution
|
||||
interfaceProperties interface(alpha1, U, mixture());
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, mixture())
|
||||
);
|
||||
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
#include "gh.H"
|
||||
|
||||
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
p_rgh + rho*gh
|
||||
);
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p,
|
||||
p_rgh,
|
||||
pimple.dict(),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, pRefCell)
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
mesh.setFluxRequired(alpha1.name());
|
||||
|
||||
#include "createFvOptions.H"
|
||||
|
||||
IOobject alphaPhi10Header
|
||||
(
|
||||
IOobject::groupName("alphaPhi0", alpha1.group()),
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
// MULES flux from previous time-step
|
||||
surfaceScalarField alphaPhi10
|
||||
(
|
||||
alphaPhi10Header,
|
||||
phi*fvc::interpolate(alpha1)
|
||||
);
|
||||
|
||||
|
||||
// Overset specific
|
||||
|
||||
// Add solver-specific interpolations
|
||||
{
|
||||
wordHashSet& nonInt =
|
||||
const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
|
||||
|
||||
nonInt.insert("HbyA");
|
||||
nonInt.insert("grad(p_rgh)");
|
||||
nonInt.insert("nHat");
|
||||
nonInt.insert("surfaceIntegrate(phi)");
|
||||
nonInt.insert("surfaceIntegrate(phiHbyA)");
|
||||
nonInt.insert("cellMask");
|
||||
nonInt.insert("cellDisplacement");
|
||||
nonInt.insert("interpolatedCells");
|
||||
nonInt.insert("cellInterpolationWeight");
|
||||
nonInt.insert("pcorr");
|
||||
}
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
@ -0,0 +1,250 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
overInterPhaseChangeDyMFoam
|
||||
|
||||
Group
|
||||
grpMultiphaseSolvers grpMovingMeshSolvers
|
||||
|
||||
Description
|
||||
Solver for two incompressible, isothermal, immiscible fluids with
|
||||
phase-change (e.g. cavitation) using VOF (i.e. volume of fluid)
|
||||
phase-fraction based interface capturing, with optional dynamic mesh
|
||||
motion (including overset) and mesh topology changes including adaptive
|
||||
re-meshing.
|
||||
|
||||
The momentum and other fluid properties are of the "mixture" and a
|
||||
single momentum equation is solved.
|
||||
|
||||
The set of phase-change models provided are designed to simulate cavitation
|
||||
but other mechanisms of phase-change are supported within this solver
|
||||
framework.
|
||||
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "CorrectPhi.H"
|
||||
|
||||
#include "cellCellStencilObject.H"
|
||||
#include "localMin.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "transform.H"
|
||||
#include "oversetAdjustPhi.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"Solver for two incompressible, isothermal, immiscible fluids with"
|
||||
" phase-change\n"
|
||||
"using VOF (volume of fluid) phase-fraction based interface capturing,"
|
||||
" with optional dynamic mesh motion (including overset)\n"
|
||||
"and mesh topology changes including adaptive re-meshing."
|
||||
);
|
||||
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createTimeControls.H"
|
||||
#include "createDyMControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
|
||||
volScalarField rAU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rAU",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
|
||||
);
|
||||
|
||||
#include "createUf.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readControls.H"
|
||||
|
||||
// Store divU from the previous mesh so that it can be mapped
|
||||
// and used in correctPhi to ensure the corrected phi has the
|
||||
// same divergence
|
||||
volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U)));
|
||||
|
||||
#include "CourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
|
||||
gh = (g & mesh.C()) - ghRef;
|
||||
ghf = (g & mesh.Cf()) - ghRef;
|
||||
|
||||
// Update cellMask field for blocking out hole cells
|
||||
#include "setCellMask.H"
|
||||
#include "setInterpolatedCells.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();
|
||||
|
||||
// Zero phi on current H-I
|
||||
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
|
||||
|
||||
phi *= faceMask;
|
||||
U *= cellMask;
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
#include "alphaControls.H"
|
||||
|
||||
surfaceScalarField rhoPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhi",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimMass/dimTime, Zero)
|
||||
);
|
||||
|
||||
mixture->correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
const surfaceScalarField faceMask
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask)
|
||||
);
|
||||
rhoPhi *= faceMask;
|
||||
|
||||
interface.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,101 @@
|
||||
{
|
||||
rAU = 1.0/UEqn.A();
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::flux(HbyA)
|
||||
);
|
||||
|
||||
|
||||
if (ddtCorr)
|
||||
{
|
||||
surfaceScalarField faceMaskOld
|
||||
(
|
||||
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
|
||||
);
|
||||
phiHbyA += faceMaskOld*fvc::ddtCorr(U, Uf);
|
||||
}
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
fvc::makeRelative(phiHbyA, U);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*faceMask*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p_rgh, U, phiHbyA, rAUf);
|
||||
|
||||
Pair<tmp<volScalarField>> vDotP = mixture->vDotP();
|
||||
const volScalarField& vDotcP = vDotP[0]();
|
||||
const volScalarField& vDotvP = vDotP[1]();
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
|
||||
- (vDotvP - vDotcP)*(mixture->pSat() - rho*gh)
|
||||
+ fvm::Sp(vDotvP - vDotcP, p_rgh)
|
||||
);
|
||||
|
||||
|
||||
//p_rghEqn.setReference(pRefCell, pRefValue);
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA + p_rghEqn.flux();
|
||||
|
||||
p_rgh.relax();
|
||||
|
||||
U =
|
||||
cellMask
|
||||
*(HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf));
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
{
|
||||
Uf = fvc::interpolate(U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
// Zero faces H-I for transport Eq after pEq
|
||||
phi *= faceMask;
|
||||
|
||||
p == p_rgh + rho*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, pRefCell)
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user