CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Retaining UDM on Initialization; Switching Between Series and Parallel Setup (https://www.cfd-online.com/Forums/fluent-udf/169221-retaining-udm-initialization-switching-between-series-parallel-setup.html)

hebush April 5, 2016 19:10

Retaining UDM on Initialization; Switching Between Series and Parallel Setup
 
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 April 6, 2016 11:07

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).

sherzad April 14, 2016 14:06

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.

hebush July 6, 2016 10:09

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.


All times are GMT -4. The time now is 23:40.