Compare commits
386 Commits
maintenanc
...
rpmbuild-2
| Author | SHA1 | Date | |
|---|---|---|---|
| c5f3491968 | |||
| 9b0e0b074f | |||
| 8f214f744c | |||
| 02b2b3a450 | |||
| 935186b854 | |||
| 26ce72568b | |||
| 725615039d | |||
| 9a893e0c1b | |||
| a72ae125b9 | |||
| b2dce9dffb | |||
| 99cf52f453 | |||
| ae6320c285 | |||
| 5798c875d4 | |||
| df86bef1bb | |||
| 0b312195e4 | |||
| 127f4268af | |||
| 0bd1b0feac | |||
| 42178fdd5d | |||
| f815a12bba | |||
| 4e6e7d59da | |||
| 9645e1adc2 | |||
| 7f2cbd6cd4 | |||
| 40ff2acdd6 | |||
| 90ad6ce9cf | |||
| 028ca26617 | |||
| 014dbf4004 | |||
| 3f172ccae1 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 5ba31cd5de | |||
| 221c3c0200 | |||
| f5a931d4b5 | |||
| 9cc497373b | |||
| 1c0714f9b8 | |||
| b99078768e | |||
| 201f117f5f | |||
| dc27daf4f4 | |||
| f8c2928a88 | |||
| 2f4d864c85 | |||
| 5c4d714b45 | |||
| 85ff3d39d4 | |||
| 67e41f02ef | |||
| cd3fa1c04b | |||
| 1f0476a84c | |||
| 1ca99a2c94 | |||
| cd1350a87f | |||
| 6ccc587bea | |||
| cb6dedacfc | |||
| 9a2a22a03a | |||
| 3ce18cb6e2 | |||
| 3299f9ac0d | |||
| 853f50f7da | |||
| ec609b90b8 | |||
| da1e6ea8d0 | |||
| 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 | |||
| 9b0f1b67df | |||
| fcd17db839 | |||
| fcfaf9ba88 | |||
| 1020991796 | |||
| 125e60ca67 | |||
| 1bb7afc7fe | |||
| af80006f97 | |||
| 66d1b54a79 | |||
| 0b1a33e9be | |||
| 531e8ab66d | |||
| b97cd5c380 | |||
| f8a0677a66 | |||
| 8c460d8ec9 | |||
| f997013eb8 | |||
| 2954f55f6a | |||
| 0990d30b73 | |||
| 48fdec46c7 | |||
| 8f4b080542 | |||
| 9f7a400952 | |||
| e71bf4445a | |||
| aa9cd50db9 | |||
| 6cdf89dced | |||
| f24e3f113f | |||
| 5080d3cd1f | |||
| 10787d7e82 | |||
| 3941159d6a | |||
| 13152510b3 | |||
| 170d73f4ec | |||
| aa1e1eb15d | |||
| 8bda4fadbe | |||
| 2c7e95d2cb | |||
| 9b56c6b1ac | |||
| 64c6f350ae | |||
| 902f09b688 | |||
| 0d6de94e8e | |||
| d770ce7aa8 | |||
| 0e7a2d1529 | |||
| 648f0593c8 | |||
| 71812c21c5 | |||
| 80bb1b9f57 | |||
| d38a4a9177 | |||
| 5f805b0592 | |||
| 84a1452995 | |||
| c036d4207b | |||
| 542dae4a6d | |||
| f5e689c6a8 | |||
| 0723bcbf8a |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v1806|v1812|v1906 etc
|
||||
OpenFOAM version : v1806|v1812|v1906|v1912|v2006|v2012|v2106 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
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=210618
|
||||
api=2106
|
||||
patch=220610
|
||||
|
||||
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
|
||||
|
||||
@ -160,7 +160,7 @@ int main(int argc, char *argv[])
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "\n end\n";
|
||||
Info<< "End\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ int main(int argc, char *argv[])
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "\n end\n";
|
||||
Info<< "End\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -6,11 +6,13 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lchemistryModel
|
||||
-lchemistryModel \
|
||||
-lthermophysicalProperties
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dynamicFvMesh::defaultRegion,
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
|
||||
@ -44,11 +44,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
// Forward Declarations
|
||||
class magnet;
|
||||
Istream& operator>>(Istream&, magnet&);
|
||||
Ostream& operator<<(Ostream&, const magnet&);
|
||||
|
||||
@ -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
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -9,7 +9,12 @@
|
||||
phic += (interface.cAlpha()*icAlpha)*fvc::interpolate(mag(U));
|
||||
}
|
||||
|
||||
volScalarField divU(fvc::div(phi));
|
||||
volScalarField divU
|
||||
(
|
||||
mesh.moving()
|
||||
? fvc::div(phi + mesh.phi())
|
||||
: fvc::div(phi)
|
||||
);
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,24 +68,23 @@ class multiphaseMixture
|
||||
{
|
||||
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)
|
||||
:
|
||||
@ -105,11 +105,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!=
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
}
|
||||
else if (rhoType == "field")
|
||||
{
|
||||
rhoIO.readOpt() = IOobject::MUST_READ;
|
||||
rhoIO.readOpt(IOobject::MUST_READ);
|
||||
|
||||
rhoPtr.reset
|
||||
(
|
||||
@ -102,7 +102,7 @@
|
||||
}
|
||||
else if (EType == "field")
|
||||
{
|
||||
EHeader.readOpt() = IOobject::MUST_READ;
|
||||
EHeader.readOpt(IOobject::MUST_READ);
|
||||
|
||||
EPtr.reset
|
||||
(
|
||||
@ -156,7 +156,7 @@
|
||||
}
|
||||
else if (nuType == "field")
|
||||
{
|
||||
nuIO.readOpt() = IOobject::MUST_READ;
|
||||
nuIO.readOpt(IOobject::MUST_READ);
|
||||
nuPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
|
||||
@ -81,7 +81,7 @@ if (thermalStress)
|
||||
}
|
||||
else if (CType == "field")
|
||||
{
|
||||
CIO.readOpt() = IOobject::MUST_READ;
|
||||
CIO.readOpt(IOobject::MUST_READ);
|
||||
|
||||
CPtr.reset
|
||||
(
|
||||
@ -136,7 +136,7 @@ if (thermalStress)
|
||||
}
|
||||
else if (kType == "field")
|
||||
{
|
||||
rhoKIO.readOpt() = IOobject::MUST_READ;
|
||||
rhoKIO.readOpt(IOobject::MUST_READ);
|
||||
|
||||
rhoKPtr.reset
|
||||
(
|
||||
@ -191,7 +191,7 @@ if (thermalStress)
|
||||
}
|
||||
else if (alphaType == "field")
|
||||
{
|
||||
alphaIO.readOpt() = IOobject::MUST_READ;
|
||||
alphaIO.readOpt(IOobject::MUST_READ);
|
||||
|
||||
alphaPtr.reset
|
||||
(
|
||||
|
||||
6
applications/test/00-machine-sizes/Make/options
Normal file
6
applications/test/00-machine-sizes/Make/options
Normal file
@ -0,0 +1,6 @@
|
||||
/* Disable normal project defaults */
|
||||
PROJECT_INC =
|
||||
PROJECT_LIBS =
|
||||
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,17 +31,29 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <cstdint>
|
||||
#include <climits>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <typeinfo>
|
||||
|
||||
template<class T>
|
||||
void print(const char* msg)
|
||||
void print(const char* name, bool showLimits = true)
|
||||
{
|
||||
std::cout<< msg << ' ' << sizeof(T) << '\n';
|
||||
std::cout
|
||||
<< "name=\"" << name << "\" sizeof=" << sizeof(T);
|
||||
|
||||
if (showLimits)
|
||||
{
|
||||
std::cout
|
||||
<< " \"max\"=" << std::numeric_limits<T>::max();
|
||||
}
|
||||
|
||||
std::cout<< '\n';
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
@ -52,12 +64,13 @@ int main(int argc, char *argv[])
|
||||
print<short>("short");
|
||||
print<int>("int");
|
||||
print<long>("long");
|
||||
print<unsigned long>("unsigned long");
|
||||
print<std::size_t>("std::size_t");
|
||||
print<long long>("long long");
|
||||
|
||||
print<float>("float");
|
||||
print<double>("double");
|
||||
print<long double>("long double");
|
||||
print<std::string>("std::string");
|
||||
print<std::string::size_type>("std::string::size_type");
|
||||
|
||||
std::cout << "\n---\nEnd\n\n";
|
||||
|
||||
@ -186,14 +186,14 @@ int main(int argc, char *argv[])
|
||||
FixedList<label, 4> list1{2, 3, 4, 5};
|
||||
|
||||
Info<< "list1:" << list1
|
||||
<< " hash:" << FixedList<label, 4>::Hash<>()(list1) << nl
|
||||
<< " hash:" << FixedList<label, 4>::hasher()(list1) << nl
|
||||
<< " hash:" << Hash<FixedList<label, 4>>()(list1) << nl;
|
||||
|
||||
label a[4] = {0, 1, 2, 3};
|
||||
FixedList<label, 4> list2(a);
|
||||
|
||||
Info<< "list2:" << list2
|
||||
<< " hash:" << FixedList<label, 4>::Hash<>()(list2) << nl
|
||||
<< " hash:" << FixedList<label, 4>::hasher()(list2) << nl
|
||||
<< " hash:" << Hash<FixedList<label, 4>>()(list2) << nl;
|
||||
|
||||
|
||||
|
||||
@ -1,15 +1,6 @@
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0 \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-DFULLDEBUG -g \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangianIntermediate \
|
||||
-lradiationModels \
|
||||
-lregionModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling
|
||||
-lmeshTools
|
||||
|
||||
@ -32,7 +32,8 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "argList.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Function1.H"
|
||||
#include "scalarIndList.H"
|
||||
#include "scalarField.H"
|
||||
@ -40,6 +41,8 @@ Description
|
||||
#include "linearInterpolationWeights.H"
|
||||
#include "splineInterpolationWeights.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -26,11 +26,44 @@ x
|
||||
);
|
||||
|
||||
|
||||
function1 table
|
||||
constant1 constant 100;
|
||||
|
||||
table1 table
|
||||
(
|
||||
(0 0)(10 1)
|
||||
);
|
||||
|
||||
table2
|
||||
{
|
||||
type table;
|
||||
values
|
||||
(
|
||||
(0 0)(10 1)
|
||||
);
|
||||
}
|
||||
|
||||
table3
|
||||
{
|
||||
type table;
|
||||
file "<constant>/table-values";
|
||||
}
|
||||
|
||||
poly1 polynomial
|
||||
(
|
||||
(0 1)
|
||||
(1 1)
|
||||
);
|
||||
|
||||
poly2
|
||||
{
|
||||
type polynomial;
|
||||
coeffs
|
||||
(
|
||||
(0 1)
|
||||
(1 1)
|
||||
);
|
||||
}
|
||||
|
||||
function2
|
||||
{
|
||||
type expression;
|
||||
|
||||
9
applications/test/Function1/case1/constant/table-values
Normal file
9
applications/test/Function1/case1/constant/table-values
Normal file
@ -0,0 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
// Some table values
|
||||
|
||||
(
|
||||
(0 0)
|
||||
(20 1)
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -125,28 +125,39 @@ int main()
|
||||
myTable.set("pi", new double(3.14159));
|
||||
myTable.set("natlog", new double(2.718282));
|
||||
myTable.insert("sqrt2", autoPtr<double>::New(1.414214));
|
||||
myTable.insert("euler", autoPtr<double>::New(0.577216));
|
||||
|
||||
HashTable<std::unique_ptr<double>, word, string::hash> myTable1;
|
||||
HashTable<std::unique_ptr<double>> myTable1;
|
||||
|
||||
myTable1.set("abc", std::unique_ptr<double>(new double(42.1)));
|
||||
myTable1.set("pi", std::unique_ptr<double>(new double(3.14159)));
|
||||
myTable1.set("natlog", std::unique_ptr<double>(new double(2.718282)));
|
||||
|
||||
HashTable<autoPtr<double>, word, string::hash> myTable2;
|
||||
HashTable<autoPtr<double>> myTable2;
|
||||
|
||||
myTable2.set("abc", autoPtr<double>(new double(42.1)));
|
||||
myTable2.set("pi", autoPtr<double>(new double(3.14159)));
|
||||
myTable2.set("natlog", autoPtr<double>(new double(2.718282)));
|
||||
myTable2.insert("sqrt2", autoPtr<double>::New(1.414214));
|
||||
|
||||
// Info<< myTable << endl;
|
||||
Info<< "Initial table" << nl;
|
||||
printTable(myTable);
|
||||
|
||||
Info<< "print" << nl;
|
||||
Info<< myTable2 << nl;
|
||||
|
||||
auto iter2 = myTable2.find("pi");
|
||||
|
||||
Info<<"PI: " << **iter2 << nl;
|
||||
|
||||
{
|
||||
auto iter2 = myTable2.find("pi");
|
||||
Info<< nl << "Got pi=";
|
||||
if (iter2.good())
|
||||
{
|
||||
Info<< **iter2 << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "not-found" << nl;
|
||||
}
|
||||
}
|
||||
|
||||
HashPtrTable<double> copy(myTable);
|
||||
|
||||
@ -165,6 +176,9 @@ int main()
|
||||
myTable.erase("abc");
|
||||
myTable.erase("unknownKey");
|
||||
|
||||
myTable.release("euler");
|
||||
|
||||
Info<< "After erasure" << nl;
|
||||
printTable(myTable);
|
||||
|
||||
HashPtrTable<double> moved(std::move(copy));
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -80,6 +80,11 @@ void printMinMax(const HashSet<Key, Hash>& set)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "labelHashSet hasher: "
|
||||
<< typeid(labelHashSet::hasher).name() << nl
|
||||
<< "HashSet<label> hasher: "
|
||||
<< typeid(HashSet<label>::hasher).name() << nl << nl;
|
||||
|
||||
hashedWordList words
|
||||
{
|
||||
"abc",
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
Test-Hashing.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-Hashing
|
||||
@ -1,346 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
testHashing
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "IOobject.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
#include "stringList.H"
|
||||
#include "labelList.H"
|
||||
#include "labelPair.H"
|
||||
#include "wordPair.H"
|
||||
#include "edgeList.H"
|
||||
#include "faceList.H"
|
||||
#include "triFaceList.H"
|
||||
|
||||
#include "Hash.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
void infoHashString
|
||||
(
|
||||
unsigned modulus,
|
||||
std::initializer_list<std::string> lst
|
||||
)
|
||||
{
|
||||
if (modulus)
|
||||
{
|
||||
Info<< "basic string hashing (mod " << label(modulus) << ")" << nl;
|
||||
|
||||
for (const auto& str : lst)
|
||||
{
|
||||
Info<<"hash(" << str.c_str() << ")="
|
||||
<< (Hash<string>()(str) % modulus) << nl;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "basic string hashing" << nl;
|
||||
|
||||
for (const auto& str : lst)
|
||||
{
|
||||
Info<<"hash(" << str.c_str() << ")="
|
||||
<< Hash<string>()(str) << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void reportHashList(const UList<string>& list)
|
||||
{
|
||||
Info<< "contiguous = " << is_contiguous<string>::value << nl << nl;
|
||||
|
||||
for (const string& val : list)
|
||||
{
|
||||
unsigned hash1 = string::hash()(val);
|
||||
|
||||
Info<< hex << hash1 << ": " << val << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<label>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
|
||||
for (const label val : list)
|
||||
{
|
||||
// Direct value
|
||||
unsigned hash1 = Hash<label>()(val);
|
||||
|
||||
// Hashed byte-wise
|
||||
unsigned hash2 = Hash<label>()(val, 0);
|
||||
|
||||
Info<< hex << hash1
|
||||
<< " (seeded: " << hash2 << ")"
|
||||
<< ": " << dec << val << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<face>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
|
||||
for (const face& f : list)
|
||||
{
|
||||
// Direct value
|
||||
unsigned hash1 = face::Hash<>()(f);
|
||||
|
||||
unsigned hash2 = Hash<face>()(f);
|
||||
|
||||
Info<< hex << "face::Hash<> " << hash1
|
||||
<< " Hash<face> " << hash2
|
||||
<< ": " << dec << flatOutput(f) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelList>& list)
|
||||
{
|
||||
for (const labelList& val : list)
|
||||
{
|
||||
unsigned hash1 = Hasher
|
||||
(
|
||||
val.cdata(),
|
||||
val.size() * sizeof(label)
|
||||
);
|
||||
|
||||
unsigned hash2 = Hash<labelList>()(val);
|
||||
unsigned hash2b = labelList::Hash<>()(val);
|
||||
|
||||
Info<< hex << hash1 << " or " << hash2
|
||||
<< "(" << hash2b << ") "
|
||||
<< ": " << dec << val << nl;
|
||||
}
|
||||
|
||||
unsigned hash2 = Hash<labelListList>()(list);
|
||||
unsigned hash2bad = HasherT(list);
|
||||
|
||||
Info<< hex << hash2 << " : " << dec << flatOutput(list) << nl
|
||||
<< hex << hash2bad << " as direct hash would be wrong"
|
||||
<< dec << nl;
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<wordPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<wordPair>::value << nl << nl;
|
||||
|
||||
for (const wordPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<wordPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = wordPair::Hash<>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2sym = wordPair::SymmHash<>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<FixedList<word,2>>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " symm-hash:" << hash2sym
|
||||
<< " : "<< dec << flatOutput(pr) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPair>::value << nl << nl;
|
||||
|
||||
for (const labelPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<labelPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPair::Hash<>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPair>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << pr << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelPairPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPairPair>::value << nl << nl;
|
||||
|
||||
for (const labelPairPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<labelPairPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPairPair::Hash<>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPairPair>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << pr << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<edge>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<edge>::value << nl << nl;
|
||||
|
||||
for (const edge& e : list)
|
||||
{
|
||||
unsigned hash1 = Hash<edge>()(e);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPair::Hash<>()(e);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPair>()(e);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << e << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<triFace>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<triFace>::value << nl << nl;
|
||||
|
||||
for (const triFace& f : list)
|
||||
{
|
||||
// direct value
|
||||
unsigned hash1 = Hash<triFace>()(f);
|
||||
unsigned hash2 = FixedList<label, 3>::Hash<>()(f);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< "): " << dec << f << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
infoHashString(8, {"asdathis1", "adsxf", "hij", "klmpq"});
|
||||
|
||||
IFstream is("hashingTests");
|
||||
|
||||
if (is.good())
|
||||
{
|
||||
Info<< nl << "Process " << is.name() << " file ..." << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< nl << "No " << is.name() << " file found ..." << nl;
|
||||
}
|
||||
|
||||
token tok;
|
||||
|
||||
while (is.good() && is.read(tok) && tok.good())
|
||||
{
|
||||
const word listType(tok.wordToken());
|
||||
|
||||
Info<< nl;
|
||||
IOobject::writeDivider(Info) << listType << nl;
|
||||
|
||||
if (listType == "stringList")
|
||||
{
|
||||
stringList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelList")
|
||||
{
|
||||
labelList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "faceList")
|
||||
{
|
||||
faceList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelListList")
|
||||
{
|
||||
List<labelList> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "wordPairList")
|
||||
{
|
||||
List<wordPair> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelPairList")
|
||||
{
|
||||
labelPairList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelPairPairList")
|
||||
{
|
||||
List<labelPairPair> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "edgeList")
|
||||
{
|
||||
edgeList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "triFaceList")
|
||||
{
|
||||
triFaceList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "unknown type: " << listType << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
224
applications/test/Hashing1/HashFunction.H
Normal file
224
applications/test/Hashing1/HashFunction.H
Normal file
@ -0,0 +1,224 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::HashFunction
|
||||
|
||||
Description
|
||||
Hash function class.
|
||||
|
||||
Verify that template overloads are properly resolved
|
||||
|
||||
Note
|
||||
The second template parameter (bool) is used for SFINAE overloading,
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef HashFunction_H
|
||||
#define HashFunction_H
|
||||
|
||||
#include "Hash.H"
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
#define HashTypeInfo(Args) void info() { std::cerr<< "" Args << "\n"; }
|
||||
#else
|
||||
#define HashTypeInfo(Args) void info() {}
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Hash Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class T, class SFINAEType=bool>
|
||||
struct HashFun
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "default"; }
|
||||
#endif
|
||||
HashTypeInfo("plain hash")
|
||||
|
||||
unsigned operator()(const T& obj, unsigned seed=0) const
|
||||
{
|
||||
return Foam::Hasher(&obj, sizeof(obj), seed);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Hashing for label
|
||||
template<> struct HashFun<Foam::label> : Hash<label>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "label"; }
|
||||
#endif
|
||||
HashTypeInfo("hash label")
|
||||
};
|
||||
|
||||
|
||||
//- Hashing for pointers, interpret pointer as a integer type
|
||||
template<> struct HashFun<void*> : Hash<void *>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "pointer"; }
|
||||
#endif
|
||||
HashTypeInfo("hash ptr")
|
||||
};
|
||||
|
||||
|
||||
//- Hashing for string types
|
||||
template<class StringType>
|
||||
struct HashFun
|
||||
<
|
||||
StringType,
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_base_of<std::string, StringType>::value, bool
|
||||
>::type
|
||||
>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "string"; }
|
||||
#endif
|
||||
HashTypeInfo("hash string")
|
||||
|
||||
unsigned operator()(const std::string& obj, unsigned seed=0) const
|
||||
{
|
||||
return Foam::Hasher(obj.data(), obj.size(), seed);
|
||||
}
|
||||
};
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Various
|
||||
#include "edge.H"
|
||||
#include "face.H"
|
||||
#include "triFace.H"
|
||||
#include "Pair.H"
|
||||
#include "Tuple2.H"
|
||||
#include "DynamicList.H"
|
||||
#include "FixedList.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
template<> struct HashFun<edge> : Hash<edge>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "edge"; }
|
||||
#endif
|
||||
HashTypeInfo("hash edge")
|
||||
};
|
||||
|
||||
|
||||
template<> struct HashFun<face> : Hash<face>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "face"; }
|
||||
#endif
|
||||
HashTypeInfo("hash face")
|
||||
};
|
||||
|
||||
|
||||
template<> struct HashFun<triFace> : Hash<triFace>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "triFace"; }
|
||||
#endif
|
||||
HashTypeInfo("hash triFace")
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
struct HashFun<Pair<T>> : Hash<Pair<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "Pair"; }
|
||||
#endif
|
||||
HashTypeInfo("hash Pair")
|
||||
};
|
||||
|
||||
template<class T1, class T2>
|
||||
struct HashFun<Tuple2<T1, T2>> : Hash<Tuple2<T1, T2>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "Tuple2"; }
|
||||
#endif
|
||||
HashTypeInfo("hash Tuple2")
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
struct HashFun<List<T>> : Hash<List<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "List"; }
|
||||
#endif
|
||||
HashTypeInfo("hash List")
|
||||
};
|
||||
|
||||
template<class T> struct HashFun<UList<T>> : Hash<UList<T>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "UList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash UList")
|
||||
};
|
||||
|
||||
template<class T, int SizeMin>
|
||||
struct HashFun<DynamicList<T, SizeMin>> : Hash<DynamicList<T, SizeMin>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "DynamicList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash DynamicList")
|
||||
};
|
||||
|
||||
template<class T, unsigned N>
|
||||
struct HashFun<FixedList<T, N>> : Hash<FixedList<T, N>>
|
||||
{
|
||||
#ifdef FULLDEBUG
|
||||
static constexpr const char* name() noexcept { return "FixedList"; }
|
||||
#endif
|
||||
HashTypeInfo("hash FixedList")
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/Hashing1/Make/files
Normal file
3
applications/test/Hashing1/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-Hashing1.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-Hashing1
|
||||
163
applications/test/Hashing1/Test-Hashing1.C
Normal file
163
applications/test/Hashing1/Test-Hashing1.C
Normal file
@ -0,0 +1,163 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-Hashing1
|
||||
|
||||
Description
|
||||
Test/verify overloads of Hash function
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "IOobject.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
#include "stringList.H"
|
||||
#include "labelList.H"
|
||||
#include "labelPair.H"
|
||||
#include "wordPair.H"
|
||||
#include "edgeList.H"
|
||||
#include "faceList.H"
|
||||
#include "triFaceList.H"
|
||||
|
||||
#define FULLDEBUG
|
||||
#include "HashFunction.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
template<class T>
|
||||
unsigned rawHasher(const T& obj)
|
||||
{
|
||||
return Foam::Hasher(&obj, sizeof(T), 0u);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
typedef unsigned Type;
|
||||
Type value = 100;
|
||||
|
||||
Info<< "hash " << typeid(value).name() << " of " << value << nl;
|
||||
Info<< " Hasher: " << rawHasher(value) << nl;
|
||||
Info<< " Hash<>: " << Hash<Type>()(value) << nl;
|
||||
}
|
||||
{
|
||||
typedef int32_t Type;
|
||||
Type value = 100;
|
||||
|
||||
Info<< "hash " << typeid(value).name() << " of " << value << nl;
|
||||
Info<< " Hasher: " << rawHasher(value) << nl;
|
||||
Info<< " Hash<>: " << Hash<Type>()(value) << nl;
|
||||
}
|
||||
{
|
||||
typedef int64_t Type;
|
||||
Type value = 100;
|
||||
|
||||
Info<< "hash " << typeid(value).name() << " of " << value << nl;
|
||||
Info<< " Hasher: " << rawHasher(value) << nl;
|
||||
Info<< " Hash<>: " << Hash<Type>()(value) << nl;
|
||||
}
|
||||
|
||||
HashFun<std::string>().info();
|
||||
HashFun<string>().info();
|
||||
HashFun<Foam::word>().info();
|
||||
HashFun<Foam::keyType>().info();
|
||||
|
||||
HashFun<int>().info();
|
||||
HashFun<label>().info();
|
||||
HashFun<float>().info();
|
||||
HashFun<double>().info();
|
||||
|
||||
{
|
||||
float value = 15.f;
|
||||
|
||||
Info<< "hash of " << Foam::name(&value)
|
||||
<< " = " << HashFun<void*>()(&value) << nl;
|
||||
}
|
||||
|
||||
HashFun<labelList>().info();
|
||||
HashFun<wordUList>().info();
|
||||
HashFun<edge>().info();
|
||||
|
||||
HashFun<Pair<label>>().info();
|
||||
HashFun<labelPair>().info();
|
||||
HashFun<labelPairPair>().info();
|
||||
|
||||
HashFun<Tuple2<label, word>>().info();
|
||||
|
||||
{
|
||||
typedef Tuple2<label, word> Type;
|
||||
Type obj(10, "test");
|
||||
Info<< obj << " hash=" << Hash<Type>()(obj) << nl;
|
||||
}
|
||||
|
||||
{
|
||||
typedef Tuple2<label, label> Type;
|
||||
Type obj(10, 12);
|
||||
Info<< obj << " hash=" << Hash<Type>()(obj) << nl;
|
||||
}
|
||||
|
||||
{
|
||||
typedef Pair<label> Type;
|
||||
Type obj(10, 12);
|
||||
Info<< obj << " hash=" << Hash<Type>()(obj) << nl;
|
||||
}
|
||||
|
||||
{
|
||||
typedef std::pair<label, label> Type;
|
||||
Type obj(10, 12);
|
||||
Info<< obj << " hash=" << Hash<Type>()(obj) << nl;
|
||||
|
||||
HashSet<Type> hs;
|
||||
hs.insert(obj);
|
||||
hs.erase(obj);
|
||||
}
|
||||
|
||||
{
|
||||
Pair<label>::hasher op;
|
||||
Info<< "hasher: " << op(Pair<label>(10, 12)) << nl;
|
||||
}
|
||||
|
||||
// Not supported
|
||||
#if 0
|
||||
{
|
||||
Tuple2<label, label>::hasher op;
|
||||
Info<< "hasher: " << op(Tuple2<label>(10, 12)) << nl;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Info<< "\nEnd\n" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/Hashing2/Make/files
Normal file
3
applications/test/Hashing2/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-Hashing2.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-Hashing2
|
||||
3
applications/test/Hashing2/Make/options
Normal file
3
applications/test/Hashing2/Make/options
Normal file
@ -0,0 +1,3 @@
|
||||
EXE_INC = ${c++LESSWARN}
|
||||
|
||||
/* EXE_LIBS = */
|
||||
343
applications/test/Hashing2/Test-Hashing2.C
Normal file
343
applications/test/Hashing2/Test-Hashing2.C
Normal file
@ -0,0 +1,343 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-Hashing2
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "IOobject.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
#include "stringList.H"
|
||||
#include "labelList.H"
|
||||
#include "labelPair.H"
|
||||
#include "wordPair.H"
|
||||
#include "edgeList.H"
|
||||
#include "faceList.H"
|
||||
#include "triFaceList.H"
|
||||
|
||||
#include "Hash.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
void infoHashString
|
||||
(
|
||||
unsigned modulus,
|
||||
std::initializer_list<std::string> lst
|
||||
)
|
||||
{
|
||||
if (modulus)
|
||||
{
|
||||
Info<< "basic string hashing (mod " << label(modulus) << ")" << nl;
|
||||
|
||||
for (const auto& str : lst)
|
||||
{
|
||||
Info<<"hash(" << str.c_str() << ")="
|
||||
<< (Hash<string>()(str) % modulus) << nl;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "basic string hashing" << nl;
|
||||
|
||||
for (const auto& str : lst)
|
||||
{
|
||||
Info<<"hash(" << str.c_str() << ")="
|
||||
<< Hash<string>()(str) << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void reportHashList(const UList<string>& list)
|
||||
{
|
||||
Info<< "contiguous = " << is_contiguous<string>::value << nl << nl;
|
||||
|
||||
for (const string& val : list)
|
||||
{
|
||||
unsigned hash1 = string::hasher()(val);
|
||||
|
||||
Info<< hex << hash1 << ": " << val << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<label>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
|
||||
for (const label val : list)
|
||||
{
|
||||
// Direct value
|
||||
unsigned hash1 = Hash<label>()(val);
|
||||
|
||||
// Hashed byte-wise
|
||||
unsigned hash2 = Hash<label>()(val, 0);
|
||||
|
||||
Info<< hex << hash1
|
||||
<< " (seeded: " << hash2 << ")"
|
||||
<< ": " << dec << val << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<face>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<label>::value << nl << nl;
|
||||
|
||||
for (const face& f : list)
|
||||
{
|
||||
// Direct value
|
||||
unsigned hash1 = face::hasher()(f);
|
||||
|
||||
unsigned hash2 = Hash<face>()(f);
|
||||
|
||||
Info<< hex << "face hash " << hash1
|
||||
<< " Hash<face> " << hash2
|
||||
<< ": " << dec << flatOutput(f) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelList>& list)
|
||||
{
|
||||
for (const labelList& val : list)
|
||||
{
|
||||
unsigned hash1 = Foam::Hasher(val.cdata(), val.size_bytes());
|
||||
|
||||
unsigned hash2 = Hash<labelList>()(val);
|
||||
unsigned hash2b = labelList::hasher()(val);
|
||||
|
||||
Info<< hex << hash1 << " or " << hash2
|
||||
<< "(" << hash2b << ") "
|
||||
<< ": " << dec << val << nl;
|
||||
}
|
||||
|
||||
unsigned hash2 = Hash<labelListList>()(list);
|
||||
unsigned hash2bad = Foam::Hasher(&list, sizeof(list));
|
||||
|
||||
Info<< hex << hash2 << " : " << dec << flatOutput(list) << nl
|
||||
<< hex << hash2bad << " as direct hash would be wrong"
|
||||
<< dec << nl;
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<wordPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<wordPair>::value << nl << nl;
|
||||
|
||||
for (const wordPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<wordPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = wordPair::hasher()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2sym = wordPair::symmHasher()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<FixedList<word,2>>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " symm-hash:" << hash2sym
|
||||
<< " : "<< dec << flatOutput(pr) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPair>::value << nl << nl;
|
||||
|
||||
for (const labelPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<labelPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPair::hasher()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPair>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << pr << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<labelPairPair>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<labelPairPair>::value << nl << nl;
|
||||
|
||||
for (const labelPairPair& pr : list)
|
||||
{
|
||||
unsigned hash1 = Hash<labelPairPair>()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPairPair::hasher()(pr);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPairPair>()(pr);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << pr << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<edge>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<edge>::value << nl << nl;
|
||||
|
||||
for (const edge& e : list)
|
||||
{
|
||||
unsigned hash1 = Hash<edge>()(e);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash2 = labelPair::hasher()(e);
|
||||
|
||||
// as FixedList
|
||||
unsigned hash3 = Hash<labelPair>()(e);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< ") or " << hash3
|
||||
<< " : "<< dec << e << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reportHashList(const UList<triFace>& list)
|
||||
{
|
||||
Info<<"contiguous = " << is_contiguous<triFace>::value << nl << nl;
|
||||
|
||||
for (const triFace& f : list)
|
||||
{
|
||||
// direct value
|
||||
unsigned hash1 = Hash<triFace>()(f);
|
||||
unsigned hash2 = FixedList<label, 3>::hasher()(f);
|
||||
|
||||
Info<< hex << hash1 << " (as FixedList: " << hash2
|
||||
<< "): " << dec << f << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
infoHashString(8, {"asdathis1", "adsxf", "hij", "klmpq"});
|
||||
|
||||
IFstream is("hashingTests");
|
||||
|
||||
if (is.good())
|
||||
{
|
||||
Info<< nl << "Process " << is.name() << " file ..." << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< nl << "No " << is.name() << " file found ..." << nl;
|
||||
}
|
||||
|
||||
token tok;
|
||||
|
||||
while (is.good() && is.read(tok) && tok.good())
|
||||
{
|
||||
const word listType(tok.wordToken());
|
||||
|
||||
Info<< nl;
|
||||
IOobject::writeDivider(Info) << listType << nl;
|
||||
|
||||
if (listType == "stringList")
|
||||
{
|
||||
stringList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelList")
|
||||
{
|
||||
labelList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "faceList")
|
||||
{
|
||||
faceList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelListList")
|
||||
{
|
||||
List<labelList> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "wordPairList")
|
||||
{
|
||||
List<wordPair> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelPairList")
|
||||
{
|
||||
labelPairList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "labelPairPairList")
|
||||
{
|
||||
List<labelPairPair> list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "edgeList")
|
||||
{
|
||||
edgeList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else if (listType == "triFaceList")
|
||||
{
|
||||
triFaceList list(is);
|
||||
reportHashList(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "unknown type: " << listType << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -3,8 +3,8 @@
|
||||
#include "Hasher.H"
|
||||
#include "int.H"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
|
||||
#ifndef CLOCKS_PER_SEC
|
||||
#ifdef CLK_TCK
|
||||
@ -1048,7 +1048,7 @@ int32_t i;
|
||||
|
||||
struct tagtest {
|
||||
double res;
|
||||
char * name;
|
||||
const char * name;
|
||||
hashFn hash;
|
||||
} tests[] = {
|
||||
// { 0.0, "CRC32\t\t", GetCRC32 },
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -89,15 +89,15 @@ void writeAndRead
|
||||
const IOobject& io,
|
||||
const label sz,
|
||||
const word& writeType,
|
||||
const IOobject::readOption readOpt,
|
||||
const IOobject::readOption rOpt,
|
||||
const word& readType
|
||||
)
|
||||
{
|
||||
Pout<< "** Writing:" << writeType
|
||||
<< " Reading:" << readType << endl;
|
||||
|
||||
autoPtr<fileOperation> writeHandler(fileOperation::New(writeType, true));
|
||||
fileHandler(writeHandler);
|
||||
// The write handler
|
||||
fileHandler(fileOperation::New(writeType, true));
|
||||
|
||||
// Delete
|
||||
Pout<< "Deleting:" << fileHandler().filePath(io.objectPath()) << endl;
|
||||
@ -107,12 +107,12 @@ void writeAndRead
|
||||
Pout<< "Writing:" << fileHandler().objectPath(io, io.name()) << endl;
|
||||
doWrite<Type>(io, sz);
|
||||
|
||||
autoPtr<fileOperation> readHandler(fileOperation::New(readType, true));
|
||||
fileHandler(readHandler);
|
||||
// The read handler
|
||||
fileHandler(fileOperation::New(readType, true));
|
||||
|
||||
// Read
|
||||
IOobject readIO(io);
|
||||
readIO.readOpt() = readOpt;
|
||||
readIO.readOpt(rOpt);
|
||||
Pout<< "Reading:"
|
||||
<< fileHandler().filePath(readIO.objectPath()) << endl;
|
||||
doRead<Type>(readIO, sz);
|
||||
@ -130,12 +130,11 @@ void readIfPresent
|
||||
const word& readType
|
||||
)
|
||||
{
|
||||
autoPtr<fileOperation> readHandler(fileOperation::New(readType, true));
|
||||
fileHandler(readHandler);
|
||||
fileHandler(fileOperation::New(readType, true));
|
||||
|
||||
// Read
|
||||
Pout<< "Reading:" << fileHandler().filePath(io.objectPath()) << endl;
|
||||
io.readOpt() = IOobject::READ_IF_PRESENT;
|
||||
io.readOpt(IOobject::READ_IF_PRESENT);
|
||||
doRead<Type>(io, sz);
|
||||
}
|
||||
|
||||
@ -178,6 +177,7 @@ void doTests(IOobject& io, const label sz)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noBanner();
|
||||
argList::addBoolOption("bool", "Use bool for tests");
|
||||
argList::addBoolOption("scalar", "Use scalar for tests");
|
||||
argList::addBoolOption("label", "Use label for tests (default)");
|
||||
@ -209,6 +209,11 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
{
|
||||
dictionary headerDict;
|
||||
io.writeHeader(headerDict, "anything", IOstreamOption());
|
||||
Info<< "IOobjectHeader" << headerDict << nl;
|
||||
}
|
||||
|
||||
label tested = 0;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -78,7 +78,7 @@ void printTokens(Istream& is)
|
||||
if (t.good())
|
||||
{
|
||||
++count;
|
||||
Info<<"token: " << t << endl;
|
||||
Info<< "token: " << t << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,14 +86,28 @@ void printTokens(Istream& is)
|
||||
}
|
||||
|
||||
|
||||
template<class BUF>
|
||||
void doTest(const string& name, const BUF& input, bool verbose=false)
|
||||
Ostream& reportPeek(const ITstream& is)
|
||||
{
|
||||
Info<<"test " << name.c_str() << ":" << nl
|
||||
<<"====" << nl;
|
||||
Info<< " index : " << is.tokenIndex() << nl
|
||||
<< " peek : " << is.peek().info() << nl;
|
||||
return Info;
|
||||
}
|
||||
|
||||
|
||||
template<class BUF>
|
||||
void doTest
|
||||
(
|
||||
const string& name,
|
||||
const BUF& input,
|
||||
bool verbose = false,
|
||||
bool testskip = false
|
||||
)
|
||||
{
|
||||
Info<< "test " << name.c_str() << ":" << nl
|
||||
<< "====" << nl;
|
||||
toString(Info, input)
|
||||
<< nl
|
||||
<<"====" << nl << endl;
|
||||
<< "====" << nl << endl;
|
||||
|
||||
ITstream its(name, input);
|
||||
Info<< "got " << its.size() << " tokens - index at "
|
||||
@ -107,6 +121,35 @@ void doTest(const string& name, const BUF& input, bool verbose=false)
|
||||
}
|
||||
Info<< nl;
|
||||
}
|
||||
|
||||
if (testskip)
|
||||
{
|
||||
Info<< " first : " << its.peekFirst().info() << nl
|
||||
<< " last : " << its.peekLast().info() << nl;
|
||||
|
||||
Info<< "rewind():" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
its.skip(3);
|
||||
Info<< "skip(3):" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
its.skip(2);
|
||||
Info<< "skip(2):" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
its.skip(-2);
|
||||
Info<< "skip(-2):" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
its.skip(100);
|
||||
Info<< "skip(100):" << nl;
|
||||
reportPeek(its);
|
||||
|
||||
its.skip(-1000);
|
||||
Info<< "skip(-1000):" << nl;
|
||||
reportPeek(its);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -116,14 +159,16 @@ void doTest(const string& name, const BUF& input, bool verbose=false)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char* charInput =
|
||||
"( const char input \"string\" to tokenize )"
|
||||
"( const char input \"string\" to tokenize )\n"
|
||||
"List<label> 5(0 1 2 3 4);";
|
||||
|
||||
string stringInput("( string ; input \"string\" to tokenize )");
|
||||
|
||||
List<char> listInput(stringInput.cbegin(), stringInput.cend());
|
||||
|
||||
doTest("char*", charInput, true);
|
||||
doTest("empty", "", true, true);
|
||||
|
||||
doTest("char*", charInput, true, true);
|
||||
doTest("string", stringInput, true);
|
||||
doTest("List<char>", listInput, true);
|
||||
|
||||
|
||||
3
applications/test/LabelledItem/Make/files
Normal file
3
applications/test/LabelledItem/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-LabelledItem.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-LabelledItem
|
||||
74
applications/test/LabelledItem/Test-LabelledItem.C
Normal file
74
applications/test/LabelledItem/Test-LabelledItem.C
Normal file
@ -0,0 +1,74 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Test LabelledItem (formerly 'Keyed', but that was never used)
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "IOobject.H"
|
||||
#include "IFstream.H"
|
||||
#include "edge.H"
|
||||
#include "LabelledItem.H"
|
||||
#include "List.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
typedef LabelledItem<edge> labelledEdge;
|
||||
|
||||
List<labelledEdge> edges(10);
|
||||
|
||||
forAll(edges, edgei)
|
||||
{
|
||||
auto& e = edges[edgei];
|
||||
|
||||
e.insert(20-edgei);
|
||||
e.insert(edgei);
|
||||
|
||||
if (!(edgei % 3))
|
||||
{
|
||||
e.setIndex(edgei);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "edges: " << edges << nl;
|
||||
|
||||
Foam::sort(edges);
|
||||
|
||||
Info<< "sorted: " << edges << nl;
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -55,6 +55,9 @@ See also
|
||||
#include <numeric>
|
||||
#include <functional>
|
||||
|
||||
// see issue #2083
|
||||
#undef Foam_constructList_from_iterators
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
@ -254,8 +257,12 @@ int main(int argc, char *argv[])
|
||||
Info<< "list4: " << list4 << nl
|
||||
<< "list5: " << list5 << endl;
|
||||
|
||||
#ifdef Foam_constructList_from_iterators
|
||||
List<vector> list6(list4.begin(), list4.end());
|
||||
Info<< "list6: " << list6 << endl;
|
||||
#else
|
||||
Info<< "NOTE: no construction from two iterators" << endl;
|
||||
#endif
|
||||
|
||||
// Subset
|
||||
const labelList map{0, 2};
|
||||
@ -273,9 +280,13 @@ int main(int argc, char *argv[])
|
||||
// scalarList slist = identity(15);
|
||||
//
|
||||
// More writing, but does work:
|
||||
#ifdef Foam_constructList_from_iterators
|
||||
scalarList slist(labelRange().begin(), labelRange(15).end());
|
||||
|
||||
Info<<"scalar identity:" << flatOutput(slist) << endl;
|
||||
#else
|
||||
Info<<"No iterator means of creating a scalar identity list" << endl;
|
||||
#endif
|
||||
|
||||
printListOutputType<label>("labels") << nl;
|
||||
|
||||
@ -384,6 +395,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
Info<< "sub-sorted: " << flatOutput(longLabelList) << nl;
|
||||
|
||||
#ifdef Foam_constructList_from_iterators
|
||||
// Construct from a label-range
|
||||
labelRange range(25,15);
|
||||
|
||||
@ -406,6 +418,10 @@ int main(int argc, char *argv[])
|
||||
// Even weird things like this
|
||||
List<scalar> sident4(labelRange().begin(), labelRange(8).end());
|
||||
Info<<"range-list (scalar)=" << sident4 << nl;
|
||||
#else
|
||||
Info<< "NOTE: no construction of labelList from range pair" << nl
|
||||
<< "use identity(...) instead" << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
wordReList reLst;
|
||||
@ -658,11 +674,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<<"hash of " << flatOutput(list1)
|
||||
<< " = " << Hash<labelList>()(list1) << " or "
|
||||
<< labelList::Hash<>()(list1) << nl;
|
||||
<< labelList::hasher()(list1) << nl;
|
||||
|
||||
Info<<"hash of " << flatOutput(list2) << " = "
|
||||
<< Hash<labelList>()(list2) << " or "
|
||||
<< labelList::Hash<>()(list2) << nl;
|
||||
<< labelList::hasher()(list2) << nl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
IFstream is(args[argi]);
|
||||
IFstream is(args.get<fileName>(argi));
|
||||
|
||||
Info<< nl << nl
|
||||
<< "read from " << is.name() << nl << endl;
|
||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (true)
|
||||
{
|
||||
IFstream is(args[argi]);
|
||||
IFstream is(args.get<fileName>(argi));
|
||||
|
||||
Info<< nl << nl
|
||||
<< "read from " << is.name() << nl << endl;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
std::for_each(test6.begin(), test6.end(), [](label& x){ x *= 3; });
|
||||
|
||||
// Randomize the list
|
||||
std::random_shuffle(test6.begin(), test6.end());
|
||||
Foam::shuffle(test6);
|
||||
|
||||
Info<< "randomized input list: " << flatOutput(test6) << nl;
|
||||
|
||||
@ -160,7 +160,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// List reorder
|
||||
labelList oldToNew(identity(40));
|
||||
std::random_shuffle(oldToNew.begin(), oldToNew.end());
|
||||
Foam::shuffle(oldToNew);
|
||||
|
||||
// Force a few -1:
|
||||
oldToNew[4] = oldToNew[8] = -1;
|
||||
@ -192,9 +192,9 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
|
||||
Info<<"packed input: " << flatOutput(packed) << nl;
|
||||
Info<< "packed input: " << packed << nl;
|
||||
inplaceReorder(oldToNew, packed);
|
||||
Info<<" reorder: " << flatOutput(packed) << nl << nl;
|
||||
Info<<" reorder: " << packed << nl << nl;
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -57,7 +57,7 @@ Ostream& operator<<
|
||||
);
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
template<class T, class Key, class Hash=Foam::Hash<Key>>
|
||||
class HashSorter
|
||||
{
|
||||
const HashTable<T, Key, Hash>& table;
|
||||
@ -219,8 +219,8 @@ int main(int argc, char *argv[])
|
||||
Info<< nl << "Test inplaceMapValue" << nl << nl;
|
||||
|
||||
HashTable<label> input;
|
||||
typedef HashSorter<label, label, Hash<label>> Mapper;
|
||||
typedef HashSorter<label, word, string::hash> Sorter;
|
||||
typedef HashSorter<label, label> Mapper;
|
||||
typedef HashSorter<label, word> Sorter;
|
||||
|
||||
for (label i=0; i < 10; ++i)
|
||||
{
|
||||
|
||||
3
applications/test/MathFunctions/Make/files
Normal file
3
applications/test/MathFunctions/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-MathFunctions.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-MathFunctions
|
||||
1
applications/test/MathFunctions/Make/options
Normal file
1
applications/test/MathFunctions/Make/options
Normal file
@ -0,0 +1 @@
|
||||
EXE_INC = -I../TestTools
|
||||
179
applications/test/MathFunctions/Test-MathFunctions.C
Normal file
179
applications/test/MathFunctions/Test-MathFunctions.C
Normal file
@ -0,0 +1,179 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-MathFunctions
|
||||
|
||||
Description
|
||||
Tests for \c Math namespace member functions
|
||||
using \c doubleScalar base type.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "MathFunctions.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "IOmanip.H"
|
||||
#include "TestTools.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Execute each member functions of Foam::Math::, and print output
|
||||
template<class Type>
|
||||
void test_member_funcs(Type)
|
||||
{
|
||||
Random rndGen(1234);
|
||||
const label numberOfTests = 10000;
|
||||
const scalar tolerance = 1e-3;
|
||||
|
||||
for (label i = 0; i < numberOfTests; ++i)
|
||||
{
|
||||
Info<< "# Inverse error functions:" << endl;
|
||||
const Type x1 = rndGen.sample01<Type>();
|
||||
const Type x2 = rndGen.sample01<Type>();
|
||||
Info<< " # Operands:" << nl
|
||||
<< " x1 = " << x1 << nl
|
||||
<< " x2 = " << x2 << endl;
|
||||
|
||||
cmp
|
||||
(
|
||||
" # erf(erfinv(x1)) = x1 = ",
|
||||
x1,
|
||||
Foam::erf(Foam::Math::erfInv(x1)),
|
||||
tolerance
|
||||
);
|
||||
|
||||
cmp
|
||||
(
|
||||
" # erf(erfinv(-x2)) = -x2 = ",
|
||||
x2,
|
||||
Foam::erf(Foam::Math::erfInv(x2)),
|
||||
tolerance
|
||||
);
|
||||
|
||||
Info<< "# Incomplete gamma functions:" << endl;
|
||||
const Type a = rndGen.position(SMALL, Type(100));
|
||||
const Type x = rndGen.position(Type(0), Type(100));
|
||||
Info<< " # Operands:" << nl
|
||||
<< " a = " << a << nl
|
||||
<< " x = " << x << endl;
|
||||
|
||||
cmp
|
||||
(
|
||||
" # incGammaRatio_Q(a,x) + incGammaRatio_P(a,x) = 1 = ",
|
||||
Foam::Math::incGammaRatio_Q(a,x) + Foam::Math::incGammaRatio_P(a,x),
|
||||
scalar(1),
|
||||
tolerance
|
||||
);
|
||||
|
||||
cmp
|
||||
(
|
||||
" # incGamma_Q(1, x) = exp(-x) = ",
|
||||
Foam::Math::incGamma_Q(1, x),
|
||||
Foam::exp(-x),
|
||||
tolerance
|
||||
);
|
||||
|
||||
cmp
|
||||
(
|
||||
" # incGamma_Q(0.5, x) = sqrt(pi)*erfc(sqrt(x)) = ",
|
||||
Foam::Math::incGamma_Q(0.5, x),
|
||||
Foam::sqrt(Foam::constant::mathematical::pi)
|
||||
*Foam::erfc(Foam::sqrt(x)),
|
||||
tolerance
|
||||
);
|
||||
|
||||
cmp
|
||||
(
|
||||
" # incGamma_P(1,x) = 1 - exp(x) = ",
|
||||
Foam::Math::incGamma_P(1, x),
|
||||
1 - Foam::exp(-x),
|
||||
tolerance
|
||||
);
|
||||
|
||||
cmp
|
||||
(
|
||||
" # incGamma_P(0.5, x) = sqrt(pi)*erf(sqrt(x)) = ",
|
||||
Foam::Math::incGamma_P(0.5, x),
|
||||
Foam::sqrt(Foam::constant::mathematical::pi)
|
||||
*Foam::erf(Foam::sqrt(x)),
|
||||
tolerance
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Do compile-time recursion over the given types
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I == sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID){}
|
||||
|
||||
|
||||
template<std::size_t I = 0, typename... Tp>
|
||||
inline typename std::enable_if<I < sizeof...(Tp), void>::type
|
||||
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID)
|
||||
{
|
||||
Info<< nl << " ## Test member functions: "<< typeID[I] <<" ##" << nl;
|
||||
test_member_funcs(std::get<I>(types));
|
||||
|
||||
run_tests<I + 1, Tp...>(types, typeID);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Main Program * * * * * * * * * * * * * * * //
|
||||
|
||||
int main()
|
||||
{
|
||||
Info<< setprecision(15);
|
||||
|
||||
const std::tuple<doubleScalar> types
|
||||
(
|
||||
std::make_tuple(Zero)
|
||||
);
|
||||
|
||||
const List<word> typeID
|
||||
({
|
||||
"doubleScalar"
|
||||
});
|
||||
|
||||
run_tests(types, typeID);
|
||||
|
||||
|
||||
if (nFail_)
|
||||
{
|
||||
Info<< nl << " #### "
|
||||
<< "Failed in " << nFail_ << " tests "
|
||||
<< "out of total " << nTest_ << " tests "
|
||||
<< "####\n" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Info<< nl << " #### Passed all " << nTest_ <<" tests ####\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -105,6 +105,18 @@ int main(int argc, char *argv[])
|
||||
printInfo(os1);
|
||||
printInfo(os2);
|
||||
printInfo(os3);
|
||||
|
||||
// Rewind and test single output
|
||||
os1.rewind(); generateOutput(os1);
|
||||
os2.rewind(); generateOutput(os2);
|
||||
os3.rewind(); generateOutput(os3);
|
||||
|
||||
Info<< nl
|
||||
<< "single output" << nl;
|
||||
|
||||
printInfo(os1);
|
||||
printInfo(os2);
|
||||
printInfo(os3);
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
OListStream os2;
|
||||
os2.indentSize() = 0;
|
||||
os2.indentSize(0);
|
||||
|
||||
outputDict(os2);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -125,9 +126,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
for (label argi=1; argi < args.size(); ++argi)
|
||||
{
|
||||
const string& srcFile = args[argI];
|
||||
const auto srcFile = args.get<fileName>(argi);
|
||||
Info<< nl << "reading " << srcFile << nl;
|
||||
|
||||
IFstream ifs(srcFile);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,11 +50,13 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createPolyMesh.H"
|
||||
|
||||
const wordRes patchSelection(args.getList<wordRe>(1));
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
labelList patchIDs
|
||||
(
|
||||
pbm.patchSet(args.getList<wordRe>(1)).sortedToc()
|
||||
pbm.patchSet(patchSelection).sortedToc()
|
||||
);
|
||||
|
||||
Info<< "Starting walk from patches "
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,6 +30,10 @@ Description
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
#include "floatScalar.H"
|
||||
#include "doubleScalar.H"
|
||||
#include "complex.H"
|
||||
#include "Matrix.H"
|
||||
#include "Random.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -62,7 +62,9 @@ void testFind(const T& val, const ListType& lst)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
List<label> completeList(20);
|
||||
labelList completeList(20);
|
||||
labelList scratch(20);
|
||||
scratch = -1;
|
||||
|
||||
forAll(completeList, i)
|
||||
{
|
||||
@ -71,12 +73,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "raw : " << flatOutput(completeList) << nl << endl;
|
||||
|
||||
List<label> addresses{1, 0, 3, 7, 4, 8, 5, 1, 0, 3, 7, 4, 8, 5, };
|
||||
List<label> addresses({ 1, 0, 3, 7, 4, 8, 5, 1, 0, 3, 7, 4, 8, 5 });
|
||||
|
||||
labelUIndList idl1(completeList, addresses);
|
||||
|
||||
printInfo(idl1);
|
||||
|
||||
labelList::subList slice(scratch, idl1.size());
|
||||
slice = idl1;
|
||||
|
||||
Info<< "sliced: " << flatOutput(slice) << nl;
|
||||
Info<< "scratch: " << flatOutput(scratch) << nl;
|
||||
|
||||
// Again, but offset and using intermediate only
|
||||
scratch = -1;
|
||||
labelList::subList(scratch, idl1.size(), 5) = idl1;
|
||||
Info<< "offset: " << flatOutput(scratch) << nl;
|
||||
|
||||
|
||||
for (const label val : { 10, 30, 40, 50, 90, 80, 120 } )
|
||||
{
|
||||
testFind(val, idl1);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,6 +37,8 @@ Description
|
||||
#include "HashSet.H"
|
||||
#include "ListOps.H"
|
||||
#include "cpuTime.H"
|
||||
#include "StringStream.H"
|
||||
#include "FlatOutput.H"
|
||||
#include <vector>
|
||||
#include <unordered_set>
|
||||
|
||||
@ -65,6 +67,28 @@ inline Ostream& report
|
||||
}
|
||||
|
||||
|
||||
// Create equivalent to flat output
|
||||
inline void undecorated
|
||||
(
|
||||
Ostream& os,
|
||||
const bitSet& list
|
||||
)
|
||||
{
|
||||
const label len = list.size();
|
||||
|
||||
os << token::BEGIN_LIST;
|
||||
|
||||
// Contents
|
||||
for (label i=0; i < len; ++i)
|
||||
{
|
||||
if (i) os << token::SPACE;
|
||||
os << label(list.get(i));
|
||||
}
|
||||
|
||||
os << token::END_LIST;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -97,6 +121,28 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<<"bits used: " << flatOutput(set3b.toc()) << nl;
|
||||
Info<<"inverted: " << flatOutput(invert(set3b)) << nl;
|
||||
|
||||
Info<< "Test read/write (ASCII)" << nl;
|
||||
|
||||
OStringStream ostr;
|
||||
|
||||
undecorated(ostr, set3a); // like flatOutput
|
||||
ostr << bitSet();
|
||||
set3a.flip();
|
||||
undecorated(ostr, set3a); // like flatOutput
|
||||
|
||||
{
|
||||
IStringStream istr(ostr.str());
|
||||
Info<< "parse: " << istr.str() << nl;
|
||||
|
||||
bitSet bset1(istr);
|
||||
bitSet bset2(istr);
|
||||
bitSet bset3(istr);
|
||||
|
||||
Info<< "got: " << bset1 << nl
|
||||
<< "and: " << bset2 << nl
|
||||
<< "and: " << bset3 << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -370,7 +370,6 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
"input",
|
||||
"(1 n 1 n 1 n 1 1 off 0 0 f f 0 y yes y true y false on t)"
|
||||
)()
|
||||
);
|
||||
|
||||
3
applications/test/charList/Make/files
Normal file
3
applications/test/charList/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-charList.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-charList
|
||||
2
applications/test/charList/Make/options
Normal file
2
applications/test/charList/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
87
applications/test/charList/Test-charList.C
Normal file
87
applications/test/charList/Test-charList.C
Normal file
@ -0,0 +1,87 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-charList
|
||||
|
||||
Description
|
||||
Some test of UList, List for characters
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "OSspecific.H"
|
||||
#include "argList.H"
|
||||
#include "IOstreams.H"
|
||||
#include "messageStream.H"
|
||||
|
||||
#include "charList.H"
|
||||
#include "labelList.H"
|
||||
#include "StringStream.H"
|
||||
#include "ListOps.H"
|
||||
#include "SubList.H"
|
||||
#include "FlatOutput.H"
|
||||
|
||||
#include <numeric>
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noBanner();
|
||||
argList::noParallel();
|
||||
argList::noFunctionObjects();
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
Info<< "Known compound tokens: "
|
||||
<< token::compound::IstreamConstructorTablePtr_->sortedToc() << nl;
|
||||
|
||||
OStringStream ostr;
|
||||
|
||||
{
|
||||
List<char> alphabet(64);
|
||||
std::iota(alphabet.begin(), alphabet.end(), '@');
|
||||
|
||||
alphabet.writeEntry("alphabet", Info);
|
||||
|
||||
ostr << alphabet;
|
||||
|
||||
Info<< "wrote: " << ostr.str() << nl;
|
||||
}
|
||||
|
||||
{
|
||||
IStringStream istr(ostr.str());
|
||||
List<char> alphabet(istr);
|
||||
|
||||
Info<< "re-read: " << alphabet << nl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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.
|
||||
@ -55,12 +55,8 @@ int main(int argc, char *argv[])
|
||||
argList::noParallel();
|
||||
argList::noBanner();
|
||||
|
||||
#include "addRegionOption.H"
|
||||
argList::addBoolOption
|
||||
(
|
||||
"allRegions",
|
||||
"operate on all regions in regionProperties"
|
||||
);
|
||||
#include "addAllRegionOptions.H"
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"verbose",
|
||||
@ -74,14 +70,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
const fileName decompFile = args[1];
|
||||
|
||||
const bool region = args.found("region");
|
||||
const bool allRegions = args.found("allRegions");
|
||||
const auto decompFile = args.get<fileName>(1);
|
||||
const bool verbose = args.found("verbose");
|
||||
|
||||
// Set time from database
|
||||
#include "createTime.H"
|
||||
|
||||
// Allow override of time
|
||||
instantList times = timeSelector::selectIfPresent(runTime, args);
|
||||
|
||||
@ -89,42 +83,20 @@ int main(int argc, char *argv[])
|
||||
const fileName decompDictFile =
|
||||
args.getOrDefault<fileName>("decomposeParDict", "");
|
||||
|
||||
wordList regionNames;
|
||||
wordList regionDirs;
|
||||
if (allRegions)
|
||||
{
|
||||
Info<< "Decomposing all regions in regionProperties" << nl << endl;
|
||||
regionProperties rp(runTime);
|
||||
forAllConstIters(rp, iter)
|
||||
{
|
||||
const wordList& regions = iter();
|
||||
forAll(regions, i)
|
||||
{
|
||||
if (!regionNames.found(regions[i]))
|
||||
{
|
||||
regionNames.append(regions[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
regionDirs = regionNames;
|
||||
}
|
||||
else
|
||||
{
|
||||
regionNames.resize(1, fvMesh::defaultRegion);
|
||||
regionDirs.resize(1, word::null);
|
||||
|
||||
if (args.readIfPresent("region", regionNames.first()))
|
||||
{
|
||||
regionDirs.first() = regionNames.first();
|
||||
}
|
||||
}
|
||||
// Get region names
|
||||
#include "getAllRegionOptions.H"
|
||||
|
||||
labelList cellToProc;
|
||||
|
||||
forAll(regionNames, regioni)
|
||||
{
|
||||
const word& regionName = regionNames[regioni];
|
||||
const word& regionDir = regionDirs[regioni];
|
||||
// const word& regionDir =
|
||||
// (
|
||||
// regionName != polyMesh::defaultRegion
|
||||
// ? regionName
|
||||
// : word::null
|
||||
// );
|
||||
|
||||
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;
|
||||
Info<< "Create mesh..." << flush;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -59,9 +60,9 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
for (label argi=1; argi < args.size(); ++argi)
|
||||
{
|
||||
const string& dictFile = args[argI];
|
||||
const auto dictFile = args.get<fileName>(argi);
|
||||
IFstream is(dictFile);
|
||||
|
||||
dictionary dict(is);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -179,7 +179,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (label argi=1; argi < args.size(); ++argi)
|
||||
{
|
||||
const string& dictFile = args[argi];
|
||||
const auto dictFile = args.get<fileName>(argi);
|
||||
IFstream is(dictFile);
|
||||
|
||||
dictionary inputDict(is);
|
||||
@ -201,7 +201,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
for (label argi=1; argi < args.size(); ++argi)
|
||||
{
|
||||
const string& dictFile = args[argi];
|
||||
const auto dictFile = args.get<fileName>(argi);
|
||||
IFstream is(dictFile);
|
||||
|
||||
dictionary inputDict(is);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user