Compare commits
617 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16a415a152 | |||
| 84842df79f | |||
| bc1dd9f5e8 | |||
| 6cd16223d1 | |||
| c378a73650 | |||
| 62b22d191f | |||
| 3c3f1d9651 | |||
| 6147878a1b | |||
| 6995a3d7dc | |||
| e010b9f966 | |||
| 3667af9f56 | |||
| 7213a1d850 | |||
| 9750720a5e | |||
| 5b3a148fcf | |||
| ae21c7e19a | |||
| 85e2964d0d | |||
| 3a12684d3b | |||
| e16e405828 | |||
| 54db2db656 | |||
| 4bdb5f06d4 | |||
| b8ccfb9986 | |||
| a271fd0aa0 | |||
| 30662789fa | |||
| 2fb7ca52a3 | |||
| 5ec9393aba | |||
| f72fcf68ba | |||
| ab3f69db66 | |||
| b5ab312744 | |||
| a305383123 | |||
| 640731e07d | |||
| ac1e4c5396 | |||
| 2b5fba4ece | |||
| 497ddb3120 | |||
| b23b1aa0d2 | |||
| 4897e9b759 | |||
| dec6d77baa | |||
| fdc183abb4 | |||
| 1576391e51 | |||
| 5214948671 | |||
| 981ff462c9 | |||
| c39c0da9f4 | |||
| 6222d3b6bb | |||
| c626fa5c53 | |||
| a2f9772ce3 | |||
| 32283e8ac3 | |||
| 60df64826a | |||
| 3ea46f470e | |||
| d9ba7d1a7a | |||
| ad5a39ceac | |||
| b3fd82e81b | |||
| ea5e113d0f | |||
| 1900a7cd28 | |||
| 64aaa5825b | |||
| b03c91bfc3 | |||
| f2bd0ad0aa | |||
| 2f81209804 | |||
| 28aaa258f0 | |||
| 1a28aaf6b4 | |||
| bb0ab31d26 | |||
| ae49113dbb | |||
| 5a5b743057 | |||
| 02d1fbadc0 | |||
| 36f739d32f | |||
| cbd0d9c3cb | |||
| ca1b581ee5 | |||
| 9df98073b7 | |||
| 2e0ff86b01 | |||
| f12fef0f85 | |||
| f8c410a3d4 | |||
| 3338d1ea32 | |||
| c53dd25f20 | |||
| 1e7e6a3b7a | |||
| dea1d2e922 | |||
| 39519983ee | |||
| 249cbc8e3a | |||
| 0beb4b5329 | |||
| 0791554caf | |||
| 981b1a5957 | |||
| 24a684dc52 | |||
| 6bc7371b76 | |||
| caa98441f9 | |||
| 2f9d410800 | |||
| 8330e3a8ff | |||
| b41b2f8d8d | |||
| 524d5a30e0 | |||
| 73e21bec5d | |||
| 4dda7cbea2 | |||
| 278706f4c9 | |||
| c5716b5a04 | |||
| be9b19ff76 | |||
| 598bd93085 | |||
| 6a175f3450 | |||
| e871612ac7 | |||
| f8a5b9c9df | |||
| 1fdf400149 | |||
| 9dc995cd38 | |||
| 121ef06f19 | |||
| 71c9e1f795 | |||
| d9dad12922 | |||
| 6deb665164 | |||
| db14b2c7c2 | |||
| 7b4032cbe3 | |||
| ee75ce8e67 | |||
| 7f696cb3f1 | |||
| ae2eba53dd | |||
| 1def0b8516 | |||
| b27d0fc39b | |||
| f6cf8daa95 | |||
| 67a2a7e90f | |||
| f1b4baa410 | |||
| 215125fb2b | |||
| 2a83785bcb | |||
| 56e8a6257c | |||
| e06069d49b | |||
| f8a6c9522a | |||
| bc1ded2ade | |||
| 571e2ce3c8 | |||
| 2d0fc46086 | |||
| a5a811e436 | |||
| f847ceeefe | |||
| 8d99122d64 | |||
| 191881ac05 | |||
| 2130d8b698 | |||
| ffb6444fe1 | |||
| 377d5dc665 | |||
| 04ff11b51c | |||
| f00e8e8442 | |||
| 6dedb8112e | |||
| fc9b7e726b | |||
| 325f9c2163 | |||
| 0fb9ce5478 | |||
| 26732f29ca | |||
| 977c7b064a | |||
| c50bf18767 | |||
| 19305850c7 | |||
| 5724a6c7da | |||
| de33220bc1 | |||
| 9fca80b6bb | |||
| 430bc1c51f | |||
| 6cc9bfcdbb | |||
| ef294070cd | |||
| d75befae08 | |||
| e7851bb005 | |||
| 6d5005bf10 | |||
| 55de145ab9 | |||
| d583e5c4df | |||
| 0fc15d8912 | |||
| dc36ae2e66 | |||
| 3e5be0f42e | |||
| 1a8a299470 | |||
| f6b1cde010 | |||
| acd38183fc | |||
| 30927db30c | |||
| 6fe6137921 | |||
| 4ebd073845 | |||
| affa8b1aa8 | |||
| 8c70e97db6 | |||
| 4bb49fdd1f | |||
| 4bae8b0bf8 | |||
| fbe65effd0 | |||
| a7ad60eba1 | |||
| 440232b0fe | |||
| 8c90cbbdd3 | |||
| 953cf4d4ff | |||
| f58fba97be | |||
| 61817b3f51 | |||
| 587e2361d3 | |||
| ae3da6f6b4 | |||
| cd4e6c08bc | |||
| 5994792de2 | |||
| 0fd56c9333 | |||
| 1a37e99dfd | |||
| 3d971884c1 | |||
| 6e9ead9fb6 | |||
| d58ff86621 | |||
| d3c10ba24d | |||
| 9aa0c94bf9 | |||
| 57e98b2f0e | |||
| 25efaffdd2 | |||
| 7eacdef7eb | |||
| b1798863cc | |||
| bc492823fc | |||
| 7a6c024af2 | |||
| 0fa1f023d6 | |||
| e02edc3569 | |||
| fde7fb86a7 | |||
| c86c3e6de0 | |||
| 5b07b7d03c | |||
| 80c8d29114 | |||
| 71a78be4c9 | |||
| e2b454b036 | |||
| a0ae8b90f7 | |||
| 78620f134f | |||
| b8c987ae94 | |||
| 139506a28c | |||
| d605ea1701 | |||
| c13aece161 | |||
| d1ce573cc9 | |||
| 59d5a1f1fd | |||
| aa82dad8be | |||
| 2f5f10c6a5 | |||
| 40e464ab5e | |||
| 75ffbe02ae | |||
| b6f44b3338 | |||
| b06bb1f98a | |||
| bb4083f570 | |||
| 7dcb63f790 | |||
| 647c84d323 | |||
| 214e10e5a3 | |||
| b0533b79ab | |||
| a83d0290c9 | |||
| 3ea5bf774a | |||
| 3b29d96c05 | |||
| 71586e1192 | |||
| 39d66506a1 | |||
| 50bd4a6de3 | |||
| 4a11ade3b1 | |||
| 3ffc8eef65 | |||
| d4e6ec2e39 | |||
| e8766829cd | |||
| 928aca81d9 | |||
| 5fa429bfdb | |||
| 6162f4e60d | |||
| d67ee0d63e | |||
| 893a8ddf31 | |||
| f07b8f370f | |||
| ad1317b9b1 | |||
| 16560cfe4f | |||
| e06d524f62 | |||
| 0b820906ae | |||
| a5db37a222 | |||
| dd5dfb6662 | |||
| f3c46fd09f | |||
| fa584672ab | |||
| aab29ab9bf | |||
| bba5d13264 | |||
| 9e38718f7f | |||
| 424c680359 | |||
| 3b7ba89f7a | |||
| 68e625defe | |||
| ade406ac92 | |||
| d30f81f3d3 | |||
| 408c8a36dc | |||
| 671225e0f5 | |||
| 14d5c30dac | |||
| 8489811677 | |||
| bdb68cc617 | |||
| 37bbb436c2 | |||
| 58c9d62f0f | |||
| e2a5ffbd8f | |||
| e417d0dc40 | |||
| 116fd3b810 | |||
| 52bcfc5dd3 | |||
| 63f1f8fb68 | |||
| 0102b245aa | |||
| 5f16dce15b | |||
| 915ec1da4f | |||
| 8bae912ad4 | |||
| 93a426fe2c | |||
| af5675606f | |||
| 961b04760a | |||
| e71ff6792c | |||
| 66efa60bd4 | |||
| ec1c1690ef | |||
| c2c38223f7 | |||
| 27abff8eb8 | |||
| 225c3500c1 | |||
| 2a52f8bd89 | |||
| dd5407db99 | |||
| 9e8a418576 | |||
| 07828a01f8 | |||
| 5710166ccd | |||
| ea7f37b3e1 | |||
| 1f5dcc5f33 | |||
| 6d8e8bb705 | |||
| 5b6385216a | |||
| 7175b0e178 | |||
| b93cbd6044 | |||
| 9af2cd76a2 | |||
| 8764f151fd | |||
| e0925ed36e | |||
| eb2e9286b4 | |||
| dbcdbb1017 | |||
| c35ac408cc | |||
| 59afe3dc3d | |||
| fe3fbe58d9 | |||
| 6075578f1b | |||
| 73e6b03778 | |||
| bedf3e37c9 | |||
| a886e439ec | |||
| ab250deb8d | |||
| 4996b8b5ef | |||
| f056bc66ad | |||
| 82fbc0dbe2 | |||
| 25eef6b5e7 | |||
| 7711ea5974 | |||
| 548df2cd3c | |||
| a3166f2aca | |||
| 1a85c87851 | |||
| 332dc5e057 | |||
| 26b740e296 | |||
| 898f4cb1f0 | |||
| 84c4b34c9c | |||
| 63b2aa37ea | |||
| 861ca8698c | |||
| f4c0a25431 | |||
| dbdf80ef92 | |||
| 9a81b875f1 | |||
| bb47fc3583 | |||
| 9e64ecc86c | |||
| a42e6577b5 | |||
| 44eabca09b | |||
| 86697d0993 | |||
| b089229109 | |||
| 9700a366fe | |||
| 6c25adaa31 | |||
| 91a4f03dcc | |||
| 7a02baff6d | |||
| 3351b85908 | |||
| d7375f198e | |||
| 34d5e1dc59 | |||
| fe4016eb52 | |||
| 8f94dba403 | |||
| 1643f8d908 | |||
| dc3194c857 | |||
| fe81287d8d | |||
| f2f6c4bf8c | |||
| a31d9f129e | |||
| ef43147dc8 | |||
| f8949cf4fe | |||
| 314bfdc0ac | |||
| 73b4879b06 | |||
| db693ef7b8 | |||
| 6a96ec4f3d | |||
| 1fb208082b | |||
| 29cc09a876 | |||
| db465c334a | |||
| 7f0c4f8efe | |||
| 33895f0cbd | |||
| 70a6c634d6 | |||
| 7399f4b929 | |||
| 993593aa83 | |||
| 9063c7b7d1 | |||
| 31ba2f01fd | |||
| 896f497323 | |||
| 4cfce8bc6c | |||
| 7854673f21 | |||
| cab6b7e88f | |||
| 7de941746f | |||
| fdb2748fbb | |||
| 4a328144ea | |||
| 96c621416d | |||
| 88bc5cbee9 | |||
| 439f3c602b | |||
| 713677cd3c | |||
| 69ec630051 | |||
| cef2d3afb1 | |||
| 4b86d32807 | |||
| 211a29bb0e | |||
| ae113af709 | |||
| 4b68e36602 | |||
| a7f747a4ab | |||
| 9fb9e667db | |||
| e94964e9bf | |||
| db0a544f28 | |||
| 39f6e7d056 | |||
| c28480a802 | |||
| e4a33e4c1d | |||
| a6be6be3cc | |||
| cab4fdcb2f | |||
| d0400cdc74 | |||
| 302e8df86b | |||
| 224b7fc00c | |||
| ce2646c400 | |||
| c878281031 | |||
| 2d4fc39eef | |||
| f87ad1d116 | |||
| a9b8718c3f | |||
| 2fa735a2d4 | |||
| c40d8e8907 | |||
| 69b3c903b3 | |||
| a4ba6750b0 | |||
| 96508745fb | |||
| 671d59d634 | |||
| 0dd61addde | |||
| 71b3ad58d4 | |||
| 60eb20fc3c | |||
| 25a619514f | |||
| 5ec6492a11 | |||
| 7b91c8f014 | |||
| 471cb3baae | |||
| 68ab82ce69 | |||
| c7e58306bb | |||
| 11e53185e7 | |||
| 1cf1babc8c | |||
| cc4afe5e17 | |||
| 74ef6b9207 | |||
| 03f715cee4 | |||
| 37a7104849 | |||
| 1b4df09159 | |||
| 36d253303d | |||
| 8256dd861b | |||
| 0b57c2400c | |||
| 3f2afc838d | |||
| b2aa11ffaf | |||
| 87a730fbe1 | |||
| 2ace3db6d1 | |||
| 570037e8a5 | |||
| 058648ef25 | |||
| 1e5b8c9302 | |||
| 4b8b50b427 | |||
| e8fd37e965 | |||
| 085f288b19 | |||
| 588c4d12c3 | |||
| c37469e415 | |||
| bd03f422dc | |||
| 7f7c17f788 | |||
| 658cebfcf2 | |||
| b60ffb829a | |||
| b56bf6b838 | |||
| 3520f0735e | |||
| 7648045bc2 | |||
| fbd2bde594 | |||
| 0c7396e565 | |||
| ed242483fc | |||
| 5579b80401 | |||
| 9a3cf6a4c2 | |||
| 346334d639 | |||
| 7fdc466a76 | |||
| fd71f367d7 | |||
| 67cd1bf561 | |||
| bed9647047 | |||
| 780b99389c | |||
| 0778651870 | |||
| 77511e50b9 | |||
| 65921d48f3 | |||
| 97949216e7 | |||
| ba9f4964c4 | |||
| da25c871c5 | |||
| 7dcb0fee45 | |||
| 2c6312325b | |||
| 44ade76820 | |||
| 693e9fd404 | |||
| 54b88ed873 | |||
| a1e4182f71 | |||
| 2929a1d2a7 | |||
| 32098fb977 | |||
| 9b1fb4474e | |||
| 4ded7ce4ac | |||
| b759fc05e0 | |||
| a15986216a | |||
| 839c66a283 | |||
| f34c00d5dd | |||
| fc93012268 | |||
| 40c23ffb42 | |||
| 9fabb5851e | |||
| 3132d9bf4e | |||
| ca29eaff3a | |||
| c25aa8ed46 | |||
| f79a21bb88 | |||
| 324094bb0b | |||
| 41faf88df7 | |||
| 8b62c22312 | |||
| 137a4e8670 | |||
| 82a80e1215 | |||
| 5615b27130 | |||
| 5feb16c659 | |||
| 5ad063f848 | |||
| 917cd345cb | |||
| 9051bb7a70 | |||
| dd611fc7a0 | |||
| 0e17be2620 | |||
| beadd7fe18 | |||
| b7bc6cd1b7 | |||
| 06d589a2f0 | |||
| 7a6df294c6 | |||
| e4d3281a27 | |||
| 2b07600de2 | |||
| 9591c2e4e1 | |||
| c764c6c184 | |||
| 2df36bd22a | |||
| 36a1d4a309 | |||
| 8a1a1375d7 | |||
| 401a6b087d | |||
| 1722034452 | |||
| 459d87c47a | |||
| 52aa18997d | |||
| 3b61dcf530 | |||
| d4c393a623 | |||
| b056e89969 | |||
| a9526b7f08 | |||
| 2ac9f5ab14 | |||
| b1a81a5fb9 | |||
| 27bf29ec64 | |||
| 83609e3073 | |||
| 665ff426b5 | |||
| 7fc3caf245 | |||
| b9d843a11f | |||
| 327c64933d | |||
| 77a7d78282 | |||
| 237e85a191 | |||
| e3a521ced4 | |||
| 22fd652019 | |||
| 0211f3cc74 | |||
| 27b67395f9 | |||
| c311c4000c | |||
| 528750b8b5 | |||
| 48c2ac22c0 | |||
| 4403f4e191 | |||
| 35a37d5a7b | |||
| a00c423da2 | |||
| e29e3732bc | |||
| ca81a8f14f | |||
| 9fd4f62f21 | |||
| 708e4c465c | |||
| d2edf97b05 | |||
| 84f54340f6 | |||
| 4a3db017f4 | |||
| 033c30ba27 | |||
| fe68694a26 | |||
| 305b047377 | |||
| 1fea5461c9 | |||
| 334e2f224e | |||
| c8176256cf | |||
| cc4c9a9071 | |||
| 199924cee7 | |||
| d9411b56bb | |||
| 54f04e6604 | |||
| bf2940df57 | |||
| c9a6908aec | |||
| 589f193b11 | |||
| 63fdfd9026 | |||
| 056f7e6b56 | |||
| 6a7acd7d08 | |||
| de33b56c91 | |||
| 9cf0e275b7 | |||
| 5730ea3822 | |||
| b9bb7fd8f8 | |||
| f31cb89065 | |||
| 8c2726bc99 | |||
| 13987f0ba3 | |||
| 41788a1c95 | |||
| a5a76110f7 | |||
| d7343605ce | |||
| 7ac6ee3937 | |||
| 1536a6da54 | |||
| a725249334 | |||
| 9c12f6acb0 | |||
| a83140ee71 | |||
| 9867e0188c | |||
| 56f8aad5a6 | |||
| c44e375473 | |||
| f84180b2c5 | |||
| c18e671956 | |||
| 0d0803e057 | |||
| bfe3836dc4 | |||
| c3388c5238 | |||
| e268853de8 | |||
| a3f903e02f | |||
| 9b28453113 | |||
| fc0a6e64e3 | |||
| fb311ae59b | |||
| 05c1ed01e6 | |||
| b6b2e7d1f4 | |||
| ad3e9641e5 | |||
| dc734e39d0 | |||
| 9ffdc33ce5 | |||
| fb99b20e8b | |||
| 865c52834f | |||
| 3ff2ae9daa | |||
| 561f7fa865 | |||
| 907054872b | |||
| 1fe6ce4788 | |||
| af47724556 | |||
| 3517e71e6d | |||
| 09726b8582 | |||
| 5d31a644c5 | |||
| 1e3062c8b7 | |||
| 06dfa5430a | |||
| d454396dd0 | |||
| e0b1837476 | |||
| 41670f2446 | |||
| 30a216a934 | |||
| 8fc8c1991c | |||
| 6a0928b188 | |||
| 0515ecd2d2 | |||
| 9b134cb9db | |||
| 2abbdf1f51 | |||
| 810217b4ad | |||
| 6124f12d15 | |||
| 061758b1e6 | |||
| 963f00d2c4 | |||
| 87f91613d7 | |||
| 839e00a00e | |||
| 434ffad1e9 | |||
| f058371f65 | |||
| 6d6ebf1629 | |||
| 4e60f9c9a8 | |||
| 8deb1b7b9c | |||
| fed7e6422c | |||
| 09d55794a5 | |||
| c38449cacd | |||
| b55ba48801 | |||
| 4aa3d944d5 | |||
| c07508f147 | |||
| 68f158a3ae | |||
| 859c26f4bb | |||
| 0b5d507281 | |||
| 2e93d70940 | |||
| 433ce8e7fe | |||
| 63f4497727 | |||
| 4282dcf080 | |||
| 6bb64cd937 | |||
| c97f483f64 | |||
| 1307dd7153 | |||
| 1ebaea53a1 | |||
| de96a638a3 |
@ -21,18 +21,18 @@ jobs:
|
||||
|
||||
- run:
|
||||
name: Make project and user dir
|
||||
command: mkdir -p /root/CFDEM/CFDEMcoupling && mkdir -p /root/CFDEM/-4.1
|
||||
command: mkdir -p /root/CFDEM/CFDEMcoupling && mkdir -p /root/CFDEM/-6
|
||||
|
||||
- checkout:
|
||||
path: /root/CFDEM/CFDEMcoupling
|
||||
|
||||
- run:
|
||||
name: Add OpenFOAM package repository
|
||||
command: sudo apt-get install -y software-properties-common wget apt-transport-https && sudo add-apt-repository http://dl.openfoam.org/ubuntu && sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
|
||||
command: sudo apt-get install -y software-properties-common wget apt-transport-https && sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -" && sudo add-apt-repository http://dl.openfoam.org/ubuntu
|
||||
|
||||
- run:
|
||||
name: Install OpenFOAM 4.1
|
||||
command: sudo apt-get update && sudo apt-get -y install openfoam4
|
||||
name: Install OpenFOAM 6
|
||||
command: sudo apt-get update && sudo apt-get -y install openfoam6
|
||||
|
||||
- run:
|
||||
name: Clone LIGGGHTS repository
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
name: Build LIGGGHTS
|
||||
command: >
|
||||
shopt -s expand_aliases &&
|
||||
source /opt/openfoam4/etc/bashrc &&
|
||||
source /opt/openfoam6/etc/bashrc &&
|
||||
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
|
||||
bash /root/CFDEM/CFDEMcoupling/etc/compileLIGGGHTS.sh
|
||||
no_output_timeout: 30m
|
||||
@ -51,7 +51,7 @@ jobs:
|
||||
name: Build CFDEMcoupling library
|
||||
command: >
|
||||
shopt -s expand_aliases &&
|
||||
source /opt/openfoam4/etc/bashrc &&
|
||||
source /opt/openfoam6/etc/bashrc &&
|
||||
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
|
||||
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_src.sh
|
||||
|
||||
@ -59,7 +59,7 @@ jobs:
|
||||
name: Build CFDEMcoupling solvers
|
||||
command: >
|
||||
shopt -s expand_aliases &&
|
||||
source /opt/openfoam4/etc/bashrc &&
|
||||
source /opt/openfoam6/etc/bashrc &&
|
||||
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
|
||||
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_sol.sh
|
||||
|
||||
@ -67,6 +67,6 @@ jobs:
|
||||
name: Build CFDEMcoupling utilities
|
||||
command: >
|
||||
shopt -s expand_aliases &&
|
||||
source /opt/openfoam4/etc/bashrc &&
|
||||
source /opt/openfoam6/etc/bashrc &&
|
||||
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
|
||||
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_uti.sh
|
||||
|
||||
24
.github/pull_request_template.md
vendored
Normal file
24
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<!-- Please provide a general summary of your changes in the title above. -->
|
||||
|
||||
## Description of proposed changes
|
||||
<!-- Describe your changes in detail. -->
|
||||
|
||||
## Types of changes
|
||||
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
|
||||
<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->
|
||||
- [ ] Bugfix
|
||||
- [ ] Feature
|
||||
- [ ] Refactoring (no functional changes, no api changes)
|
||||
- [ ] Build related changes
|
||||
- [ ] Documentation updates
|
||||
- [ ] Other (please describe):
|
||||
|
||||
## Checklist
|
||||
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
- [ ] Code compiles correctly (mandatory for bugfixes / features / refactoring / build process)
|
||||
- [ ] Tests for the changes have been added / updated (mandatory for bugfixes / features)
|
||||
- [ ] Documentation has been added / updated (mandatory for bugfixes / features)
|
||||
|
||||
## Further comments
|
||||
<!-- If this is a relatively large or complex change, kick off the discussion by explaining
|
||||
why you chose the solution you did and what alternatives you considered, etc... -->
|
||||
@ -14,7 +14,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-ImultiphaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
@ -13,6 +17,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -46,6 +46,11 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR >= 6
|
||||
FatalError << "cfdemSolverMultiphase requires OpenFOAM 4.x or 5.x to work properly" << exit(FatalError);
|
||||
#endif
|
||||
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-IalphaContactAngle \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
LIB_LIBS = \
|
||||
-linterfaceProperties \
|
||||
|
||||
@ -55,14 +55,21 @@ Foam::multiphaseMixture::calcNu() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// 1/nu
|
||||
tmp<volScalarField> tnuInv = iter()/iter().nu();
|
||||
volScalarField& nuInv = tnuInv.ref();
|
||||
|
||||
// nu
|
||||
tmp<volScalarField> tnu = iter()*iter().nu();
|
||||
volScalarField& nu = tnu.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
nu += iter()*iter().nu();
|
||||
nuInv += iter()/iter().nu();
|
||||
}
|
||||
|
||||
nu = 1/nuInv;
|
||||
|
||||
return tnu;
|
||||
}
|
||||
|
||||
@ -679,8 +686,13 @@ void Foam::multiphaseMixture::solveAlphas
|
||||
alphaPhiCorr,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
1,
|
||||
0,
|
||||
#else
|
||||
oneField(),
|
||||
zeroField(),
|
||||
#endif
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
8
applications/solvers/cfdemSolverMultiphaseScalar/Allwclean
Executable file
8
applications/solvers/cfdemSolverMultiphaseScalar/Allwclean
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso multiphaseMixture
|
||||
wclean
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
12
applications/solvers/cfdemSolverMultiphaseScalar/Allwmake
Executable file
12
applications/solvers/cfdemSolverMultiphaseScalar/Allwmake
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType multiphaseMixture
|
||||
wmake
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
22
applications/solvers/cfdemSolverMultiphaseScalar/CEqn.H
Normal file
22
applications/solvers/cfdemSolverMultiphaseScalar/CEqn.H
Normal file
@ -0,0 +1,22 @@
|
||||
// get mixture properties
|
||||
Cs = mixture.Cs();
|
||||
diffusionCorrection = mixture.diffusionCorrection();
|
||||
Deff = particleCloud.diffCoeffM().diffCoeff();
|
||||
|
||||
// get scalar source from DEM
|
||||
particleCloud.massContributions(Sm);
|
||||
particleCloud.massCoefficients(Smi);
|
||||
|
||||
fvScalarMatrix CEqn
|
||||
(
|
||||
fvm::ddt(voidfraction,C)
|
||||
+ fvm::div(phi,C)
|
||||
- fvm::laplacian(Deff*voidfraction,C)
|
||||
+ fvm::div(fvc::interpolate(Deff*voidfraction)*diffusionCorrection*mesh.magSf(), C)
|
||||
==
|
||||
Sm + fvm::Sp(Smi,C)
|
||||
);
|
||||
|
||||
CEqn.relax();
|
||||
fvOptions.constrain(CEqn);
|
||||
CEqn.solve();
|
||||
22
applications/solvers/cfdemSolverMultiphaseScalar/EEqn.H
Normal file
22
applications/solvers/cfdemSolverMultiphaseScalar/EEqn.H
Normal file
@ -0,0 +1,22 @@
|
||||
// get mixture properties
|
||||
Cp = mixture.Cp();
|
||||
kf = mixture.kf();
|
||||
|
||||
// get scalar source from DEM
|
||||
particleCloud.energyContributions(Qsource);
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
rho*Cp*(fvm::ddt(voidfraction,T)
|
||||
+ fvm::div(phi,T))
|
||||
- fvm::laplacian(thCond*voidfraction,T)
|
||||
==
|
||||
Qsource + fvm::Sp(QCoeff,T)
|
||||
);
|
||||
|
||||
|
||||
EEqn.relax();
|
||||
fvOptions.constrain(EEqn);
|
||||
EEqn.solve();
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
cfdemSolverMultiphaseScalar.C
|
||||
|
||||
EXE = $(CFDEM_APP_DIR)/cfdemSolverMultiphaseScalar
|
||||
@ -0,0 +1,35 @@
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-ImultiphaseMixture/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$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lcfdemMultiphaseInterFoamScalar \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
61
applications/solvers/cfdemSolverMultiphaseScalar/UEqn.H
Normal file
61
applications/solvers/cfdemSolverMultiphaseScalar/UEqn.H
Normal file
@ -0,0 +1,61 @@
|
||||
const surfaceScalarField& rhoPhi(mixture.rhoPhi());
|
||||
|
||||
volScalarField muEff = rho*(turbulence->nu() + turbulence->nut());
|
||||
|
||||
if (modelType == "A")
|
||||
muEff *= voidfraction;
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rhoEps, U) - fvm::Sp(fvc::ddt(rhoEps),U)
|
||||
+ fvm::div(rhoPhi, U) - fvm::Sp(fvc::div(rhoPhi),U)
|
||||
//+ particleCloud.divVoidfractionTau(U, voidfraction)
|
||||
- fvm::laplacian(muEff, U) - fvc::div(muEff*dev2(fvc::grad(U)().T()))
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
- fvm::Sp(Ksl,U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor() && (modelType=="B" || modelType=="Bfull"))
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(- ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh)) * mesh.magSf()
|
||||
)
|
||||
+
|
||||
fvc::reconstruct
|
||||
(
|
||||
mixture.surfaceTensionForce() * mesh.magSf()
|
||||
) * voidfraction
|
||||
+ Ksl*Us
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
else if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
) * voidfraction
|
||||
+ Ksl*Us
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
// Additional solver-specific checks
|
||||
|
||||
// Useful if one wants to e.g. initialize floating particles using the Archimedes model
|
||||
if (particleCloud.couplingProperties().found("unrestrictedForceModelSelection"))
|
||||
{
|
||||
Warning << "Using unrestrictedForceModelSelection, results may be incorrect!" << endl;
|
||||
} else
|
||||
{
|
||||
#include "checkModelType.H"
|
||||
}
|
||||
|
||||
word modelType = particleCloud.modelType();
|
||||
|
||||
if(!particleCloud.couplingProperties().found("useDDTvoidfraction"))
|
||||
{
|
||||
Warning << "Suppressing ddt(voidfraction) is not recommended with this solver as it may generate incorrect results!" << endl;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
scalar alphaCoNum = 0.0;
|
||||
scalar meanAlphaCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
mixture.nearInterface()().primitiveField()
|
||||
*fvc::surfaceSum(mag(phi))().primitiveField()
|
||||
);
|
||||
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
<< " max: " << alphaCoNum << endl;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -14,25 +14,27 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
|
||||
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
|
||||
|
||||
Application
|
||||
cfdemSolverRhoSimple
|
||||
cfdemSolverMultiphaseScalar
|
||||
|
||||
Description
|
||||
Steady-state solver for turbulent flow of compressible fluids based on
|
||||
rhoSimpleFoam where functionality for CFD-DEM coupling has been added.
|
||||
CFD-DEM solver for n incompressible fluids which captures the interfaces and
|
||||
includes surface-tension and contact-angle effects for each phase. It is based
|
||||
on the OpenFOAM(R)-4.x solver multiphaseInterFoam but extended to incorporate
|
||||
DEM functionalities from the open-source DEM code LIGGGHTS.
|
||||
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "simpleControl.H"
|
||||
#include "multiphaseMixture.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
#include "CorrectPhi.H"
|
||||
|
||||
#include "cfdemCloudEnergy.H"
|
||||
#include "implicitCouple.H"
|
||||
@ -40,44 +42,50 @@ Description
|
||||
#include "smoothingModel.H"
|
||||
#include "forceModel.H"
|
||||
#include "thermCondModel.H"
|
||||
#include "diffCoeffModel.H"
|
||||
#include "energyModel.H"
|
||||
#include "massTransferModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#if OPENFOAM_VERSION_MAJOR >= 6
|
||||
FatalError << "cfdemSolverMultiphase requires OpenFOAM 4.x or 5.x to work properly" << exit(FatalError);
|
||||
#endif
|
||||
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// create cfdemCloud
|
||||
#include "readGravitationalAcceleration.H"
|
||||
cfdemCloudEnergy particleCloud(mesh);
|
||||
#include "checkModelType.H"
|
||||
#include "correctPhi.H"
|
||||
#include "CourantNo.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// create cfdemCloud
|
||||
cfdemCloudEnergy particleCloud(mesh);
|
||||
|
||||
#include "additionalChecks.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (simple.loop())
|
||||
while (runTime.loop())
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// do particle stuff
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
|
||||
|
||||
@ -90,39 +98,55 @@ int main(int argc, char *argv[])
|
||||
Ksl = particleCloud.momCoupleM(0).impMomSource();
|
||||
Ksl.correctBoundaryConditions();
|
||||
|
||||
//Force Checks
|
||||
vector fTotal(0,0,0);
|
||||
vector fImpTotal = sum(mesh.V()*Ksl.primitiveFieldRef()*(Us.primitiveFieldRef()-U.primitiveFieldRef()));
|
||||
reduce(fImpTotal, sumOp<vector>());
|
||||
Info << "TotalForceExp: " << fTotal << endl;
|
||||
Info << "TotalForceImp: " << fImpTotal << endl;
|
||||
//Force Checks
|
||||
vector fTotal(0,0,0);
|
||||
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
|
||||
reduce(fImpTotal, sumOp<vector>());
|
||||
Info << "TotalForceExp: " << fTotal << endl;
|
||||
Info << "TotalForceImp: " << fImpTotal << endl;
|
||||
|
||||
#include "solverDebugInfo.H"
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
|
||||
volScalarField rhoeps("rhoeps",rho*voidfraction);
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
if(particleCloud.solveFlow())
|
||||
{
|
||||
mixture.solve();
|
||||
rho = mixture.rho();
|
||||
rhoEps = rho * voidfraction;
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "CEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
||||
// besides this pEqn, OF offers a "simple consistent"-option
|
||||
#include "pEqn.H"
|
||||
rhoeps=rho*voidfraction;
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
#include "EEqn.H"
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "skipping flow solution." << endl;
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
particleCloud.clockM().start(32,"postFlow");
|
||||
if(hasEvolved) particleCloud.postFlow();
|
||||
particleCloud.clockM().start(31,"postFlow");
|
||||
particleCloud.postFlow();
|
||||
particleCloud.clockM().stop("postFlow");
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
@ -0,0 +1,11 @@
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
p_rgh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
342
applications/solvers/cfdemSolverMultiphaseScalar/createFields.H
Normal file
342
applications/solvers/cfdemSolverMultiphaseScalar/createFields.H
Normal file
@ -0,0 +1,342 @@
|
||||
//===============================
|
||||
// particle interaction modelling
|
||||
//===============================
|
||||
|
||||
Info<< "\nReading momentum exchange field Ksl\n" << endl;
|
||||
volScalarField Ksl
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Ksl",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
//dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
voidfraction.oldTime();
|
||||
|
||||
Info<< "Reading particle velocity field Us\n" << endl;
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
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
|
||||
);
|
||||
|
||||
Info<< "Reading/calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(U*voidfraction) & mesh.Sf()
|
||||
);
|
||||
|
||||
multiphaseMixture mixture(U, phi, voidfraction);
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.rho()
|
||||
);
|
||||
rho.oldTime();
|
||||
|
||||
//========================
|
||||
// scalar field modelling
|
||||
//========================
|
||||
Info<< "Reading/creating thermal fields\n" << endl;
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField Qsource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qsource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField QCoeff
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qsource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField Cp
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Cp",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.Cp()
|
||||
);
|
||||
|
||||
volScalarField kf
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"kf",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.kf()
|
||||
);
|
||||
|
||||
volScalarField thCond
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
Info<< "Reading/creating concentration fields\n" << endl;
|
||||
volScalarField C
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"C",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField Sm
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sm",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-3,-1,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField Smi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Smi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(0,0,-1,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
|
||||
volScalarField D
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"D",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.D()
|
||||
);
|
||||
|
||||
volScalarField Deff
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Deff",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(0,2,-1,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField Cs
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Cs",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.Cs()
|
||||
);
|
||||
|
||||
surfaceScalarField diffusionCorrection
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"diffusionCorrection",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mixture.diffusionCorrection()
|
||||
);
|
||||
|
||||
//========================
|
||||
|
||||
volScalarField rhoEps ("rhoEps", rho * voidfraction);
|
||||
|
||||
// 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)
|
||||
);
|
||||
}
|
||||
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
phase/phase.C
|
||||
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
||||
multiphaseMixture.C
|
||||
|
||||
LIB = $(CFDEM_LIB_DIR)/libcfdemMultiphaseInterFoamScalar
|
||||
@ -0,0 +1,18 @@
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-IalphaContactAngle \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
LIB_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
|
||||
(
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
theta0_(readScalar(is)),
|
||||
uTheta_(readScalar(is)),
|
||||
thetaA_(readScalar(is)),
|
||||
thetaR_(readScalar(is))
|
||||
{}
|
||||
|
||||
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
os << tp.theta0_ << token::SPACE
|
||||
<< tp.uTheta_ << token::SPACE
|
||||
<< tp.thetaA_ << token::SPACE
|
||||
<< tp.thetaR_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper),
|
||||
thetaProps_(gcpsf.thetaProps_)
|
||||
{}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(p, iF),
|
||||
thetaProps_(dict.lookup("thetaProperties"))
|
||||
{
|
||||
evaluate();
|
||||
}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(gcpsf, iF),
|
||||
thetaProps_(gcpsf.thetaProps_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchScalarField::write(os);
|
||||
os.writeKeyword("thetaProperties")
|
||||
<< thetaProps_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
alphaContactAngleFvPatchScalarField
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,215 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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::alphaContactAngleFvPatchScalarField
|
||||
|
||||
Description
|
||||
Contact-angle boundary condition for multi-phase interface-capturing
|
||||
simulations. Used in conjuction with multiphaseMixture.
|
||||
|
||||
SourceFiles
|
||||
alphaContactAngleFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef alphaContactAngleFvPatchScalarField_H
|
||||
#define alphaContactAngleFvPatchScalarField_H
|
||||
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "multiphaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class alphaContactAngleFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class alphaContactAngleFvPatchScalarField
|
||||
:
|
||||
public zeroGradientFvPatchScalarField
|
||||
{
|
||||
public:
|
||||
|
||||
class interfaceThetaProps
|
||||
{
|
||||
//- Equilibrium contact angle
|
||||
scalar theta0_;
|
||||
|
||||
//- Dynamic contact angle velocity scale
|
||||
scalar uTheta_;
|
||||
|
||||
//- Limiting advancing contact angle
|
||||
scalar thetaA_;
|
||||
|
||||
//- Limiting receeding contact angle
|
||||
scalar thetaR_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
interfaceThetaProps()
|
||||
{}
|
||||
|
||||
interfaceThetaProps(Istream&);
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the equilibrium contact angle theta0
|
||||
scalar theta0(bool matched=true) const
|
||||
{
|
||||
if (matched) return theta0_;
|
||||
else return 180.0 - theta0_;
|
||||
}
|
||||
|
||||
//- Return the dynamic contact angle velocity scale
|
||||
scalar uTheta() const
|
||||
{
|
||||
return uTheta_;
|
||||
}
|
||||
|
||||
//- Return the limiting advancing contact angle
|
||||
scalar thetaA(bool matched=true) const
|
||||
{
|
||||
if (matched) return thetaA_;
|
||||
else return 180.0 - thetaA_;
|
||||
}
|
||||
|
||||
//- Return the limiting receeding contact angle
|
||||
scalar thetaR(bool matched=true) const
|
||||
{
|
||||
if (matched) return thetaR_;
|
||||
else return 180.0 - thetaR_;
|
||||
}
|
||||
|
||||
|
||||
// IO functions
|
||||
|
||||
friend Istream& operator>>(Istream&, interfaceThetaProps&);
|
||||
friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
|
||||
};
|
||||
|
||||
typedef HashTable
|
||||
<
|
||||
interfaceThetaProps,
|
||||
multiphaseMixture::interfacePair,
|
||||
multiphaseMixture::interfacePair::hash
|
||||
> thetaPropsTable;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
thetaPropsTable thetaProps_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("alphaContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given alphaContactAngleFvPatchScalarField
|
||||
// onto a new patch
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchScalarField> clone() const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new alphaContactAngleFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new alphaContactAngleFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the contact angle properties
|
||||
const thetaPropsTable& thetaProps() const
|
||||
{
|
||||
return thetaProps_;
|
||||
}
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,929 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
|
||||
This 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.
|
||||
|
||||
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "multiphaseMixture.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "Time.H"
|
||||
#include "subCycle.H"
|
||||
#include "MULES.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "fvcSnGrad.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcFlux.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
|
||||
|
||||
const Foam::scalar Foam::multiphaseMixture::convertToRad =
|
||||
Foam::constant::mathematical::pi/180.0;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::multiphaseMixture::calcAlphas()
|
||||
{
|
||||
scalar level = 0.0;
|
||||
alphas_ == 0.0;
|
||||
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
alphas_ += level*iter();
|
||||
level += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::calcNu() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// 1/nu
|
||||
tmp<volScalarField> tnuInv = iter()/iter().nu();
|
||||
volScalarField& nuInv = tnuInv.ref();
|
||||
|
||||
// nu
|
||||
tmp<volScalarField> tnu = iter()*iter().nu();
|
||||
volScalarField& nu = tnu.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
nuInv += iter()/iter().nu();
|
||||
}
|
||||
|
||||
nu = 1/nuInv;
|
||||
|
||||
return tnu;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::multiphaseMixture::calcStf() const
|
||||
{
|
||||
tmp<surfaceScalarField> tstf
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"stf",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"stf",
|
||||
dimensionSet(1, -2, -2, 0, 0),
|
||||
0.0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField& stf = tstf.ref();
|
||||
|
||||
forAllConstIter(PtrDictionary<phase>, phases_, iter1)
|
||||
{
|
||||
const phase& alpha1 = iter1();
|
||||
|
||||
PtrDictionary<phase>::const_iterator iter2 = iter1;
|
||||
++iter2;
|
||||
|
||||
for (; iter2 != phases_.end(); ++iter2)
|
||||
{
|
||||
const phase& alpha2 = iter2();
|
||||
|
||||
sigmaTable::const_iterator sigma =
|
||||
sigmas_.find(interfacePair(alpha1, alpha2));
|
||||
|
||||
if (sigma == sigmas_.end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||
<< " in list of sigma values"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
stf += dimensionedScalar("sigma", dimSigma_, sigma())
|
||||
*fvc::interpolate(K(alpha1, alpha2))*
|
||||
(
|
||||
fvc::interpolate(alpha2)*fvc::snGrad(alpha1)
|
||||
- fvc::interpolate(alpha1)*fvc::snGrad(alpha2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return tstf;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::multiphaseMixture::multiphaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& voidfraction
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
U.time().constant(),
|
||||
U.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
|
||||
phases_(lookup("phases"), phase::iNew(U, phi)),
|
||||
|
||||
mesh_(U.mesh()),
|
||||
U_(U),
|
||||
phi_(phi),
|
||||
voidfraction_(voidfraction),
|
||||
rhoPhi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhi",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("rhoPhi", dimMass/dimTime, 0.0)
|
||||
),
|
||||
surfaceTensionForce_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"surfaceTensionForce",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("surfaceTensionForce", dimensionSet(1, -2, -2, 0, 0), 0.0)
|
||||
),
|
||||
alphas_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alphas",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("alphas", dimless, 0.0)
|
||||
),
|
||||
|
||||
nu_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nu",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
calcNu()
|
||||
),
|
||||
|
||||
sigmas_(lookup("sigmas")),
|
||||
dimSigma_(1, 0, -2, 0, 0),
|
||||
deltaN_
|
||||
(
|
||||
"deltaN",
|
||||
1e-8/pow(average(mesh_.V()), 1.0/3.0)
|
||||
)
|
||||
{
|
||||
calcAlphas();
|
||||
alphas_.write();
|
||||
surfaceTensionForce_ = calcStf();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::rho() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
tmp<volScalarField> trho = iter()*iter().rho();
|
||||
volScalarField& rho = trho.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
rho += iter()*iter().rho();
|
||||
}
|
||||
|
||||
return trho;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::multiphaseMixture::rho(const label patchi) const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
|
||||
scalarField& rho = trho.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
rho += iter().boundaryField()[patchi]*iter().rho().value();
|
||||
}
|
||||
|
||||
return trho;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::mu() const
|
||||
{
|
||||
Info << "In multiphasemixture mu()" << endl;
|
||||
return rho()*nu();
|
||||
// PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu();
|
||||
// volScalarField& mu = tmu.ref();
|
||||
|
||||
// for (++iter; iter != phases_.end(); ++iter)
|
||||
// {
|
||||
// mu += iter()*iter().rho()*iter().nu();
|
||||
// }
|
||||
|
||||
// return tmu;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::multiphaseMixture::mu(const label patchi) const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
tmp<scalarField> tmu =
|
||||
iter().boundaryField()[patchi]
|
||||
*iter().rho().value()
|
||||
*iter().nu(patchi);
|
||||
scalarField& mu = tmu.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
mu +=
|
||||
iter().boundaryField()[patchi]
|
||||
*iter().rho().value()
|
||||
*iter().nu(patchi);
|
||||
}
|
||||
|
||||
return tmu;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::multiphaseMixture::muf() const
|
||||
{
|
||||
|
||||
return nuf()*fvc::interpolate(rho());
|
||||
// PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// tmp<surfaceScalarField> tmuf =
|
||||
// fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
|
||||
// surfaceScalarField& muf = tmuf.ref();
|
||||
|
||||
// for (++iter; iter != phases_.end(); ++iter)
|
||||
// {
|
||||
// muf +=
|
||||
// fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
|
||||
// }
|
||||
|
||||
// return tmuf;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::nu() const
|
||||
{
|
||||
return nu_;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::multiphaseMixture::nu(const label patchi) const
|
||||
{
|
||||
//return nu_.boundaryField()[patchi];
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
tmp<scalarField> tnu =
|
||||
iter().boundaryField()[patchi]
|
||||
*iter().nu(patchi);
|
||||
scalarField& nu = tnu.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
nu +=
|
||||
iter().boundaryField()[patchi]
|
||||
*iter().nu(patchi);
|
||||
}
|
||||
|
||||
return tnu;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::multiphaseMixture::nuf() const
|
||||
{
|
||||
//return muf()/fvc::interpolate(rho());
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
tmp<surfaceScalarField> tnuf =
|
||||
fvc::interpolate(iter())*fvc::interpolate(iter().nu());
|
||||
surfaceScalarField& nuf = tnuf.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
nuf +=
|
||||
fvc::interpolate(iter())*fvc::interpolate(iter().nu());
|
||||
}
|
||||
|
||||
return tnuf;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::Cp() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// rho*Cp
|
||||
tmp<volScalarField> trhoCp = iter()*iter().Cp()*iter().rho();
|
||||
volScalarField& rhoCp = trhoCp.ref();
|
||||
|
||||
// Cp
|
||||
tmp<volScalarField> tCp = iter()*iter().Cp();
|
||||
volScalarField& Cp = tCp.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
rhoCp += iter()*iter().Cp()*iter().rho();
|
||||
}
|
||||
Cp = rhoCp/rho();
|
||||
return tCp;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::kf() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// rho*Cp/kf
|
||||
tmp<volScalarField> trhoCpkf = iter()*iter().rho()*iter().Cp()/iter().kf();
|
||||
volScalarField& rhoCpkf = trhoCpkf.ref();
|
||||
|
||||
// kf
|
||||
tmp<volScalarField> tkf = iter()*iter().kf();
|
||||
volScalarField& kf = tkf.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
rhoCpkf += iter()*iter().rho()*iter().Cp()/iter().kf();
|
||||
}
|
||||
|
||||
kf = rho()*Cp()/rhoCpkf;
|
||||
return tkf;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::D() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// 1/D
|
||||
tmp<volScalarField> tDInv = iter()/iter().D();
|
||||
volScalarField& DInv = tDInv.ref();
|
||||
|
||||
// D
|
||||
tmp<volScalarField> tD = iter()*iter().D();
|
||||
volScalarField& D = tD.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
DInv += iter()/iter().D();
|
||||
}
|
||||
|
||||
D = 1/DInv;
|
||||
return tD;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::Cs() const
|
||||
{
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
// Cs
|
||||
tmp<volScalarField> tCs = iter()*iter().Cs();
|
||||
volScalarField& Cs = tCs.ref();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
Cs += iter()*iter().Cs();
|
||||
}
|
||||
|
||||
return tCs;
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::multiphaseMixture::diffusionCorrection() const
|
||||
{
|
||||
|
||||
surfaceScalarField numerator
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"numerator",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimless/dimLength, 0.0)
|
||||
);
|
||||
|
||||
surfaceScalarField denominator
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"denominator",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimless, 0.0)
|
||||
);
|
||||
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
const phase& alpha1 = iter();
|
||||
|
||||
for (++iter; iter != phases_.end(); ++iter)
|
||||
{
|
||||
const phase& alpha2 = iter();
|
||||
scalar He = alpha1.Cs().value() / (alpha2.Cs().value() + SMALL);
|
||||
|
||||
numerator += (1/He - 1) * fvc::snGrad(alpha2);
|
||||
denominator += fvc::interpolate(alpha2) * (1/He - 1);
|
||||
}
|
||||
|
||||
tmp<surfaceScalarField> correction = numerator / (denominator + 1 + SMALL);
|
||||
|
||||
/*
|
||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||
|
||||
const phase& alphaL = iter();
|
||||
++iter;
|
||||
const phase& alphaG = iter();
|
||||
scalar He = alphaG.Cs().value() / (alphaL.Cs().value() + SMALL);
|
||||
|
||||
surfaceScalarField gradAlphaL = fvc::snGrad(alphaL);
|
||||
surfaceScalarField surfAlphaL = fvc::interpolate(alphaL);
|
||||
|
||||
tmp<surfaceScalarField> correction = (1-He)/(surfAlphaL + He*(1-surfAlphaL) + 10*SMALL) * gradAlphaL;
|
||||
*/
|
||||
return correction;
|
||||
}
|
||||
|
||||
void Foam::multiphaseMixture::solve()
|
||||
{
|
||||
correct();
|
||||
|
||||
const Time& runTime = mesh_.time();
|
||||
|
||||
volScalarField& alpha = phases_.first();
|
||||
|
||||
const dictionary& alphaControls = mesh_.solverDict("alpha");
|
||||
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
|
||||
scalar cAlpha(readScalar(alphaControls.lookup("cAlpha")));
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
surfaceScalarField rhoPhiSum
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhiSum",
|
||||
runTime.timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("0", rhoPhi_.dimensions(), 0)
|
||||
);
|
||||
|
||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> alphaSubCycle(alpha, nAlphaSubCycles);
|
||||
!(++alphaSubCycle).end();
|
||||
)
|
||||
{
|
||||
FatalError << "Sub-cycling of the alpha equation not yet implemented!!" << abort(FatalError);
|
||||
solveAlphas(cAlpha);
|
||||
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_;
|
||||
}
|
||||
|
||||
rhoPhi_ = rhoPhiSum;
|
||||
}
|
||||
else
|
||||
{
|
||||
solveAlphas(cAlpha);
|
||||
}
|
||||
|
||||
// Update the mixture kinematic viscosity
|
||||
nu_ = calcNu();
|
||||
|
||||
surfaceTensionForce_ = calcStf();
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::correct()
|
||||
{
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
iter().correct();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const
|
||||
{
|
||||
/*
|
||||
// Cell gradient of alpha
|
||||
volVectorField gradAlpha =
|
||||
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
|
||||
|
||||
// Interpolated face-gradient of alpha
|
||||
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
|
||||
*/
|
||||
|
||||
surfaceVectorField gradAlphaf
|
||||
(
|
||||
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
|
||||
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
|
||||
);
|
||||
|
||||
// Face unit interface normal
|
||||
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::nHatf
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const
|
||||
{
|
||||
// Face unit interface normal flux
|
||||
return nHatfv(alpha1, alpha2) & mesh_.Sf();
|
||||
}
|
||||
|
||||
|
||||
// Correction for the boundary condition on the unit normal nHat on
|
||||
// walls to produce the correct contact angle.
|
||||
|
||||
// The dynamic contact angle is calculated from the component of the
|
||||
// velocity on the direction of the interface, parallel to the wall.
|
||||
|
||||
void Foam::multiphaseMixture::correctContactAngle
|
||||
(
|
||||
const phase& alpha1,
|
||||
const phase& alpha2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const
|
||||
{
|
||||
const volScalarField::Boundary& gbf
|
||||
= alpha1.boundaryField();
|
||||
|
||||
const fvBoundaryMesh& boundary = mesh_.boundary();
|
||||
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
{
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||
|
||||
vectorField& nHatPatch = nHatb[patchi];
|
||||
|
||||
vectorField AfHatPatch
|
||||
(
|
||||
mesh_.Sf().boundaryField()[patchi]
|
||||
/mesh_.magSf().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
alphaContactAngleFvPatchScalarField::thetaPropsTable::
|
||||
const_iterator tp =
|
||||
acap.thetaProps().find(interfacePair(alpha1, alpha2));
|
||||
|
||||
if (tp == acap.thetaProps().end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
|
||||
<< "\n in table of theta properties for patch "
|
||||
<< acap.patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
bool matched = (tp.key().first() == alpha1.name());
|
||||
|
||||
scalar theta0 = convertToRad*tp().theta0(matched);
|
||||
scalarField theta(boundary[patchi].size(), theta0);
|
||||
|
||||
scalar uTheta = tp().uTheta();
|
||||
|
||||
// Calculate the dynamic contact angle if required
|
||||
if (uTheta > SMALL)
|
||||
{
|
||||
scalar thetaA = convertToRad*tp().thetaA(matched);
|
||||
scalar thetaR = convertToRad*tp().thetaR(matched);
|
||||
|
||||
// Calculated the component of the velocity parallel to the wall
|
||||
vectorField Uwall
|
||||
(
|
||||
U_.boundaryField()[patchi].patchInternalField()
|
||||
- U_.boundaryField()[patchi]
|
||||
);
|
||||
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
|
||||
|
||||
// Find the direction of the interface parallel to the wall
|
||||
vectorField nWall
|
||||
(
|
||||
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
|
||||
);
|
||||
|
||||
// Normalise nWall
|
||||
nWall /= (mag(nWall) + SMALL);
|
||||
|
||||
// Calculate Uwall resolved normal to the interface parallel to
|
||||
// the interface
|
||||
scalarField uwall(nWall & Uwall);
|
||||
|
||||
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
|
||||
}
|
||||
|
||||
|
||||
// Reset nHatPatch to correspond to the contact angle
|
||||
|
||||
scalarField a12(nHatPatch & AfHatPatch);
|
||||
|
||||
scalarField b1(cos(theta));
|
||||
|
||||
scalarField b2(nHatPatch.size());
|
||||
|
||||
forAll(b2, facei)
|
||||
{
|
||||
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
|
||||
}
|
||||
|
||||
scalarField det(1.0 - a12*a12);
|
||||
|
||||
scalarField a((b1 - a12*b2)/det);
|
||||
scalarField b((b2 - a12*b1)/det);
|
||||
|
||||
nHatPatch = a*AfHatPatch + b*nHatPatch;
|
||||
|
||||
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
|
||||
(
|
||||
const phase& alpha1,
|
||||
const phase& alpha2
|
||||
) const
|
||||
{
|
||||
tmp<surfaceVectorField> tnHatfv = nHatfv(alpha1, alpha2);
|
||||
|
||||
correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryFieldRef());
|
||||
|
||||
// Simple expression for curvature
|
||||
return -fvc::div(tnHatfv & mesh_.Sf());
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::nearInterface() const
|
||||
{
|
||||
tmp<volScalarField> tnearInt
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nearInterface",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("nearInterface", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
forAllConstIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
|
||||
}
|
||||
|
||||
return tnearInt;
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::solveAlphas
|
||||
(
|
||||
const scalar cAlpha
|
||||
)
|
||||
{
|
||||
static label nSolves=-1;
|
||||
nSolves++;
|
||||
|
||||
word alphaScheme("div(phi,alpha)");
|
||||
word alpharScheme("div(phirb,alpha)");
|
||||
|
||||
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
|
||||
phic = min(cAlpha*phic, max(phic));
|
||||
|
||||
PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
|
||||
int phasei = 0;
|
||||
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
phase& alpha = iter();
|
||||
|
||||
alphaPhiCorrs.set
|
||||
(
|
||||
phasei,
|
||||
new surfaceScalarField
|
||||
(
|
||||
"phi" + alpha.name() + "Corr",
|
||||
fvc::flux
|
||||
(
|
||||
phi_,
|
||||
alpha,
|
||||
alphaScheme
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei];
|
||||
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter2)
|
||||
{
|
||||
phase& alpha2 = iter2();
|
||||
|
||||
if (&alpha2 == &alpha) continue;
|
||||
|
||||
surfaceScalarField phir(phic*nHatf(alpha, alpha2));
|
||||
|
||||
alphaPhiCorr += fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, alpha2, alpharScheme),
|
||||
alpha,
|
||||
alpharScheme
|
||||
);
|
||||
}
|
||||
|
||||
MULES::limit
|
||||
(
|
||||
1.0/mesh_.time().deltaT().value(),
|
||||
voidfraction_,
|
||||
alpha,
|
||||
phi_,
|
||||
alphaPhiCorr,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
1,
|
||||
0,
|
||||
#else
|
||||
oneField(),
|
||||
zeroField(),
|
||||
#endif
|
||||
true
|
||||
);
|
||||
|
||||
phasei++;
|
||||
}
|
||||
|
||||
MULES::limitSum(alphaPhiCorrs);
|
||||
|
||||
rhoPhi_ = dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0);
|
||||
|
||||
volScalarField sumAlpha
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"sumAlpha",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("sumAlpha", dimless, 0)
|
||||
);
|
||||
|
||||
phasei = 0;
|
||||
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
phase& alpha = iter();
|
||||
|
||||
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
|
||||
alphaPhi += upwind<scalar>(mesh_, phi_).flux(alpha);
|
||||
|
||||
MULES::explicitSolve
|
||||
(
|
||||
voidfraction_,
|
||||
alpha,
|
||||
alphaPhi,
|
||||
zeroField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
rhoPhi_ += alphaPhi*alpha.rho();
|
||||
|
||||
Info<< alpha.name() << " volume fraction, min, max = "
|
||||
<< alpha.weightedAverage(mesh_.V()).value()
|
||||
<< ' ' << min(alpha).value()
|
||||
<< ' ' << max(alpha).value()
|
||||
<< endl;
|
||||
|
||||
sumAlpha += alpha;
|
||||
|
||||
phasei++;
|
||||
}
|
||||
|
||||
Info<< "Phase-sum volume fraction, min, max = "
|
||||
<< sumAlpha.weightedAverage(mesh_.V()).value()
|
||||
<< ' ' << min(sumAlpha).value()
|
||||
<< ' ' << max(sumAlpha).value()
|
||||
<< endl;
|
||||
|
||||
calcAlphas();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::multiphaseMixture::read()
|
||||
{
|
||||
if (transportModel::read())
|
||||
{
|
||||
bool readOK = true;
|
||||
|
||||
PtrList<entry> phaseData(lookup("phases"));
|
||||
label phasei = 0;
|
||||
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
readOK &= iter().read(phaseData[phasei++].dict());
|
||||
}
|
||||
|
||||
lookup("sigmas") >> sigmas_;
|
||||
|
||||
return readOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,299 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
|
||||
This 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.
|
||||
|
||||
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
|
||||
|
||||
Class
|
||||
multiphaseMixture
|
||||
|
||||
Description
|
||||
This class is based on the OpenFOAM(R) Foam::multiphaseMixture class,
|
||||
which is an incompressible multi-phase mixture with built in solution
|
||||
for the phase fractions with interface compression for interface-capturing.
|
||||
It has been extended to include the void fraction in the volume fraction
|
||||
transport equations.
|
||||
|
||||
Derived from transportModel so that it can be unsed in conjunction with
|
||||
the incompressible turbulence models.
|
||||
|
||||
Surface tension and contact-angle is handled for the interface
|
||||
between each phase-pair.
|
||||
|
||||
SourceFiles
|
||||
multiphaseMixture.C
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef multiphaseMixture_H
|
||||
#define multiphaseMixture_H
|
||||
|
||||
#include "incompressible/transportModel/transportModel.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "phase.H"
|
||||
#include "PtrDictionary.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiphaseMixture
|
||||
:
|
||||
public IOdictionary,
|
||||
public transportModel
|
||||
{
|
||||
public:
|
||||
|
||||
class interfacePair
|
||||
:
|
||||
public Pair<word>
|
||||
{
|
||||
public:
|
||||
|
||||
class hash
|
||||
:
|
||||
public Hash<interfacePair>
|
||||
{
|
||||
public:
|
||||
|
||||
hash()
|
||||
{}
|
||||
|
||||
label operator()(const interfacePair& key) const
|
||||
{
|
||||
return word::hash()(key.first()) + word::hash()(key.second());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
interfacePair()
|
||||
{}
|
||||
|
||||
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
||||
:
|
||||
Pair<word>(alpha1Name, alpha2Name)
|
||||
{}
|
||||
|
||||
interfacePair(const phase& alpha1, const phase& alpha2)
|
||||
:
|
||||
Pair<word>(alpha1.name(), alpha2.name())
|
||||
{}
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==
|
||||
(
|
||||
const interfacePair& a,
|
||||
const interfacePair& b
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
((a.first() == b.first()) && (a.second() == b.second()))
|
||||
|| ((a.first() == b.second()) && (a.second() == b.first()))
|
||||
);
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
(
|
||||
const interfacePair& a,
|
||||
const interfacePair& b
|
||||
)
|
||||
{
|
||||
return (!(a == b));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Dictionary of phases
|
||||
PtrDictionary<phase> phases_;
|
||||
|
||||
const fvMesh& mesh_;
|
||||
const volVectorField& U_;
|
||||
const surfaceScalarField& phi_;
|
||||
const volScalarField& voidfraction_;
|
||||
surfaceScalarField rhoPhi_;
|
||||
surfaceScalarField surfaceTensionForce_;
|
||||
volScalarField alphas_;
|
||||
|
||||
volScalarField nu_;
|
||||
|
||||
typedef HashTable<scalar, interfacePair, interfacePair::hash>
|
||||
sigmaTable;
|
||||
|
||||
sigmaTable sigmas_;
|
||||
dimensionSet dimSigma_;
|
||||
|
||||
//- Stabilisation for normalisation of the interface normal
|
||||
const dimensionedScalar deltaN_;
|
||||
|
||||
//- Conversion factor for degrees into radians
|
||||
static const scalar convertToRad;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
void calcAlphas();
|
||||
|
||||
tmp<volScalarField> calcNu() const;
|
||||
|
||||
void solveAlphas(const scalar cAlpha);
|
||||
|
||||
tmp<surfaceVectorField> nHatfv
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const;
|
||||
|
||||
tmp<surfaceScalarField> nHatf
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const;
|
||||
|
||||
void correctContactAngle
|
||||
(
|
||||
const phase& alpha1,
|
||||
const phase& alpha2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const;
|
||||
|
||||
tmp<volScalarField> K(const phase& alpha1, const phase& alpha2) const;
|
||||
tmp<surfaceScalarField> calcStf() const;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
multiphaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& voidfraction
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~multiphaseMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phases
|
||||
const PtrDictionary<phase>& phases() const
|
||||
{
|
||||
return phases_;
|
||||
}
|
||||
|
||||
//- Return the velocity
|
||||
const volVectorField& U() const
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
//- Return the volumetric flux
|
||||
const surfaceScalarField& phi() const
|
||||
{
|
||||
return phi_;
|
||||
}
|
||||
|
||||
const surfaceScalarField& rhoPhi() const
|
||||
{
|
||||
return rhoPhi_;
|
||||
}
|
||||
|
||||
//- Return the mixture density
|
||||
tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return the mixture density for patch
|
||||
tmp<scalarField> rho(const label patchi) const;
|
||||
|
||||
//- Return the dynamic laminar viscosity
|
||||
tmp<volScalarField> mu() const;
|
||||
|
||||
//- Return the dynamic laminar viscosity for patch
|
||||
tmp<scalarField> mu(const label patchi) const;
|
||||
|
||||
//- Return the face-interpolated dynamic laminar viscosity
|
||||
tmp<surfaceScalarField> muf() const;
|
||||
|
||||
//- Return the kinematic laminar viscosity
|
||||
tmp<volScalarField> nu() const;
|
||||
|
||||
//- Return the laminar viscosity for patch
|
||||
tmp<scalarField> nu(const label patchi) const;
|
||||
|
||||
//- Return the face-interpolated dynamic laminar viscosity
|
||||
tmp<surfaceScalarField> nuf() const;
|
||||
|
||||
//- Return the heat capacity
|
||||
tmp<volScalarField> Cp() const;
|
||||
|
||||
//- Return the thermal conductivity
|
||||
tmp<volScalarField> kf() const;
|
||||
|
||||
//- Return the diffusion coefficient
|
||||
tmp<volScalarField> D() const;
|
||||
|
||||
//- Return the solubility
|
||||
tmp<volScalarField> Cs() const;
|
||||
|
||||
//- Return the diffusion correction term
|
||||
tmp<surfaceScalarField> diffusionCorrection() const;
|
||||
|
||||
tmp<surfaceScalarField> surfaceTensionForce() const
|
||||
{
|
||||
return surfaceTensionForce_;
|
||||
}
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<volScalarField> nearInterface() const;
|
||||
|
||||
//- Solve for the mixture phase-fractions
|
||||
void solve();
|
||||
|
||||
//- Correct the mixture properties
|
||||
void correct();
|
||||
|
||||
//- Read base transportProperties dictionary
|
||||
bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phase::phase
|
||||
(
|
||||
const word& phaseName,
|
||||
const dictionary& phaseDict,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alpha", phaseName),
|
||||
U.mesh().time().timeName(),
|
||||
U.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U.mesh()
|
||||
),
|
||||
name_(phaseName),
|
||||
phaseDict_(phaseDict),
|
||||
nuModel_
|
||||
(
|
||||
viscosityModel::New
|
||||
(
|
||||
IOobject::groupName("nu", phaseName),
|
||||
phaseDict_,
|
||||
U,
|
||||
phi
|
||||
)
|
||||
),
|
||||
rho_("rho", dimDensity, phaseDict_),
|
||||
Cp_("Cp", (dimSpecificHeatCapacity), phaseDict_),
|
||||
kf_("kf", (dimPower/dimLength/dimTemperature), phaseDict_),
|
||||
D_("D", dimViscosity, phaseDict_),
|
||||
Cs_("Cs", dimDensity, phaseDict_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return autoPtr<phase>(NULL);
|
||||
}
|
||||
|
||||
|
||||
void Foam::phase::correct()
|
||||
{
|
||||
nuModel_->correct();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::phase::read(const dictionary& phaseDict)
|
||||
{
|
||||
phaseDict_ = phaseDict;
|
||||
|
||||
phaseDict_.lookup("Cp") >> Cp_;
|
||||
phaseDict_.lookup("kf") >> kf_;
|
||||
phaseDict_.lookup("D") >> D_;
|
||||
phaseDict_.lookup("Cs") >> Cs_;
|
||||
|
||||
if (nuModel_->read(phaseDict_))
|
||||
{
|
||||
phaseDict_.lookup("rho") >> rho_;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,190 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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::phase
|
||||
|
||||
Description
|
||||
Single incompressible phase derived from the phase-fraction.
|
||||
Used as part of the multiPhaseMixture for interface-capturing multi-phase
|
||||
simulations.
|
||||
|
||||
SourceFiles
|
||||
phase.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phase_H
|
||||
#define phase_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionaryEntry.H"
|
||||
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phase Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phase
|
||||
:
|
||||
public volScalarField
|
||||
{
|
||||
// Private data
|
||||
|
||||
word name_;
|
||||
dictionary phaseDict_;
|
||||
autoPtr<viscosityModel> nuModel_;
|
||||
dimensionedScalar rho_;
|
||||
dimensionedScalar Cp_;
|
||||
dimensionedScalar kf_;
|
||||
dimensionedScalar D_;
|
||||
dimensionedScalar Cs_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
phase
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& phaseDict,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<phase> clone() const;
|
||||
|
||||
//- Return a pointer to a new phase created on freestore
|
||||
// from Istream
|
||||
class iNew
|
||||
{
|
||||
const volVectorField& U_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
public:
|
||||
|
||||
iNew
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
U_(U),
|
||||
phi_(phi)
|
||||
{}
|
||||
|
||||
autoPtr<phase> operator()(Istream& is) const
|
||||
{
|
||||
dictionaryEntry ent(dictionary::null, is);
|
||||
return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
const word& name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
const word& keyword() const
|
||||
{
|
||||
return name();
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 viscosityModel
|
||||
const viscosityModel& nuModel() const
|
||||
{
|
||||
return nuModel_();
|
||||
}
|
||||
|
||||
//- Return the kinematic laminar viscosity
|
||||
tmp<volScalarField> nu() const
|
||||
{
|
||||
return nuModel_->nu();
|
||||
}
|
||||
|
||||
//- Return the laminar viscosity for patch
|
||||
tmp<scalarField> nu(const label patchi) const
|
||||
{
|
||||
return nuModel_->nu(patchi);
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 density
|
||||
const dimensionedScalar& rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 heat capacity
|
||||
const dimensionedScalar& Cp() const
|
||||
{
|
||||
return Cp_;
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 thermal conductivity
|
||||
const dimensionedScalar& kf() const
|
||||
{
|
||||
return kf_;
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 diffusion coefficient
|
||||
const dimensionedScalar& D() const
|
||||
{
|
||||
return D_;
|
||||
}
|
||||
|
||||
//- Return const-access to phase1 solubility
|
||||
const dimensionedScalar& Cs() const
|
||||
{
|
||||
return Cs_;
|
||||
}
|
||||
|
||||
//- Correct the phase properties
|
||||
void correct();
|
||||
|
||||
//-Inherit read from volScalarField
|
||||
using volScalarField::read;
|
||||
|
||||
//- Read base transportProperties dictionary
|
||||
bool read(const dictionary& phaseDict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
73
applications/solvers/cfdemSolverMultiphaseScalar/pEqn.H
Normal file
73
applications/solvers/cfdemSolverMultiphaseScalar/pEqn.H
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUepsf("rAUepsf", fvc::interpolate(rAU*voidfraction));
|
||||
surfaceScalarField rAUepsSqf("rAUepsSqf", fvc::interpolate(rAU*voidfraction*voidfraction));
|
||||
volVectorField Ueps("Ueps", U * voidfraction);
|
||||
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::flux(HbyA*voidfraction)
|
||||
+ fvc::interpolate(voidfraction*rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
|
||||
if (modelType == "A")
|
||||
rAUepsf = rAUepsSqf;
|
||||
|
||||
surfaceScalarField phig (-ghf*fvc::snGrad(rho)*rAUepsf*mesh.magSf());
|
||||
|
||||
surfaceScalarField phiSt (mixture.surfaceTensionForce()*rAUepsSqf*mesh.magSf());
|
||||
|
||||
surfaceScalarField phiS (fvc::flux(voidfraction*Us*Ksl*rAU));
|
||||
|
||||
phiHbyA += phig + phiSt + phiS;
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p_rgh, Ueps, phiHbyA, rAUepsf);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUepsf, p_rgh) == particleCloud.ddtVoidfraction() + fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
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();
|
||||
|
||||
if (modelType == "A")
|
||||
U = HbyA + voidfraction*rAU*fvc::reconstruct((phig-p_rghEqn.flux()+phiSt)/rAUepsf) + rAU*Us*Ksl;
|
||||
else
|
||||
U = HbyA + rAU*fvc::reconstruct((phig-p_rghEqn.flux()+phiSt)/rAUepsf) + rAU*Us*Ksl;
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
p == p_rgh + rho*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, pRefCell)
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
}
|
||||
@ -10,6 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
particleCloud.otherForces(fOther);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(voidfraction,U) - fvm::Sp(fvc::ddt(voidfraction),U)
|
||||
+ fvm::div(phi,U) - fvm::Sp(fvc::div(phi),U)
|
||||
+ particleCloud.divVoidfractionTau(U, voidfraction)
|
||||
- fOther/rho
|
||||
==
|
||||
fvOptions(U)
|
||||
- fvm::Sp(Ksl/rho,U)
|
||||
|
||||
@ -46,6 +46,21 @@
|
||||
//dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating body force field\n" << endl;
|
||||
volVectorField fOther
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fOther",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
|
||||
);
|
||||
|
||||
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
cfdemSolverPisoFreeStreaming.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/cfdemSolverPisoFreeStreaming
|
||||
@ -0,0 +1,28 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(FOAM_SOLVERS)/incompressible/pisoFoam \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-lsampling \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
CFDEMcoupling - Open Source CFD-DEM coupling
|
||||
|
||||
CFDEMcoupling is part of the CFDEMproject
|
||||
www.cfdem.com
|
||||
Christoph Goniva, christoph.goniva@cfdem.com
|
||||
Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
Copyright (C) 2009-2012 JKU, Linz
|
||||
Copyright (C) 2012- DCS Computing GmbH,Linz
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of CFDEMcoupling.
|
||||
|
||||
CFDEMcoupling 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.
|
||||
|
||||
CFDEMcoupling 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 CFDEMcoupling. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
cfdemSolverPisoFreeStreaming
|
||||
|
||||
Description
|
||||
Transient solver for incompressible flow.
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6,
|
||||
where additional functionality for CFD-DEM coupling is added.
|
||||
the particles follow the fluid velocity
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "pisoControl.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
#include "cfdemCloudRec.H"
|
||||
|
||||
#include "cfdemCloud.H"
|
||||
#include "implicitCouple.H"
|
||||
#include "clockModel.H"
|
||||
#include "smoothingModel.H"
|
||||
#include "forceModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
cfdemCloudRec<cfdemCloud> particleCloud(mesh);
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
while (runTime.loop())
|
||||
{
|
||||
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "CourantNo.H"
|
||||
|
||||
// do particle stuff
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
|
||||
particleCloud.evolve(voidfraction,Us,U);
|
||||
|
||||
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
|
||||
if(particleCloud.solveFlow())
|
||||
{
|
||||
// Pressure-velocity PISO corrector
|
||||
{
|
||||
// Momentum predictor
|
||||
#include "UEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
while (piso.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
}
|
||||
|
||||
laminarTransport.correct();
|
||||
turbulence->correct();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "skipping flow solution." << endl;
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
particleCloud.clockM().stop("Flow");
|
||||
particleCloud.clockM().stop("Global");
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
110
applications/solvers/cfdemSolverPisoFreeStreaming/createFields.H
Normal file
110
applications/solvers/cfdemSolverPisoFreeStreaming/createFields.H
Normal file
@ -0,0 +1,110 @@
|
||||
Info<< "Reading field p\n" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading physical velocity field U" << endl;
|
||||
Info<< "Note: only if voidfraction at boundary is 1, U is superficial velocity!!!\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
//===============================
|
||||
// particle interaction modelling
|
||||
//===============================
|
||||
|
||||
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "\nCreating density field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading particle velocity field Us\n" << endl;
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
//===============================
|
||||
|
||||
//# include "createPhi.H"
|
||||
#ifndef createPhi_H
|
||||
#define createPhi_H
|
||||
Info<< "Reading/calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(U) & mesh.Sf()
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
#include "createMRF.H"
|
||||
@ -11,6 +11,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -11,6 +11,7 @@ EXE_INC = \
|
||||
-I../cfdemSolverPiso \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -46,6 +46,21 @@
|
||||
//dimensionedScalar("0", dimensionSet(0, 0, -1, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating body force field\n" << endl;
|
||||
volVectorField fOther
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fOther",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
|
||||
);
|
||||
|
||||
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
|
||||
@ -6,10 +6,18 @@
|
||||
particleCloud.energyContributions(Qsource);
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
//thDiff=particleCloud.thermCondM().thermDiff();
|
||||
thCond=particleCloud.thermCondM().thermCond();
|
||||
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
|
||||
|
||||
addSource = fvc::ddt(rhoeps, K) + fvc::div(phi, K)
|
||||
// For implict T terms in the energy/enthalpy transport equation, use
|
||||
// (he_n+1 - he_n) / (T_n+1 - T_n) = Cpv to eliminate T_n+1 with he_n+1.
|
||||
// This formula is valid for ideal gases with e=e(T) and h=h(T). For
|
||||
// incompressible fluids, e=e(T) holds, too, but enthalpy would need correction
|
||||
// terms accounting for pressure variations.
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rhoeps, he) + fvm::div(phi, he)
|
||||
+ fvc::ddt(rhoeps, K) + fvc::div(phi, K)
|
||||
+ (
|
||||
he.name() == "e"
|
||||
? fvc::div
|
||||
@ -19,26 +27,14 @@
|
||||
"div(phiv,p)"
|
||||
)
|
||||
: -dpdt
|
||||
);
|
||||
|
||||
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
|
||||
|
||||
// correct source for the thermodynamic reference temperature
|
||||
dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL));
|
||||
Qsource += QCoeff*Tref;
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rhoeps, he) + fvm::div(phi, he)
|
||||
+ addSource
|
||||
// net heat transfer from particles to fluid
|
||||
)
|
||||
- Qsource
|
||||
- QCoeff*T
|
||||
- fvm::Sp(QCoeff/Cpv, he)
|
||||
// thermal conduction of the fluid with effective conductivity
|
||||
// - fvm::laplacian(rhoeps*thDiff,he)
|
||||
+ QCoeff/Cpv*he
|
||||
- fvc::laplacian(voidfraction*thCond,T)
|
||||
- fvm::laplacian(voidfraction*thCond/Cpv,he)
|
||||
// + particle-fluid energy transfer due to work
|
||||
// + fluid energy dissipation due to shearing
|
||||
+ fvc::laplacian(voidfraction*thCond/Cpv,he)
|
||||
==
|
||||
fvOptions(rho, he)
|
||||
);
|
||||
@ -54,10 +50,7 @@
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info << "Qsource" << max(Qsource).value() << " " << min(Qsource).value() << endl;
|
||||
Info << "QCoeff" << max(QCoeff).value() << " " << min(QCoeff).value() << endl;
|
||||
Info << "Cpv" << max(Cpv).value() << " " << min(Cpv).value() << endl;
|
||||
Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl;
|
||||
Info<< "T max/min/ave : " << max(T).value() << " " << min(T).value() << " " << average(T).value() << endl;
|
||||
|
||||
particleCloud.clockM().start(31,"energySolve");
|
||||
particleCloud.solve();
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
PFLAGS+= -Dcompre
|
||||
|
||||
EXE_INC = \
|
||||
@ -15,6 +17,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
|
||||
@ -32,6 +32,9 @@ Description
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#if OPENFOAM_VERSION_MAJOR >= 5
|
||||
#include "pressureControl.H"
|
||||
#endif
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
@ -69,16 +72,19 @@ int main(int argc, char *argv[])
|
||||
#include "checkModelType.H"
|
||||
|
||||
turbulence->validate();
|
||||
//#include "compressibleCourantNo.H"
|
||||
//#include "setInitialDeltaT.H"
|
||||
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
bool firstStep = true;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
@ -90,9 +96,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
// do particle stuff
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
|
||||
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
|
||||
|
||||
if(hasEvolved)
|
||||
if(hasEvolved && smoothenForces)
|
||||
{
|
||||
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
|
||||
}
|
||||
@ -109,19 +116,35 @@ int main(int argc, char *argv[])
|
||||
Info << "TotalForceImp: " << fImpTotal << endl;
|
||||
|
||||
#include "solverDebugInfo.H"
|
||||
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
if (pimple.nCorrPIMPLE() <= 1)
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
rhoeps = rho*voidfraction;
|
||||
#endif
|
||||
|
||||
volScalarField rhoeps("rhoeps",rho*voidfraction);
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#if OPENFOAM_VERSION_MAJOR >= 6
|
||||
if (pimple.firstIter())
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
if (firstStep)
|
||||
{
|
||||
rhoeps.oldTime() = rho.oldTime()*voidfraction.oldTime();
|
||||
firstStep = false;
|
||||
}
|
||||
rhoeps = rho*voidfraction;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
@ -130,7 +153,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// besides this pEqn, OF offers a "pimple consistent"-option
|
||||
#include "pEqn.H"
|
||||
rhoeps=rho*voidfraction;
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
@ -145,7 +167,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
@ -51,19 +51,49 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField addSource
|
||||
volScalarField rhoeps("rhoeps", rho*voidfraction);
|
||||
rhoeps.oldTime(); // switch on saving old time
|
||||
|
||||
Info<< "Reading/calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"addSource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(rho*U*voidfraction) & mesh.Sf()
|
||||
);
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
#else
|
||||
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||
#endif
|
||||
|
||||
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
|
||||
volScalarField Qsource
|
||||
(
|
||||
@ -94,21 +124,6 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
/* Info<< "\nCreating thermal diffusivity field\n" << endl;
|
||||
volScalarField thDiff
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thDiff",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(0,2,-1,0,0,0,0), 0.0)
|
||||
);
|
||||
*/
|
||||
Info<< "\nCreating thermal conductivity field\n" << endl;
|
||||
volScalarField thCond
|
||||
(
|
||||
@ -117,11 +132,12 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
Info<< "\nCreating heat capacity field\n" << endl;
|
||||
@ -154,41 +170,16 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
|
||||
);
|
||||
|
||||
Info<< "Reading/calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phi
|
||||
bool smoothenForces
|
||||
(
|
||||
IOobject
|
||||
pimple.dict().lookupOrDefault<bool>
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(rho*U*voidfraction) & mesh.Sf()
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
"smoothenForces",
|
||||
false
|
||||
)
|
||||
);
|
||||
if (smoothenForces) Info << "Smoothening implicit particle forces.\n" << endl;
|
||||
else Info << "Not smoothening implicit particle forces.\n" << endl;
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
||||
@ -1,14 +1,19 @@
|
||||
rho = thermo.rho();
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
rhoeps = rho*voidfraction;
|
||||
#else
|
||||
rhoeps = rho*voidfraction;
|
||||
|
||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||
// pressure solution
|
||||
const volScalarField psip0(psi*p);
|
||||
#endif
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rhoeps*rAU));
|
||||
if (modelType=="A")
|
||||
{
|
||||
rhorAUf *= fvc::interpolate(voidfraction);
|
||||
}
|
||||
surfaceScalarField rhorAUf("rhorAUf", (modelType=="A")?fvc::interpolate(voidfraction*rhoeps*rAU):fvc::interpolate(rhoeps*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*Us)& mesh.Sf());
|
||||
@ -18,30 +23,40 @@ if (pimple.nCorrPISO() <= 1)
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::interpolate(rhoeps)*fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rhoeps, U, phi)
|
||||
);
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
// transonic version not implemented yet
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rhoeps*HbyA)
|
||||
// + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
// flux without pressure gradient contribution
|
||||
phi = phiHbyA + phiUs;
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rhoeps, U, phi, rhorAUf);
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR >= 5
|
||||
fvScalarMatrix pDDtEqn
|
||||
(
|
||||
fvc::ddt(rhoeps)
|
||||
+ psi*voidfraction*correction(fvm::ddt(p))
|
||||
+ fvc::div(phi)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
#endif
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Pressure corrector
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi*voidfraction, p)
|
||||
@ -50,6 +65,9 @@ else
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
#else
|
||||
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
|
||||
#endif
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
@ -60,19 +78,18 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Thermodynamic density update
|
||||
#if OPENFOAM_VERSION_MAJOR >= 5
|
||||
thermo.correctRho(psi*p - psip0);
|
||||
#endif
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrsPU.H"
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho max/min : " << max(rho).value()
|
||||
<< " " << min(rho).value() << endl;
|
||||
Info<< "p max/min/ave : " << max(p).value()
|
||||
<< " " << min(p).value() << " " << average(p).value() << endl;
|
||||
|
||||
if (modelType=="A")
|
||||
{
|
||||
@ -86,6 +103,24 @@ U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
#if OPENFOAM_VERSION_MAJOR >= 5
|
||||
if (pressureControl.limit(p))
|
||||
{
|
||||
p.correctBoundaryConditions();
|
||||
}
|
||||
rho = thermo.rho();
|
||||
#else
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
#endif
|
||||
rhoeps = rho*voidfraction;
|
||||
|
||||
Info<< "rho max/min/ave : " << max(rho).value()
|
||||
<< " " << min(rho).value() << " " << average(rho).value() << endl;
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(voidfraction,p);
|
||||
|
||||
@ -6,12 +6,13 @@ volScalarField& he = thermo.he();
|
||||
particleCloud.energyContributions(Qsource);
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
thCond=particleCloud.thermCondM().thermCond();
|
||||
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
|
||||
|
||||
// correct source for the thermodynamic reference temperature
|
||||
// dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL));
|
||||
// Qsource += QCoeff*Tref;
|
||||
// For implict T terms in the energy/enthalpy transport equation, use
|
||||
// (he_n+1 - he_n) / (T_n+1 - T_n) = Cpv to eliminate T_n+1 with he_n+1.
|
||||
// This formula is valid for ideal gases with e=e(T) and h=h(T). For
|
||||
// incompressible fluids, e=e(T) holds, too, but enthalpy would need correction
|
||||
// terms accounting for pressure variations.
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
@ -27,13 +28,13 @@ fvScalarMatrix EEqn
|
||||
)
|
||||
: -dpdt
|
||||
)
|
||||
// net heat transfer from particles to fluid
|
||||
- Qsource
|
||||
- QCoeff*T
|
||||
- fvm::Sp(QCoeff/Cpv, he)
|
||||
// thermal conduction of the fluid with effective conductivity
|
||||
+ QCoeff/Cpv*he
|
||||
- fvc::laplacian(voidfraction*thCond,T)
|
||||
- fvm::laplacian(voidfraction*thCond/Cpv,he)
|
||||
// + particle-fluid energy transfer due to work
|
||||
// + fluid energy dissipation due to shearing
|
||||
+ fvc::laplacian(voidfraction*thCond/Cpv,he)
|
||||
==
|
||||
// + combustion->Sh()
|
||||
fvOptions(rho, he)
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
PFLAGS+= -Dcompre
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-I../. \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
@ -19,19 +20,13 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
|
||||
|
||||
|
||||
-Wno-deprecated-copy
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
@ -48,9 +43,6 @@ EXE_LIBS = \
|
||||
-l$(CFDEM_LIB_COMP_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS) \
|
||||
-lliquidProperties \
|
||||
-lliquidMixtureProperties \
|
||||
-lthermophysicalFunctions \
|
||||
-lreactionThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
|
||||
@ -13,7 +13,11 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
dQ = combustion->dQ();
|
||||
#else
|
||||
Qdot = combustion->Qdot();
|
||||
#endif
|
||||
label inertIndex = -1;
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
@ -72,4 +76,5 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
particleCloud.clockM().stop("Y");
|
||||
|
||||
@ -30,7 +30,12 @@ Description
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
#include "rhoCombustionModel.H"
|
||||
#else
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#endif
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
@ -52,6 +57,8 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
@ -59,9 +66,10 @@ int main(int argc, char *argv[])
|
||||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// create cfdemCloud
|
||||
#include "readGravitationalAcceleration.H"
|
||||
@ -115,7 +123,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
if (pimple.nCorrPIMPLE() <= 1)
|
||||
#else
|
||||
if (pimple.nCorrPimple() <= 1)
|
||||
#endif
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
@ -1,22 +1,30 @@
|
||||
// thermodynamics, chemistry
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
rhoReactionThermo& thermo = combustion->thermo();
|
||||
#else
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
#endif
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
// read molecular weight
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
volScalarField W(composition.W());
|
||||
#else
|
||||
volScalarField W(thermo.W());
|
||||
#endif
|
||||
|
||||
bool propagateInertSpecie = true;
|
||||
Switch propagateInertSpecie(true);
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -32,9 +40,9 @@
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< "inert will be bounded in [" << inertLowerBound << "," << inertUpperBound << "]" << endl;
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
@ -127,11 +135,12 @@
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
Info<< "\nCreating heat capacity field\n" << endl;
|
||||
@ -197,6 +206,14 @@
|
||||
)
|
||||
);
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR >= 6
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
#endif
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
@ -213,6 +230,7 @@
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
volScalarField dQ
|
||||
(
|
||||
IOobject
|
||||
@ -226,6 +244,21 @@
|
||||
mesh,
|
||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||
);
|
||||
#else
|
||||
volScalarField Qdot
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qdot",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
|
||||
);
|
||||
#endif
|
||||
|
||||
Info<< "\nReading momentum exchange field Ksl\n" << endl;
|
||||
volScalarField Ksl
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
cfdemSolverRhoSimple.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/cfdemSolverRhoSimple
|
||||
3
applications/solvers/rStatAnalysis/Make/files
Normal file
3
applications/solvers/rStatAnalysis/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
rStatAnalysis.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rStatAnalysis
|
||||
27
applications/solvers/rStatAnalysis/Make/options
Normal file
27
applications/solvers/rStatAnalysis/Make/options
Normal file
@ -0,0 +1,27 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
0
applications/solvers/rStatAnalysis/createFields.H
Normal file
0
applications/solvers/rStatAnalysis/createFields.H
Normal file
62
applications/solvers/rStatAnalysis/rStatAnalysis.C
Normal file
62
applications/solvers/rStatAnalysis/rStatAnalysis.C
Normal file
@ -0,0 +1,62 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
||||
|
||||
Contributing authors:
|
||||
Thomas Lichtenegger
|
||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of CFDEMcoupling academic.
|
||||
|
||||
CFDEMcoupling academic 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.
|
||||
|
||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
rStatAnalysis
|
||||
|
||||
Description
|
||||
Creates and analyzes a recurrence statistics
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "recBase.H"
|
||||
#include "recStatAnalysis.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
|
||||
|
||||
recBase recurrenceBase(mesh);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nAnalyzing recurrence statistics\n" << endl;
|
||||
|
||||
recurrenceBase.recStatA().init();
|
||||
recurrenceBase.recStatA().statistics();
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/solvers/rcfdemSolverBase/Make/files
Normal file
3
applications/solvers/rcfdemSolverBase/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
rcfdemSolverBase.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rcfdemSolverBase
|
||||
28
applications/solvers/rcfdemSolverBase/Make/options
Normal file
28
applications/solvers/rcfdemSolverBase/Make/options
Normal file
@ -0,0 +1,28 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
193
applications/solvers/rcfdemSolverBase/createFields.H
Normal file
193
applications/solvers/rcfdemSolverBase/createFields.H
Normal file
@ -0,0 +1,193 @@
|
||||
// dummy fields
|
||||
Info << "\nCreating dummy pressure and density fields\n" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("p", dimensionSet(1, 2, -2, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("rho", dimensionSet(1, -3, 0, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
// recurrence fields
|
||||
Info << "\nCreating recurrence fields.\n" << endl;
|
||||
volVectorField URec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"URec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("URec", dimensionSet(0, 1, -1, 0, 0), vector::zero)
|
||||
);
|
||||
|
||||
Switch updateURec(false);
|
||||
if (URec.headerOk())
|
||||
{
|
||||
updateURec = true;
|
||||
URec.writeOpt() = IOobject::AUTO_WRITE;
|
||||
}
|
||||
|
||||
volScalarField voidfractionRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfractionRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("voidfractionRec", dimensionSet(0, 0, 0, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
Switch updateVoidfractionRec(false);
|
||||
if (voidfractionRec.headerOk())
|
||||
{
|
||||
updateVoidfractionRec = true;
|
||||
voidfractionRec.writeOpt() = IOobject::AUTO_WRITE;
|
||||
}
|
||||
|
||||
volVectorField UsRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"UsRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("URec", dimensionSet(0, 1, -1, 0, 0), vector::zero)
|
||||
);
|
||||
|
||||
Switch updateUsRec(false);
|
||||
if (UsRec.headerOk())
|
||||
{
|
||||
updateUsRec = true;
|
||||
UsRec.writeOpt() = IOobject::AUTO_WRITE;
|
||||
}
|
||||
|
||||
// calculated fields
|
||||
Info << "\nCreating fields subject to calculation\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
voidfractionRec
|
||||
);
|
||||
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
UsRec
|
||||
);
|
||||
|
||||
// write fields for t=t_start
|
||||
voidfraction.write();
|
||||
Us.write();
|
||||
//===============================
|
||||
|
||||
Info << "Calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phiRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phiRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
linearInterpolate(URec*voidfractionRec) & mesh.Sf()
|
||||
);
|
||||
|
||||
Switch updatePhiRec(false);
|
||||
if (phiRec.headerOk())
|
||||
{
|
||||
updatePhiRec = true;
|
||||
phiRec.writeOpt() = IOobject::AUTO_WRITE;
|
||||
phiRec.write();
|
||||
}
|
||||
|
||||
singlePhaseTransportModel laminarTransport(URec, phiRec);
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
|
||||
);
|
||||
|
||||
IOdictionary recDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"recProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
word voidfractionFieldName(recDict.lookupOrDefault<word>("voidfractionFieldName","voidfraction"));
|
||||
word UFieldName(recDict.lookupOrDefault<word>("UFieldName","U"));
|
||||
word UsFieldName(recDict.lookupOrDefault<word>("UsFieldName","Us"));
|
||||
word fluxFieldName(recDict.lookupOrDefault<word>("fluxFieldName","phi"));
|
||||
|
||||
|
||||
// place to put weight functions
|
||||
IOdictionary weightDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"weightDict",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
if (!weightDict.headerOk())
|
||||
{
|
||||
weightDict.add("weights",scalarList(1,1.0));
|
||||
}
|
||||
scalarList weights(weightDict.lookup("weights"));
|
||||
Info << "database initial weights: " << weights << endl;
|
||||
119
applications/solvers/rcfdemSolverBase/rcfdemSolverBase.C
Normal file
119
applications/solvers/rcfdemSolverBase/rcfdemSolverBase.C
Normal file
@ -0,0 +1,119 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
||||
|
||||
Contributing authors:
|
||||
Thomas Lichtenegger, Gerhard Holzinger
|
||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of CFDEMcoupling academic.
|
||||
|
||||
CFDEMcoupling academic 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.
|
||||
|
||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
cfdemSolverRecurrence
|
||||
|
||||
Description
|
||||
Solves a transport equation for a passive scalar on a two-phase solution
|
||||
Test-bed for a solver based on recurrence statistics
|
||||
|
||||
Rules
|
||||
Solution data to compute the recurrence statistics from, needs to
|
||||
reside in $CASE_ROOT/dataBase
|
||||
Time step data in dataBase needs to be evenly spaced in time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
#include "cfdemCloudRec.H"
|
||||
#include "recBase.H"
|
||||
#include "recModel.H"
|
||||
#include "recPath.H"
|
||||
|
||||
#include "cfdemCloud.H"
|
||||
#include "clockModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
cfdemCloudRec<cfdemCloud> particleCloud(mesh);
|
||||
recBase recurrenceBase(mesh);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
|
||||
|
||||
label recTimeIndex = 0;
|
||||
label stepCounter = 0;
|
||||
label recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
runTime++;
|
||||
|
||||
// do stuff (every lagrangian time step)
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info << "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
|
||||
particleCloud.evolve(voidfraction,Us,URec);
|
||||
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
stepCounter++;
|
||||
|
||||
if (stepCounter == recTimeStep2CFDTimeStep)
|
||||
{
|
||||
Info << "updating recurrence fields at time " << runTime.timeName() << "with recTimeIndex = " << recTimeIndex << nl << endl;
|
||||
recurrenceBase.updateRecFields();
|
||||
#include "updateFields.H"
|
||||
recTimeIndex++;
|
||||
stepCounter = 0;
|
||||
recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
}
|
||||
|
||||
particleCloud.clockM().start(27,"Output");
|
||||
runTime.write();
|
||||
particleCloud.clockM().stop("Output");
|
||||
|
||||
particleCloud.clockM().stop("Global");
|
||||
|
||||
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
29
applications/solvers/rcfdemSolverBase/updateFields.H
Normal file
29
applications/solvers/rcfdemSolverBase/updateFields.H
Normal file
@ -0,0 +1,29 @@
|
||||
scalarList wList(weightDict.lookupOrDefault("weights",scalarList(1,1.0)));
|
||||
|
||||
recurrenceBase.recP().updateIntervalWeights(wList);
|
||||
|
||||
if(recurrenceBase.recM().endOfPath())
|
||||
{
|
||||
recurrenceBase.extendPath();
|
||||
}
|
||||
|
||||
// update fields where necessary
|
||||
if (updateVoidfractionRec)
|
||||
{
|
||||
recurrenceBase.recM().exportVolScalarField(voidfractionFieldName,voidfractionRec);
|
||||
}
|
||||
|
||||
if (updateURec)
|
||||
{
|
||||
recurrenceBase.recM().exportVolVectorField(UFieldName,URec);
|
||||
}
|
||||
|
||||
if (updateUsRec)
|
||||
{
|
||||
recurrenceBase.recM().exportVolVectorField(UsFieldName,UsRec);
|
||||
}
|
||||
|
||||
if (updatePhiRec)
|
||||
{
|
||||
recurrenceBase.recM().exportSurfaceScalarField(fluxFieldName,phiRec);
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
rcfdemSolverCoupledHeattransfer.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rcfdemSolverCoupledHeattransfer
|
||||
@ -0,0 +1,28 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
@ -0,0 +1,36 @@
|
||||
volScalarField rhoeps = rhoRec*voidfractionRec;
|
||||
|
||||
particleCloud.energyContributions(Qsource);
|
||||
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
//K = 0.5*magSqr(URec);
|
||||
|
||||
addSource = fvc::div(phiRec/fvc::interpolate(rhoRec), pRec);
|
||||
// main contribution due to gas expansion, not due to transport of kinetic energy
|
||||
// fvc::ddt(rhoeps, K) + fvc::div(phiRec, K)
|
||||
|
||||
// assuming constant Cv such that e = Cv * T
|
||||
fvScalarMatrix TEqn =
|
||||
(
|
||||
fvm::ddt(rhoeps, T)
|
||||
+ fvm::div(phiRec, T)
|
||||
+ addSource/Cv
|
||||
- fvm::laplacian(voidfractionRec*thCond/Cv, T)
|
||||
- Qsource/Cv
|
||||
- fvm::Sp(QCoeff/Cv, T)
|
||||
==
|
||||
fvOptions(rhoeps, T) // no fvOptions support yet
|
||||
);
|
||||
|
||||
fvOptions.constrain(TEqn); // no fvOptions support yet
|
||||
|
||||
TEqn.solve();
|
||||
|
||||
particleCloud.clockM().start(31,"postFlow");
|
||||
counter++;
|
||||
|
||||
if((counter - couplingSubStep) % dtDEM2dtCFD == 0)
|
||||
particleCloud.postFlow();
|
||||
|
||||
particleCloud.clockM().stop("postFlow");
|
||||
@ -0,0 +1,230 @@
|
||||
// dummy fields
|
||||
Info << "\nCreating dummy pressure field\n" << endl;
|
||||
volScalarField pRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-2,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
// recurrence fields
|
||||
Info << "\nCreating recurrence fields.\n" << endl;
|
||||
|
||||
volScalarField rhoRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
volVectorField URec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"URec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimensionSet(0, 1, -1, 0, 0), vector::zero)
|
||||
);
|
||||
|
||||
volScalarField voidfractionRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfractionRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(0,0,0,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volVectorField UsRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"UsRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimensionSet(0, 1, -1, 0, 0), vector::zero)
|
||||
);
|
||||
|
||||
// heat transfer fields
|
||||
Info << "\nCreating heat transfer fields.\n" << endl;
|
||||
|
||||
volScalarField Qsource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qsource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField QCoeff
|
||||
( IOobject
|
||||
(
|
||||
"QCoeff",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
volScalarField thCond
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// calculated fields
|
||||
Info << "\nCreating fields subject to calculation\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
voidfractionRec
|
||||
);
|
||||
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
UsRec
|
||||
);
|
||||
|
||||
// write fields for t=t_start
|
||||
voidfraction.write();
|
||||
Us.write();
|
||||
//===============================
|
||||
|
||||
|
||||
Info << "Calculating face flux field phiRec\n" << endl;
|
||||
surfaceScalarField phiRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phiRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,0,-1,0,0,0,0), 0.0)
|
||||
);
|
||||
phiRec.write();
|
||||
|
||||
|
||||
Info << "Creating dummy turbulence model\n" << endl;
|
||||
singlePhaseTransportModel laminarTransport(URec, phiRec);
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
|
||||
);
|
||||
|
||||
|
||||
const IOdictionary& transportProps = mesh.lookupObject<IOdictionary>("transportProperties");
|
||||
dimensionedScalar molMass(transportProps.lookup("molM"));
|
||||
// need to scale R down with 1e3 because return value of RR in g, not kg
|
||||
dimensionedScalar R("R",dimensionSet(0,2,-2,-1,0,0,0),Foam::constant::thermodynamic::RR / (1e3*molMass.value()));
|
||||
Info << "specific gas constant R = " << R << endl;
|
||||
|
||||
dimensionedScalar Cv(transportProps.lookup("Cv"));
|
||||
|
||||
|
||||
volScalarField addSource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"addSource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
|
||||
// place to put weight functions
|
||||
IOdictionary weightDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"weightDict",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
weightDict.add("weights",scalarList(1,1.0));
|
||||
@ -0,0 +1,135 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
||||
|
||||
Contributing authors:
|
||||
Thomas Lichtenegger
|
||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of CFDEMcoupling academic.
|
||||
|
||||
CFDEMcoupling academic 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.
|
||||
|
||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
rcfdemSolverHeattransfer
|
||||
|
||||
Description
|
||||
Solves heat transfer between fluid and particles based on rCFD
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "fvOptions.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "cfdemCloudRec.H"
|
||||
#include "recBase.H"
|
||||
#include "recModel.H"
|
||||
#include "recPath.H"
|
||||
|
||||
#include "cfdemCloudEnergy.H"
|
||||
#include "clockModel.H"
|
||||
#include "thermCondModel.H"
|
||||
#include "energyModel.H"
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
cfdemCloudRec<cfdemCloudEnergy> particleCloud(mesh);
|
||||
recBase recurrenceBase(mesh);
|
||||
#include "updateFields.H"
|
||||
#include "updateRho.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
|
||||
|
||||
label recTimeIndex = 0;
|
||||
label stepCounter = 0;
|
||||
label recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
|
||||
// control coupling behavior in case of substepping
|
||||
// assumes constant timestep size
|
||||
label counter = 0;
|
||||
label couplingSubStep = recurrenceBase.couplingSubStep();
|
||||
double dtProp = particleCloud.dataExchangeM().couplingTime() / runTime.deltaTValue();
|
||||
label dtDEM2dtCFD = int(dtProp + 0.5);
|
||||
Info << "deltaT_DEM / deltaT_CFD = " << dtDEM2dtCFD << endl;
|
||||
if (dtDEM2dtCFD > 1)
|
||||
Info << "coupling at substep " << couplingSubStep << endl;
|
||||
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
runTime++;
|
||||
|
||||
// do stuff (every lagrangian time step)
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info << "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
|
||||
particleCloud.evolve(voidfraction,Us,URec);
|
||||
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
#include "updateRho.H"
|
||||
#include "TEqImp.H"
|
||||
particleCloud.clockM().stop("Flow");
|
||||
|
||||
stepCounter++;
|
||||
|
||||
particleCloud.clockM().start(32,"ReadFields");
|
||||
if (stepCounter == recTimeStep2CFDTimeStep)
|
||||
{
|
||||
recurrenceBase.updateRecFields();
|
||||
#include "updateFields.H"
|
||||
recTimeIndex++;
|
||||
stepCounter = 0;
|
||||
recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
}
|
||||
particleCloud.clockM().stop("ReadFields");
|
||||
|
||||
particleCloud.clockM().start(33,"Output");
|
||||
runTime.write();
|
||||
particleCloud.clockM().stop("Output");
|
||||
|
||||
particleCloud.clockM().stop("Global");
|
||||
|
||||
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,38 @@
|
||||
// get current weights for various databases
|
||||
|
||||
// A: triggered over current value of boundary field
|
||||
// word boundaryName = "inlet";
|
||||
// label myinlet = mesh.boundary().findPatchID(boundaryName);
|
||||
// label startIndex = mesh.boundary()[boundaryName].start();
|
||||
|
||||
// B: explicitly define weights
|
||||
|
||||
scalarList wList(weightDict.lookupOrDefault("weights",scalarList(1,0.0)));
|
||||
|
||||
recurrenceBase.recP().updateIntervalWeights(wList);
|
||||
|
||||
// is it neccessary to extend recurrence path?
|
||||
if(recurrenceBase.recM().endOfPath())
|
||||
{
|
||||
recurrenceBase.extendPath();
|
||||
}
|
||||
|
||||
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
|
||||
recurrenceBase.recM().exportVolScalarField("p",pRec);
|
||||
recurrenceBase.recM().exportVolVectorField("Us",UsRec);
|
||||
recurrenceBase.recM().exportSurfaceScalarField("phi",phiRec);
|
||||
|
||||
Info << "current database weights: = " << wList << endl;
|
||||
Info << "current database: " << recurrenceBase.recM().currDataBase() << endl;
|
||||
for(int i=0;i<wList.size();i++)
|
||||
{
|
||||
scalar w = wList[i];
|
||||
if (recurrenceBase.recM().currDataBase() == i) w -= 1.0;
|
||||
phiRec += w*recurrenceBase.recM().exportSurfaceScalarFieldAve("phi",i)();
|
||||
}
|
||||
|
||||
{
|
||||
volScalarField& NuField(const_cast<volScalarField&>(mesh.lookupObject<volScalarField> ("NuField")));
|
||||
recurrenceBase.recM().exportVolScalarField("NuField",NuField);
|
||||
}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
rhoRec = pRec / (T * R);
|
||||
@ -0,0 +1,3 @@
|
||||
rcfdemSolverForcedTracers.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rcfdemSolverForcedTracers
|
||||
27
applications/solvers/rcfdemSolverForcedTracers/Make/options
Normal file
27
applications/solvers/rcfdemSolverForcedTracers/Make/options
Normal file
@ -0,0 +1,27 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
113
applications/solvers/rcfdemSolverForcedTracers/createFields.H
Normal file
113
applications/solvers/rcfdemSolverForcedTracers/createFields.H
Normal file
@ -0,0 +1,113 @@
|
||||
// dummy fields
|
||||
Info << "\nCreating dummy density field\n" << endl;
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("rho", dimensionSet(1, -3, 0, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
// particle fields
|
||||
Info << "\nCreating voidfraction and particle velocity fields\n" << endl;
|
||||
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// recurrence fields
|
||||
Info << "\nCreating recurrence fields.\n" << endl;
|
||||
|
||||
volScalarField pRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("p", dimensionSet(1, 2, -2, 0, 0), 1.0)
|
||||
);
|
||||
|
||||
volScalarField kRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"kRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("k", dimensionSet(0, 2, -2, 0, 0), 0.0)
|
||||
);
|
||||
|
||||
volVectorField URec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"URec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
//===============================
|
||||
|
||||
Info << "Calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phiRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phiRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(URec*voidfraction) & mesh.Sf()
|
||||
);
|
||||
phiRec.write();
|
||||
|
||||
singlePhaseTransportModel laminarTransport(URec, phiRec);
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
|
||||
);
|
||||
@ -0,0 +1,114 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
||||
|
||||
Contributing authors:
|
||||
Thomas Lichtenegger
|
||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of CFDEMcoupling academic.
|
||||
|
||||
CFDEMcoupling academic 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.
|
||||
|
||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
rcfdemSolverForcedTracers
|
||||
|
||||
Description
|
||||
Moves tracers according to the activated force models on pressure and velocity
|
||||
fields provided by a recurrence process
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
#include "recBase.H"
|
||||
#include "recModel.H"
|
||||
|
||||
#include "cfdemCloud.H"
|
||||
#include "clockModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
|
||||
cfdemCloud particleCloud(mesh);
|
||||
recBase recurrenceBase(mesh);
|
||||
|
||||
const IOdictionary& recProps = mesh.lookupObject<IOdictionary>("recProperties");
|
||||
bool useRecP(recProps.lookupOrDefault<bool>("useRecP",false));
|
||||
bool useRecK(recProps.lookupOrDefault<bool>("useRecK",false));
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
|
||||
|
||||
label recTimeIndex = 0;
|
||||
label stepCounter = 0;
|
||||
label recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
runTime++;
|
||||
|
||||
// do stuff (every lagrangian time step)
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info << "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
|
||||
particleCloud.evolve(voidfraction,Us,URec);
|
||||
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
stepCounter++;
|
||||
|
||||
if (stepCounter == recTimeStep2CFDTimeStep)
|
||||
{
|
||||
recurrenceBase.updateRecFields();
|
||||
#include "updateFields.H"
|
||||
recTimeIndex++;
|
||||
stepCounter = 0;
|
||||
recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
}
|
||||
|
||||
particleCloud.clockM().start(27,"Output");
|
||||
runTime.write();
|
||||
particleCloud.clockM().stop("Output");
|
||||
|
||||
particleCloud.clockM().stop("Global");
|
||||
|
||||
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,13 @@
|
||||
recurrenceBase.recM().exportVolVectorField("U",URec);
|
||||
|
||||
if (useRecP)
|
||||
{
|
||||
recurrenceBase.recM().exportVolScalarField("p",pRec);
|
||||
}
|
||||
|
||||
if (useRecK)
|
||||
{
|
||||
recurrenceBase.recM().exportVolScalarField("k",kRec);
|
||||
// in case database contains the velocity variance instead of k, do
|
||||
// kRec *= 0.5;
|
||||
}
|
||||
@ -6,9 +6,6 @@
|
||||
particleCloud.energyContributions(Qsource);
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
//thDiff=particleCloud.thermCondM().thermDiff();
|
||||
thCond=particleCloud.thermCondM().thermCond();
|
||||
|
||||
addSource =
|
||||
(
|
||||
he.name() == "e"
|
||||
@ -16,7 +13,7 @@
|
||||
fvc::div(phi, K) +
|
||||
fvc::div
|
||||
(
|
||||
fvc::absolute(phi/fvc::interpolate(rho), voidfraction*U),
|
||||
fvc::absolute(phi/fvc::interpolate(rho), voidfractionRec*U),
|
||||
p,
|
||||
"div(phiv,p)"
|
||||
)
|
||||
@ -25,21 +22,32 @@
|
||||
|
||||
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
|
||||
|
||||
// correct source for the thermodynamic reference temperature
|
||||
dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL));
|
||||
Qsource += QCoeff*Tref;
|
||||
// For implict T terms in the energy/enthalpy transport equation, use
|
||||
// (he_n+1 - he_n) / (T_n+1 - T_n) = Cpv to eliminate T_n+1 with he_n+1.
|
||||
// This formula is valid for ideal gases with e=e(T) and h=h(T). For
|
||||
// incompressible fluids, e=e(T) holds, too, but enthalpy would need correction
|
||||
// terms accounting for pressure variations.
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::div(phi, he)
|
||||
+ addSource
|
||||
- Qsource
|
||||
- QCoeff*T
|
||||
- fvm::Sp(QCoeff/Cpv, he)
|
||||
- fvm::laplacian(voidfraction*thCond/Cpv,he)
|
||||
+ QCoeff/Cpv*he
|
||||
- fvc::laplacian(voidfractionRec*thCond,T)
|
||||
- fvm::laplacian(voidfractionRec*thCond/Cpv,he)
|
||||
+ fvc::laplacian(voidfractionRec*thCond/Cpv,he)
|
||||
==
|
||||
fvOptions(rho, he)
|
||||
);
|
||||
|
||||
if (transientEEqn)
|
||||
{
|
||||
EEqn += fvm::ddt(rho,voidfractionRec,he);
|
||||
}
|
||||
|
||||
|
||||
EEqn.relax();
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
rcfdemSolverRhoSteadyPimple.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rcfdemSolverRhoSteadyPimple
|
||||
@ -1,5 +1,7 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
PFLAGS+= -Dcompre
|
||||
|
||||
EXE_INC = \
|
||||
@ -15,9 +17,12 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-Wno-deprecated-copy
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
@ -4,7 +4,7 @@ particleCloud.otherForces(fOther);
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ particleCloud.divVoidfractionTau(U, voidfraction)
|
||||
+ particleCloud.divVoidfractionTau(U, voidfractionRec)
|
||||
+ fvm::Sp(Ksl,U)
|
||||
- fOther
|
||||
==
|
||||
@ -18,13 +18,16 @@ fvOptions.constrain(UEqn);
|
||||
|
||||
if (modelType=="B" || modelType=="Bfull")
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p)+ Ksl*Us);
|
||||
solve(UEqn == -fvc::grad(p)+ Ksl*UsRec);
|
||||
}
|
||||
else
|
||||
{
|
||||
solve(UEqn == -voidfraction*fvc::grad(p)+ Ksl*Us);
|
||||
solve(UEqn == -voidfractionRec*fvc::grad(p)+ Ksl*UsRec);
|
||||
}
|
||||
|
||||
//U.relax();
|
||||
#include "limitU.H"
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
@ -51,6 +51,19 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField voidfractionRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfractionRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
voidfraction
|
||||
);
|
||||
|
||||
volScalarField addSource
|
||||
(
|
||||
IOobject
|
||||
@ -58,10 +71,11 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
"addSource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
|
||||
@ -102,11 +116,12 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
Info<< "\nCreating heat capacity field\n" << endl;
|
||||
@ -153,12 +168,14 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
linearInterpolate(rho*U*voidfraction) & mesh.Sf()
|
||||
);
|
||||
|
||||
Switch transientEEqn(pimple.dict().lookupOrDefault<bool>("transientEEqn",false));
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
simple.dict(),
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
@ -169,12 +186,45 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
simple.dict(),
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar pMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"pMax",
|
||||
pimple.dict(),
|
||||
dimPressure,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"pMin",
|
||||
pimple.dict(),
|
||||
dimPressure,
|
||||
-GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar UMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"UMax",
|
||||
pimple.dict(),
|
||||
dimVelocity,
|
||||
-1.0
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
@ -189,7 +239,7 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
@ -217,11 +267,11 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
"Ksl",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
//dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0)
|
||||
mesh,
|
||||
dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 0.0)
|
||||
);
|
||||
|
||||
|
||||
@ -239,4 +289,20 @@ Info<< "Reading thermophysical properties\n" << endl;
|
||||
mesh
|
||||
);
|
||||
|
||||
volVectorField UsRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"UsRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
Us
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar kf("0", dimensionSet(1, 1, -3, -1, 0, 0, 0), 0.026);
|
||||
|
||||
//===============================
|
||||
@ -0,0 +1,2 @@
|
||||
p = max(p, pMin);
|
||||
p = min(p, pMax);
|
||||
11
applications/solvers/rcfdemSolverRhoSteadyPimple/limitU.H
Normal file
11
applications/solvers/rcfdemSolverRhoSteadyPimple/limitU.H
Normal file
@ -0,0 +1,11 @@
|
||||
if (UMax.value() > 0)
|
||||
{
|
||||
forAll(U,cellI)
|
||||
{
|
||||
scalar mU(mag(U[cellI]));
|
||||
if (mU > UMax.value())
|
||||
{
|
||||
U[cellI] *= UMax.value() / mU;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,14 +7,15 @@ volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rhoeps*rAU));
|
||||
if (modelType=="A")
|
||||
{
|
||||
rhorAUf *= fvc::interpolate(voidfraction);
|
||||
rhorAUf *= fvc::interpolate(voidfractionRec);
|
||||
}
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
//tUEqn.clear();
|
||||
|
||||
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*Us)& mesh.Sf());
|
||||
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*UsRec)& mesh.Sf());
|
||||
|
||||
|
||||
if (simple.transonic())
|
||||
if (pimple.transonic())
|
||||
{
|
||||
// transonic version not implemented yet
|
||||
}
|
||||
@ -34,7 +35,7 @@ else
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rhoeps, U, phi, rhorAUf);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Pressure corrector
|
||||
fvScalarMatrix pEqn
|
||||
@ -49,7 +50,7 @@ else
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
@ -59,6 +60,8 @@ else
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
#include "limitP.H"
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
@ -69,13 +72,15 @@ Info<< "rho max/min : " << max(rho).value()
|
||||
|
||||
if (modelType=="A")
|
||||
{
|
||||
U = HbyA - rAU*(voidfraction*fvc::grad(p)-Ksl*Us);
|
||||
U = HbyA - rAU*(voidfractionRec*fvc::grad(p)-Ksl*UsRec);
|
||||
}
|
||||
else
|
||||
{
|
||||
U = HbyA - rAU*(fvc::grad(p)-Ksl*Us);
|
||||
U = HbyA - rAU*(fvc::grad(p)-Ksl*UsRec);
|
||||
}
|
||||
|
||||
#include "limitU.H"
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
@ -0,0 +1,205 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
|
||||
This 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.
|
||||
|
||||
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
|
||||
|
||||
Application
|
||||
rcfdemSolverRhoSteadyPimple
|
||||
|
||||
Description
|
||||
Transient (DEM) + steady-state (CFD) solver for compressible flow using the
|
||||
flexible PIMPLE (PISO-SIMPLE) algorithm. Particle-motion is obtained from
|
||||
a recurrence process.
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
The code is an evolution of the solver rhoPimpleFoam in OpenFOAM(R) 4.x,
|
||||
where additional functionality for CFD-DEM coupling is added.
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
#include "cfdemCloudRec.H"
|
||||
#include "recBase.H"
|
||||
#include "recModel.H"
|
||||
#include "recPath.H"
|
||||
|
||||
#include "cfdemCloudEnergy.H"
|
||||
#include "implicitCouple.H"
|
||||
#include "clockModel.H"
|
||||
#include "smoothingModel.H"
|
||||
#include "forceModel.H"
|
||||
#include "thermCondModel.H"
|
||||
#include "energyModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// create cfdemCloud
|
||||
//#include "readGravitationalAcceleration.H"
|
||||
cfdemCloudRec<cfdemCloudEnergy> particleCloud(mesh);
|
||||
#include "checkModelType.H"
|
||||
recBase recurrenceBase(mesh);
|
||||
#include "updateFields.H"
|
||||
|
||||
turbulence->validate();
|
||||
//#include "compressibleCourantNo.H"
|
||||
//#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
label recTimeIndex = 0;
|
||||
label stepCounter = 0;
|
||||
label recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
|
||||
const IOdictionary& couplingProps = particleCloud.couplingProperties();
|
||||
label nEveryFlow(couplingProps.lookupOrDefault<label>("nEveryFlow",1));
|
||||
Info << "Solving flow equations every " << nEveryFlow << " steps.\n" << endl;
|
||||
label totalStepCounter = 0;
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// do particle stuff
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
|
||||
|
||||
//voidfraction = voidfractionRec;
|
||||
//Us = UsRec;
|
||||
|
||||
if(hasEvolved)
|
||||
{
|
||||
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
|
||||
}
|
||||
|
||||
Info << "update Ksl.internalField()" << endl;
|
||||
Ksl = particleCloud.momCoupleM(0).impMomSource();
|
||||
Ksl.correctBoundaryConditions();
|
||||
|
||||
//Force Checks
|
||||
vector fTotal(0,0,0);
|
||||
vector fImpTotal = sum(mesh.V()*Ksl.primitiveFieldRef()*(Us.primitiveFieldRef()-U.primitiveFieldRef()));
|
||||
reduce(fImpTotal, sumOp<vector>());
|
||||
Info << "TotalForceExp: " << fTotal << endl;
|
||||
Info << "TotalForceImp: " << fImpTotal << endl;
|
||||
|
||||
#include "solverDebugInfo.H"
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
volScalarField rhoeps("rhoeps",rho*voidfractionRec);
|
||||
if (totalStepCounter%nEveryFlow==0)
|
||||
{
|
||||
while (pimple.loop())
|
||||
{
|
||||
// if needed, perform drag update here
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
if (pimple.nCorrPIMPLE() <= 1)
|
||||
#else
|
||||
if (pimple.nCorrPimple() <= 1)
|
||||
#endif
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
// besides this pEqn, OF offers a "pimple consistent"-option
|
||||
#include "pEqn.H"
|
||||
rhoeps=rho*voidfractionRec;
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
}
|
||||
totalStepCounter++;
|
||||
particleCloud.clockM().stop("Flow");
|
||||
|
||||
particleCloud.clockM().start(31,"postFlow");
|
||||
particleCloud.postFlow();
|
||||
particleCloud.clockM().stop("postFlow");
|
||||
|
||||
particleCloud.clockM().start(32,"ReadFields");
|
||||
|
||||
stepCounter++;
|
||||
|
||||
if (stepCounter == recTimeStep2CFDTimeStep)
|
||||
{
|
||||
recurrenceBase.updateRecFields();
|
||||
#include "updateFields.H"
|
||||
recTimeIndex++;
|
||||
stepCounter = 0;
|
||||
recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
}
|
||||
particleCloud.clockM().stop("ReadFields");
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
|
||||
particleCloud.clockM().stop("Global");
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,8 @@
|
||||
// is it neccessary to extend recurrence path?
|
||||
if(recurrenceBase.recM().endOfPath())
|
||||
{
|
||||
recurrenceBase.extendPath();
|
||||
}
|
||||
|
||||
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
|
||||
recurrenceBase.recM().exportVolVectorField("Us",UsRec);
|
||||
67
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/EEqn.H
Normal file
67
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/EEqn.H
Normal file
@ -0,0 +1,67 @@
|
||||
// contributions to internal energy equation can be found in
|
||||
// Crowe et al.: "Multiphase flows with droplets and particles", CRC Press 1998
|
||||
{
|
||||
// dim he = J / kg
|
||||
volScalarField& he = thermo.he();
|
||||
particleCloud.energyContributions(Qsource);
|
||||
particleCloud.energyCoefficients(QCoeff);
|
||||
|
||||
addSource =
|
||||
(
|
||||
he.name() == "e"
|
||||
?
|
||||
fvc::div(phi, K) +
|
||||
fvc::div
|
||||
(
|
||||
fvc::absolute(phi/fvc::interpolate(rho), voidfractionRec*U),
|
||||
p,
|
||||
"div(phiv,p)"
|
||||
)
|
||||
: fvc::div(phi, K)
|
||||
);
|
||||
|
||||
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
|
||||
|
||||
// For implict T terms in the energy/enthalpy transport equation, use
|
||||
// (he_n+1 - he_n) / (T_n+1 - T_n) = Cpv to eliminate T_n+1 with he_n+1.
|
||||
// This formula is valid for ideal gases with e=e(T) and h=h(T). For
|
||||
// incompressible fluids, e=e(T) holds, too, but enthalpy would need correction
|
||||
// terms accounting for pressure variations.
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::div(phi, he)
|
||||
+ addSource
|
||||
- Qsource
|
||||
- QCoeff*T
|
||||
- fvm::Sp(QCoeff/Cpv, he)
|
||||
+ QCoeff/Cpv*he
|
||||
- fvc::laplacian(voidfractionRec*thCond,T)
|
||||
- fvm::laplacian(voidfractionRec*thCond/Cpv,he)
|
||||
+ fvc::laplacian(voidfractionRec*thCond/Cpv,he)
|
||||
==
|
||||
fvOptions(rho, he)
|
||||
);
|
||||
|
||||
if (transientEEqn)
|
||||
{
|
||||
EEqn += fvm::ddt(rho,voidfractionRec,he);
|
||||
}
|
||||
|
||||
EEqn.relax();
|
||||
|
||||
fvOptions.constrain(EEqn);
|
||||
|
||||
EEqn.solve();
|
||||
|
||||
fvOptions.correct(he);
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl;
|
||||
|
||||
|
||||
particleCloud.clockM().start(31,"energySolve");
|
||||
particleCloud.solve();
|
||||
particleCloud.clockM().stop("energySolve");
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
rcfdemSolverRhoSteadyPimpleChem.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rcfdemSolverRhoSteadyPimpleChem
|
||||
@ -0,0 +1,52 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
|
||||
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
|
||||
PFLAGS+= -Dcompre
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lfvOptions \
|
||||
-l$(CFDEM_LIB_COMP_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS) \
|
||||
-lreactionThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lODE \
|
||||
-lcombustionModels
|
||||
35
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/UEqn.H
Normal file
35
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/UEqn.H
Normal file
@ -0,0 +1,35 @@
|
||||
// Solve the Momentum equation
|
||||
particleCloud.otherForces(fOther);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ particleCloud.divVoidfractionTau(U, voidfractionRec)
|
||||
+ fvm::Sp(Ksl,U)
|
||||
- fOther
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
if (totalStepCounter%nEveryFlow==0)
|
||||
{
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (modelType=="B" || modelType=="Bfull")
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p)+ Ksl*UsRec);
|
||||
}
|
||||
else
|
||||
{
|
||||
solve(UEqn == -voidfractionRec*fvc::grad(p)+ Ksl*UsRec);
|
||||
}
|
||||
|
||||
|
||||
#include "limitU.H"
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
81
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/YEqn.H
Normal file
81
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/YEqn.H
Normal file
@ -0,0 +1,81 @@
|
||||
particleCloud.clockM().start(29,"Y");
|
||||
|
||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
dQ = combustion->dQ();
|
||||
#else
|
||||
Qdot = combustion->Qdot();
|
||||
#endif
|
||||
label inertIndex = -1;
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (Y[i].name() == inertSpecie) inertIndex = i;
|
||||
if (Y[i].name() != inertSpecie || propagateInertSpecie)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
fvScalarMatrix YiEqn
|
||||
(
|
||||
mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(voidfractionRec*turbulence->muEff(), Yi)
|
||||
==
|
||||
combustion->R(Yi)
|
||||
+ particleCloud.chemistryM(0).Smi(i)*p/p.prevIter()
|
||||
+ fvOptions(rho, Yi)
|
||||
);
|
||||
|
||||
YiEqn.relax();
|
||||
|
||||
fvOptions.constrain(YiEqn);
|
||||
|
||||
YiEqn.solve(mesh.solver("Yi"));
|
||||
|
||||
Yi.relax();
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
if (Y[i].name() != inertSpecie) Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
if (inertIndex!=-1)
|
||||
{
|
||||
Y[inertIndex].max(inertLowerBound);
|
||||
Y[inertIndex].min(inertUpperBound);
|
||||
}
|
||||
|
||||
if (propagateInertSpecie)
|
||||
{
|
||||
if (inertIndex!=-1) Yt /= (1-Y[inertIndex] + ROOTVSMALL);
|
||||
forAll(Y,i)
|
||||
{
|
||||
if (i!=inertIndex)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
Yi = Yi/(Yt+ROOTVSMALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
particleCloud.clockM().stop("Y");
|
||||
@ -0,0 +1,2 @@
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
@ -0,0 +1,420 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
rhoReactionThermo& thermo = combustion->thermo();
|
||||
#else
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
#endif
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
// read molecular weight
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
volScalarField W(composition.W());
|
||||
#else
|
||||
volScalarField W(thermo.W());
|
||||
#endif
|
||||
|
||||
Switch propagateInertSpecie(thermo.lookupOrDefault<bool>("propagateInertSpecie",true));
|
||||
|
||||
const word inertSpecie(thermo.lookupOrDefault<word>("inertSpecie","none"));
|
||||
|
||||
const scalar inertLowerBound(thermo.lookupOrDefault<scalar>("inertLowerBound",0.0));
|
||||
|
||||
const scalar inertUpperBound(thermo.lookupOrDefault<scalar>("inertUpperBound",1.0));
|
||||
|
||||
if (!composition.contains(inertSpecie) && inertSpecie != "none")
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||
<< "species list. Available species:" << composition.species()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< "inert will be bounded in [" << inertLowerBound << "," << inertUpperBound << "]" << endl;
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(thermo.he());
|
||||
|
||||
Info<< "Reading field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
|
||||
volScalarField voidfraction
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfraction",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField voidfractionRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"voidfractionRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
voidfraction
|
||||
);
|
||||
|
||||
volScalarField addSource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"addSource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
|
||||
volScalarField Qsource
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qsource",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating fluid-particle heat flux coefficient field\n" << endl;
|
||||
volScalarField QCoeff
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"QCoeff",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating fluid thermal conduction field\n" << endl;
|
||||
volScalarField QFluidCond
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"QFluidCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
|
||||
Info<< "\nCreating thermal conductivity field\n" << endl;
|
||||
volScalarField thCond
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thCond",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
Info<< "\nCreating heat capacity field\n" << endl;
|
||||
volScalarField Cpv
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Cpv",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(0,2,-2,-1,0,0,0), 0.0)
|
||||
);
|
||||
|
||||
Info<< "\nCreating body force field\n" << endl;
|
||||
volVectorField fOther
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fOther",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
|
||||
);
|
||||
|
||||
Info<< "Reading/calculating face flux field phi\n" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(rho*U*voidfraction) & mesh.Sf()
|
||||
);
|
||||
|
||||
Switch transientEEqn(pimple.dict().lookupOrDefault<bool>("transientEEqn",false));
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar pMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"pMax",
|
||||
pimple.dict(),
|
||||
dimPressure,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"pMin",
|
||||
pimple.dict(),
|
||||
dimPressure,
|
||||
-GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar UMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"UMax",
|
||||
pimple.dict(),
|
||||
dimVelocity,
|
||||
-1.0
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR >= 6
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
#endif
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
#if OPENFOAM_VERSION_MAJOR < 5
|
||||
volScalarField dQ
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dQ",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||
);
|
||||
#else
|
||||
volScalarField Qdot
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qdot",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
|
||||
);
|
||||
#endif
|
||||
|
||||
Info<< "\nReading momentum exchange field Ksl\n" << endl;
|
||||
volScalarField Ksl
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Ksl",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 0.0)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading particle velocity field Us\n" << endl;
|
||||
volVectorField Us
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField molarConc
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"molarConc",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero",dimensionSet(0, -3, 0, 0, 1),0)
|
||||
);
|
||||
|
||||
volVectorField UsRec
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"UsRec",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
Us
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar kf("0", dimensionSet(1, 1, -3, -1, 0, 0, 0), 0.026);
|
||||
|
||||
//===============================
|
||||
@ -0,0 +1,2 @@
|
||||
p = max(p, pMin);
|
||||
p = min(p, pMax);
|
||||
@ -0,0 +1,11 @@
|
||||
if (UMax.value() > 0)
|
||||
{
|
||||
forAll(U,cellI)
|
||||
{
|
||||
scalar mU(mag(U[cellI]));
|
||||
if (mU > UMax.value())
|
||||
{
|
||||
U[cellI] *= UMax.value() / mU;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
molarConc = 0.0 * molarConc;
|
||||
forAll(Y, i)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
dimensionedScalar mi("mi",dimensionSet(1, 0, 0, 0, -1),composition.W(i));
|
||||
mi /= 1000.0; // g to kg
|
||||
molarConc += rho * Yi / mi;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
m=gSum(rhoeps*1.0*rhoeps.mesh().V());
|
||||
if(counter==0) m0=m;
|
||||
counter++;
|
||||
Info << "\ncurrent gas mass = " << m << "\n" << endl;
|
||||
Info << "\ncurrent added gas mass = " << m-m0 << "\n" << endl;
|
||||
|
||||
QFluidCond = fvc::laplacian(voidfractionRec*thCond,T);
|
||||
}
|
||||
96
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/pEqn.H
Normal file
96
applications/solvers/rcfdemSolverRhoSteadyPimpleChem/pEqn.H
Normal file
@ -0,0 +1,96 @@
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
if (totalStepCounter%nEveryFlow==0)
|
||||
{
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rhoeps*rAU));
|
||||
if (modelType=="A")
|
||||
{
|
||||
rhorAUf *= fvc::interpolate(voidfractionRec);
|
||||
}
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*UsRec)& mesh.Sf());
|
||||
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
// transonic version not implemented yet
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rhoeps*HbyA)
|
||||
)
|
||||
);
|
||||
|
||||
// flux without pressure gradient contribution
|
||||
phi = phiHbyA + phiUs;
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rhoeps, U, phi, rhorAUf);
|
||||
|
||||
volScalarField SmbyP(particleCloud.chemistryM(0).Sm() / p);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Pressure corrector
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::div(phi)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvm::Sp(SmbyP, p)
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrsPU.H"
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
#include "limitP.H"
|
||||
|
||||
// Recalculate density from the relaxed pressure
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
Info<< "rho max/min : " << max(rho).value()
|
||||
<< " " << min(rho).value() << endl;
|
||||
|
||||
if (modelType=="A")
|
||||
{
|
||||
U = HbyA - rAU*(voidfractionRec*fvc::grad(p)-Ksl*UsRec);
|
||||
}
|
||||
else
|
||||
{
|
||||
U = HbyA - rAU*(fvc::grad(p)-Ksl*UsRec);
|
||||
}
|
||||
|
||||
#include "limitU.H"
|
||||
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
}
|
||||
@ -0,0 +1,222 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
|
||||
This 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.
|
||||
|
||||
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
|
||||
|
||||
Application
|
||||
rcfdemSolverRhoSteadyPimpleChem
|
||||
|
||||
Description
|
||||
Transient (DEM) + steady-state (CFD) solver for compressible flow using the
|
||||
flexible PIMPLE (PISO-SIMPLE) algorithm. Particle-motion is obtained from
|
||||
a recurrence process.
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
The code is an evolution of the solver rhoPimpleFoam in OpenFOAM(R) 4.x,
|
||||
where additional functionality for CFD-DEM coupling is added.
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
//#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
#include "rhoCombustionModel.H"
|
||||
#else
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#endif
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
#include "cfdemCloudRec.H"
|
||||
#include "recBase.H"
|
||||
#include "recModel.H"
|
||||
#include "recPath.H"
|
||||
|
||||
#include "cfdemCloudEnergy.H"
|
||||
#include "implicitCouple.H"
|
||||
#include "clockModel.H"
|
||||
#include "smoothingModel.H"
|
||||
#include "forceModel.H"
|
||||
#include "thermCondModel.H"
|
||||
#include "energyModel.H"
|
||||
#include "chemistryModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// create cfdemCloud
|
||||
//#include "readGravitationalAcceleration.H"
|
||||
cfdemCloudRec<cfdemCloudEnergy> particleCloud(mesh);
|
||||
#include "checkModelType.H"
|
||||
recBase recurrenceBase(mesh);
|
||||
#include "updateFields.H"
|
||||
|
||||
turbulence->validate();
|
||||
//#include "compressibleCourantNo.H"
|
||||
//#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
label recTimeIndex = 0;
|
||||
label stepCounter = 0;
|
||||
label recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
|
||||
const IOdictionary& couplingProps = particleCloud.couplingProperties();
|
||||
label nEveryFlow(couplingProps.lookupOrDefault<label>("nEveryFlow",1));
|
||||
Info << "Solving flow equations for U and p every " << nEveryFlow << " steps.\n" << endl;
|
||||
label totalStepCounter = 0;
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
scalar m(0.0);
|
||||
scalar m0(0.0);
|
||||
label counter(0);
|
||||
p.storePrevIter();
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
|
||||
particleCloud.clockM().start(1,"Global");
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// do particle stuff
|
||||
particleCloud.clockM().start(2,"Coupling");
|
||||
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
|
||||
|
||||
//voidfraction = voidfractionRec;
|
||||
//Us = UsRec;
|
||||
|
||||
if(hasEvolved)
|
||||
{
|
||||
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
|
||||
}
|
||||
|
||||
Info << "update Ksl.internalField()" << endl;
|
||||
Ksl = particleCloud.momCoupleM(0).impMomSource();
|
||||
Ksl.correctBoundaryConditions();
|
||||
|
||||
//Force Checks
|
||||
vector fTotal(0,0,0);
|
||||
vector fImpTotal = sum(mesh.V()*Ksl.primitiveFieldRef()*(Us.primitiveFieldRef()-U.primitiveFieldRef()));
|
||||
reduce(fImpTotal, sumOp<vector>());
|
||||
Info << "TotalForceExp: " << fTotal << endl;
|
||||
Info << "TotalForceImp: " << fImpTotal << endl;
|
||||
|
||||
#include "solverDebugInfo.H"
|
||||
particleCloud.clockM().stop("Coupling");
|
||||
|
||||
particleCloud.clockM().start(26,"Flow");
|
||||
volScalarField rhoeps("rhoeps",rho*voidfractionRec);
|
||||
|
||||
while (pimple.loop())
|
||||
{
|
||||
// if needed, perform drag update here
|
||||
#if OPENFOAM_VERSION_MAJOR < 6
|
||||
if (pimple.nCorrPIMPLE() <= 1)
|
||||
#else
|
||||
if (pimple.nCorrPimple() <= 1)
|
||||
#endif
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
// besides this pEqn, OF offers a "pimple consistent"-option
|
||||
#include "molConc.H"
|
||||
#include "pEqn.H"
|
||||
rhoeps=rho*voidfractionRec;
|
||||
}
|
||||
#include "YEqn.H"
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
#include "monitorMass.H"
|
||||
|
||||
totalStepCounter++;
|
||||
particleCloud.clockM().stop("Flow");
|
||||
|
||||
particleCloud.clockM().start(31,"postFlow");
|
||||
particleCloud.postFlow();
|
||||
particleCloud.clockM().stop("postFlow");
|
||||
|
||||
particleCloud.clockM().start(32,"ReadFields");
|
||||
stepCounter++;
|
||||
|
||||
if (stepCounter == recTimeStep2CFDTimeStep)
|
||||
{
|
||||
recurrenceBase.updateRecFields();
|
||||
#include "updateFields.H"
|
||||
recTimeIndex++;
|
||||
stepCounter = 0;
|
||||
recTimeStep2CFDTimeStep = recurrenceBase.recM().recTimeStep2CFDTimeStep();
|
||||
}
|
||||
particleCloud.clockM().stop("ReadFields");
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
|
||||
particleCloud.clockM().stop("Global");
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,21 @@
|
||||
{
|
||||
/*
|
||||
fvScalarMatrix rhoEqn
|
||||
(
|
||||
//fvm::ddt(voidfraction,rho)
|
||||
//+
|
||||
fvc::div(phi)
|
||||
==
|
||||
particleCloud.chemistryM(0).Sm()
|
||||
+ fvOptions(rho)
|
||||
);
|
||||
|
||||
fvOptions.constrain(rhoEqn);
|
||||
|
||||
rhoEqn.solve();
|
||||
|
||||
fvOptions.correct(rho);
|
||||
*/
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,8 @@
|
||||
// is it neccessary to extend recurrence path?
|
||||
if(recurrenceBase.recM().endOfPath())
|
||||
{
|
||||
recurrenceBase.extendPath();
|
||||
}
|
||||
|
||||
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
|
||||
recurrenceBase.recM().exportVolVectorField("Us",UsRec);
|
||||
19
applications/solvers/rctfSpeciesTransport/CEq.H
Executable file
19
applications/solvers/rctfSpeciesTransport/CEq.H
Executable file
@ -0,0 +1,19 @@
|
||||
|
||||
volScalarField alphaEff("alphaEff", turbulence->nu()/Sc + alphat);
|
||||
|
||||
CEqn =
|
||||
(
|
||||
fvm::ddt(C)
|
||||
+ fvm::div(phiRec, C)
|
||||
- fvm::laplacian(alphaEff, C)
|
||||
==
|
||||
fvOptions(C)
|
||||
);
|
||||
|
||||
CEqn.relax(relaxCoeff);
|
||||
|
||||
fvOptions.constrain(CEqn);
|
||||
|
||||
CEqn.solve();
|
||||
|
||||
fvOptions.correct(C);
|
||||
3
applications/solvers/rctfSpeciesTransport/Make/files
Executable file
3
applications/solvers/rctfSpeciesTransport/Make/files
Executable file
@ -0,0 +1,3 @@
|
||||
rctfSpeciesTransport.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rctfSpeciesTransport
|
||||
27
applications/solvers/rctfSpeciesTransport/Make/options
Executable file
27
applications/solvers/rctfSpeciesTransport/Make/options
Executable file
@ -0,0 +1,27 @@
|
||||
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
|
||||
|
||||
EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
@ -0,0 +1,17 @@
|
||||
// calculate the continuity error according to phiRec
|
||||
|
||||
{
|
||||
volScalarField contErr(fvc::div(phiRec));
|
||||
|
||||
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||
mag(contErr)().weightedAverage(mesh.V()).value();
|
||||
|
||||
scalar globalContErr = runTime.deltaTValue()*
|
||||
contErr.weightedAverage(mesh.V()).value();
|
||||
cumulativeContErr += globalContErr;
|
||||
|
||||
Info<< "time step continuity errors : sum local = " << sumLocalContErr
|
||||
<< ", global = " << globalContErr
|
||||
<< ", cumulative = " << cumulativeContErr
|
||||
<< endl;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user