|
[Sponsors] |
UDF print results into .dat file more than once per time step? how to fix it? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 26, 2019, 11:38 |
UDF print results into .dat file more than once per time step? how to fix it?
|
#1 |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 7 |
fluent 19.2 , UDF in parallel
Using Compute_Force_And_Moment micro to calculate the force of a flapping foil, then printing the results into a .dat file. I found that the UDF output the same results into the .dat file 1~3 times per time step, so how can I fix the problem to print the same results in the .dat file only once in every timestep? Thanks! |
|
April 26, 2019, 22:18 |
Another solution
|
#2 |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 7 |
I find MATLAB ‘unique’ function can solve the problem~~
|
|
April 27, 2019, 05:40 |
|
#3 |
New Member
Join Date: Nov 2018
Posts: 14
Rep Power: 8 |
I don't understand the problem. Do you mean that you have more iteration per time step and you want to print the results just for the last iteration of each time step? In this case you can use DEFINE_EXECUTE_AT_END macro and print from there.
If the problem is that you are working in parallel and fluent is printing the results for each node then you can try to add something like this: FILE *try; #ifPARALLEL if(I_AM_NODE_ZERO_P) #endif { try=fopen("youfile.dat","w+"); fprintf(try, ....... ); fclose(try); } |
|
April 27, 2019, 22:32 |
|
#4 | |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 7 |
Quote:
|
||
April 29, 2019, 02:31 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you should write to file from HOST
more details you may find in Ansys Fluent Customization manual it contains pretty clear example chapter Writing Files in Parallel best regards |
|
May 15, 2019, 06:33 |
|
#6 |
New Member
Join Date: Nov 2018
Posts: 14
Rep Power: 8 |
..................
Last edited by pianaCFD; May 15, 2019 at 06:35. Reason: I set in the wrong place |
|
Tags |
parallel calculation, udf code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Thermophysical Properties | wsmith02 | OpenFOAM | 4 | June 1, 2023 15:30 |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |