Hi,
I've checked many times that what there is in that journal file is what I want Fluent to pick up... What I'm gonna do is to smash both the .cas and .dat files and start over. I'll even delete the folder where they're located. I haven't run your script because I don't understand the meaning of 13 () no pressure () no I'll let you know where I end up. |
Quote:
Code:
/file/export The GUI record macro was just a pedagogical exercise. |
2 Attachment(s)
I know what you mean.
Well it doesn't seem to work either. I've created the journal file attached to this post, following your instructions ad you'll be able to see. However, I keep getting the same error message related to out of malloc memory (see picture attached). On the other hand, just to see if that malloc memory issue could be solved somehow, I'm running a single precision simulation based on the same case and it seems to work. I don't know what else I can do. Do you have idea how many extra iterations per time step I have to run compared to a double precision case? Cheers, Ivan. |
The journal file looks ok, at first glance. Most likely there is something wrong with the case file.
You could ask fluent support for that error. I don't think it matters how many iterations you run in single precision, if both calculations are converged, the double precision should always be more accurate. However, the difference may sometimes be insignificant. |
HI dmoroian
I am having a slightly different problem and I was wondering if you know of any other way around it. I need to monitor approximately 5000 points in my simulation per time step. 1.Surface point monitors do not work as they crash due to too many individual points 2. I tried file/transient-export TUI, this works in my PC. But when I load the simulation into a cluster, it does not give me the option to write it into 'ascii' format. Further investigation points out that Fluent Parallel dosent support transient-export in 'ascii' format. Do you have any idea how else I can monitor so many individual points?? Thanks in advance. |
Code:
void mapCell(real *x, cell_t *cell, Thread **thread) Take the above code as it is "just an example". I did not try it, it is not optimized, nor it correctly works in parallel. Basically it finds the corresponding cell for each monitor and prints out the temperature in a separate file. I hope this is helpful! |
Hi,
thank you for providing this example here! Can I ask you 2 questions about it? - How do you choose the value of 'min'? 1.0e6 seems like a very big value! - Is it necessary to retreive the cell location and thread (filled in by mapmyCell) every time-step, or could it be possible to do this upon loading? Thank you in advance, Kind regards, Ian |
Quote:
Quote:
|
Hi dmoroian,
Thanks for the answers! This is the code that works, where the coordinates of a line across my domain are read in from xcord.txt. Code:
#include "udf.h" Code:
============================================================================== Thank you! Ian |
Input/Ouput in parallel is not trivial, and certainly doesn't work straight from the serial implementation.
You'll have to look at the Fluent UDF Manual, chapter 7 "Parallel Considerations" for some more details. There is a sample of udf debugging on cfd-online wiki: http://www.cfd-online.com/Wiki/Fluen..._udf_using_gdb |
Quote:
I added the -%t for automated data export at each time step, but it seems to export only once filename-0000 and stops. Do I need to include some sort of a loop structure? I am using: Code:
file/export/ascii directory/filename-%t surface () no air-vof () yes Alfred |
I would use the command within "execute-commands" and run it periodically every time-step or every iteration.
|
Quote:
Future reference for others. The full syntax is: Code:
/solve/execute-commands/add-edit command-1 1 "time-step" "file/export/ascii directory/filename-%t surface () no parameter () yes" |
UDF time step in file name
Hello friends,
On a related topic, I have been having trouble with saving files from a UDF every n time steps, while running Fluent in parallel in batch mode. Fluent does not allow me to save files in ascii format in parallel mode, so I chose to go with a UDF instead. I found part of the UDF online and from the Fluent manual and have modified the rest to suit my purpose. Without the time part (between /*** ... ***/) the UDF runs well and gives me the output in desired format. But I want to add a timestep to my filename so that every time step, I have a new file. This does not work. My guess is that the time data is stored somewhere else, while I am trying to get it back from the host. If you can spare a few minutes, it would be of great help. Thanks. Below is the UDF: #include "udf.h" #define FNAME "datafile" #define TSTEP(t) (t % 2) DEFINE_EXECUTE_AT_END(dod_writer) { FILE* fp; #if !RP_HOST int cell_counter = 0, dummy, len; double pressure, cell_center[ND_ND] ; Domain *d; Thread *t; cell_t c; d = Get_Domain(1); /* Get the domain using Fluent utility */ #else /*************************** int cur_ts = RP_Get_Integer("time-step"); char str1[] = "file-"; char str2[] = ".dat"; strcat (str1, cur_ts); strcat (str1, str2); len = strlen(str1); Message("\n 1. current time step = %d, name = %s \n", cur_ts, str1); /* Send time-step and filename to all nodes */ node_to_host_int_1(cur_ts); host_to_node_string(str1,len); /* remember terminating NUL character ***************************************/ #endif #if RP_NODE if(!I_AM_NODE_ZERO_P)PRF_CRECV_INT(myid-1,&dummy,1,myid-1); fp = fopen(filename,(I_AM_NODE_ZERO_P?"w":"a")); #else fp = fopen(filename,"w"); #endif /* for RP_NODE*/ #if !RP_NODE if (fp!=NULL) { Message("\nThe file opened in the working directory \n"); } else { Message("Error in opening file \n"); } #endif /* for !RP_NODE*/ #if RP_NODE fprintf(fp,"cell-number X-cord Y-cord Z-cord Pressure"); #endif #if !RP_HOST thread_loop_c(t,d) { /*Message0("starting the loopn");*/ begin_c_loop_int(c,t) { cell_counter++; C_CENTROID(cell_center,c,t); pressure=C_P(c,t); #if RP_2D fprintf(fp,"n %d %10.3e %10.3e %10.3e",cell_counter, cell_center[0], cell_center[1], pressure); #else fprintf(fp,"n %d %10.3e %10.3e %10.3e %10.3e",cell_counter, cell_center[0], cell_center[1], cell_center[2], pressure); #endif } end_c_loop_int(c,t) } #endif /* for !RP_HOST*/ #if RP_NODE fclose(fp); if(!I_AM_NODE_LAST_P)PRF_CSEND_INT(myid+1,&dummy,1 ,myid); #else fclose(fp); Message("\n The loop ends\n"); #endif /* for RP_NODE*/ } |
Stack overflow
This is a classical example of stack overflow programming error:
Code:
char str1[] = "file-"; To solve the problem, just allocate enough memory in str1: Code:
char str1[200]; |
All times are GMT -4. The time now is 15:23. |