|
[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 |
![]() |
![]() |
#1 |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 5 ![]() |
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! |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 5 ![]() |
I find MATLAB ‘unique’ function can solve the problem~~
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Join Date: Nov 2018
Posts: 14
Rep Power: 6 ![]() |
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); } |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
New Member
xuwenhua
Join Date: Mar 2019
Posts: 4
Rep Power: 5 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,256
Rep Power: 32 ![]() ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Join Date: Nov 2018
Posts: 14
Rep Power: 6 ![]() |
..................
Last edited by pianaCFD; May 15, 2019 at 05:35. Reason: I set in the wrong place |
|
![]() |
![]() |
![]() |
Tags |
parallel calculation, udf code |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 03: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 18:13 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 17:34 |
Custom Thermophysical Properties | wsmith02 | OpenFOAM | 3 | July 27, 2015 05:37 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 11:46 |