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

Retaining UDM on Initialization; Switching Between Series and Parallel Setup

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 5, 2016, 19:10
Default Retaining UDM on Initialization; Switching Between Series and Parallel Setup
  #1
New Member
 
Join Date: Jul 2015
Posts: 7
Rep Power: 3
hebush is on a distinguished road
I currently have a number of DEFINE_ON_DEMAND routines that read, process, sort and write data to user defined memory at cell faces via F_UDMI. Eventually, I load a text file and copy its contents line-by-line to the user defined memory at each face location of a given thread. Later, a DEFINE_PROFILE routine reads the data stored in user-defined memory and uses it to create a boundary heat source.

I would like to run my simulations in parallel, but I've found converting my user-defined functions to parallel operation difficult due to the scarcity of documentation on the subject and the cumbersome nature of keeping track of information between nodes. Therefore, I would like to, if possible, read in my data and store it to user-defined memory in series operation, then re-open ANSYS in parallel mode. This is alluded to here.

Unfortunately, it seems that UDM is not retained between runs, and in fact is reset upon initialization, meaning that even in a given session I must run the DEFINE_ON_DEMAND statement to fill the UDM after I initialize.

Therefore, is it possible for me to avoid re-writing my UDFs in such a manner, either by changing the way I initialize or in some way making UDM retain information during initialization? Thanks in advance.

(Note: I can post my UDFs later if need be, but since this is a more general question I didn't think it necessary, at least at first)
hebush is offline   Reply With Quote

Old   April 6, 2016, 11:07
Default
  #2
New Member
 
Join Date: Jul 2015
Posts: 7
Rep Power: 3
hebush is on a distinguished road
After some effort, I've managed to find a solution that allows me to avoid having to modify my UDFs for parallel operation. I was previously having trouble with Fluent losing my UDFs when setup was re-run. Note that this assumes Fluent is being run through ANSYS Workbench.
  1. Set up case.
  2. Load and build compiled UDF(s).
  3. Set user-defined memory/no memory locations.
  4. Apply profile boundary condition UDF(s) via Boundary Conditions panel.
  5. Initialize solution.
  6. Export case and data to a file.
  7. Close Fluent and create a standalone Fluent module in Workbench.
  8. Paste your UDF(s) into the working directory of the new, standalone module.
  9. Open Fluent from standalone module and specify parallel operation.
  10. Load and build compiled UDF(s). NOTE: After playing around with the process, I don't think this step is necessary.
  11. Load in your mesh, case and data.
  12. Without re-initializing, run simulation. Your previously assigned user-defined memory from your loaded case should have been retained and can now be applied in your other UDF(s).

Last edited by hebush; April 13, 2016 at 14:40.
hebush is offline   Reply With Quote

Old   April 14, 2016, 14:06
Default
  #3
New Member
 
sherzad
Join Date: Oct 2015
Posts: 3
Rep Power: 3
sherzad is on a distinguished road
hi hebush

I got this error when i run parallel on 16 professors and i use 1 udf file as input boundary condition
Error: chip-exec: function "velocity" not found.
Error: chip-exec: function "k_profile" not found.
Error: chip-exec: function "E_Totaldissip_profile" not found.
Error: chip-exec: function "velocity" not found.
Error: chip-exec: function "k_profile" not found.
Error: chip-exec: function "E_Totaldissip_profile" not found.
Error: chip-exec: function "velocity" not found.
Error: chip-exec: function "k_profile" not found.
Error: chip-exec: function "E_Totaldissip_profile" not found.
Error: chip-exec: function "velocity" not found.
sherzad is offline   Reply With Quote

Old   July 6, 2016, 10:09
Default
  #4
New Member
 
Join Date: Jul 2015
Posts: 7
Rep Power: 3
hebush is on a distinguished road
UPDATE: I think I was either a bit sloppy in making my directions or I have better realized which steps are important to the process and which aren't. Here is my revised process:
  1. (In series mode) Set up case.
  2. Load and build compiled UDF(s).
  3. Set user-defined memory/no memory locations.
  4. Apply profile boundary condition UDF(s) via Boundary Conditions panel.
  5. Initialize solution.
  6. Load-in/Create data and store in UDM.
  7. Export case and data to a file.
  8. Close Fluent and create a standalone Fluent module in Workbench.
  9. (In parallel mode) open the "setup" field of this module.
  10. Paste the libudf folder and your UDF(s) and associated files into the working directory of the new, standalone module.
  11. Load in your mesh, case and data.
  12. Without re-initializing, run simulation. Your previously assigned user-defined memory from your loaded case should have been retained and can now be applied in your other UDF(s).

Note that I still on occasion will find that Fluent throws a "Case must be initialized. Initialize now?" warning when I attempt this method. Proceeding with initialization will, as mentioned before, wipe the UDM, so you obviously don't want that. I haven't figured out any pattern for when this happens, but I just try again by creating a new standalone Fluent module in workbench, deleting the others, and starting over.
hebush is offline   Reply With Quote

Reply

Tags
define_on_demand, initialization, parallel computing, user defined function, user defined memory

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change series UDF to Parallel UDF zhang.limin FLUENT 0 January 25, 2011 15:27
Parallel and series fluent Stan Tonks FLUENT 1 January 29, 2004 13:00


All times are GMT -4. The time now is 06:32.