|
[Sponsors] |
June 23, 2021, 19:43 |
Efficient usage of multiple DEFINE_SOURCE
|
#1 |
New Member
Join Date: Dec 2020
Posts: 19
Rep Power: 6 |
Hello,
Currently, I'm using the DEFINE_SOURCE macro for both x and y momentum source terms, but the computation is duplicated across the macros. The logic is to use DEFINE_SOURCE to loop through cells, calculate values based on cell variables, and then conditionally impose an x/y momentum source term. In one instance of DEFINE_SOURCE, the values for both x/y momentum is already solved for, but two separate instances are still needed when hooking the macro, leading to duplicated computations. Can anyone suggest a more efficient implementation that doesn't require the duplication of DEFINE_SOURCE? I thought about using arrays/UDMs to store the source terms so that in the 1st DEFINE_SOURCE, x/y terms are calculated and stored with x imposed, and in the 2nd DEFINE_SOURCE look up the y terms based on some cell identifier and impose. However, I think lookup operations don't scale well with number of cells. Any advice is appreciated! |
|
June 24, 2021, 02:15 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
show the code you are using
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! | divergence | OpenFOAM Meshing & Mesh Conversion | 0 | January 23, 2019 05:17 |
[ANSYS Meshing] [Q] Efficient CPU & Memory usage | Whitebear | ANSYS Meshing & Geometry | 2 | June 28, 2016 02:20 |
[OpenFOAM.org] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs | Pier84 | OpenFOAM Installation | 4 | June 18, 2016 17:22 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |