CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Efficient usage of multiple DEFINE_SOURCE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2021, 19:43
Default Efficient usage of multiple DEFINE_SOURCE
  #1
jhz
New Member
 
Join Date: Dec 2020
Posts: 19
Rep Power: 6
jhz is on a distinguished road
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!
jhz is offline   Reply With Quote

Old   June 24, 2021, 02:15
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
show the code you are using
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 17:52.