CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Importing surface/profile for data writing in Fluent (https://www.cfd-online.com/Forums/fluent/113726-importing-surface-profile-data-writing-fluent.html)

fadiga February 25, 2013 14:13

Importing surface/profile for data writing in Fluent
 
1 Attachment(s)
Hi all.

I have a series of calculations which need to be done on a model geometry, with slightly varying interal dimensions. However there are locations in this geometry which are constant and which I need to extract the data from. I need to run the simulation in transient so I need to define these "lines" during pre-post in order to write and export the data per time step. Since I have to do quite a few, it would be nice to be able to write the coordinates file once, and then just import it each time....

Do you know of any way to import "surfaces" (as per the Fluent definition of a surface) which you can then use to define the locations of the data you need to write?

I tried already to create and read "profiles", with just coordinates but then I cannot the select the profile under surfaces when I try to write the data.

(i attached snapshot of the relevant command window i refer to)

Thanks for your help!

sreerajvarma July 10, 2014 12:52

Hi
I am also facing the same problem. I jist want to import transient data for the whole simulation at a few locations like wall.Could anyone help? I require this because otherwise the data will be too large and i will not be able to store\process it


Thank you

sreerajvarma July 11, 2014 13:25

Quote:

Originally Posted by sreerajvarma (Post 500987)
Hi
I am also facing the same problem. I jist want to import transient data for the whole simulation at a few locations like wall.Could anyone help? I require this because otherwise the data will be too large and i will not be able to store\process it


Thank you

Hi
I'm just a beginner in Fluent Udf and want to simulate a shock tube. But since I do not have space to store the large amount of data generated from the solution I would like to save data at just a few particular locations. For this I wrote the UDF given below.

#include "udf.h"

DEFINE_INIT(sree_shock_tube_init,d)
{
cell_t c;
Thread *t;
float xc[ND_ND];

thread_loop_c(t,d)
{
begin_c_loop_all(c,t)
{

C_CENTROID(xc,c,t);

if (xc[0] < 3.2 )
{
C_U(c,t) = 0.;
C_V(c,t) = 0.;
C_P(c,t) = 2026500.0;
C_T(c,t) = 300.0;
C_R(c,t) = 23.536;
}

else

{

C_U(c,t) = 0.;
C_V(c,t) = 0.;
C_P(c,t) = 10132.5;
C_T(c,t) = 300.0;
C_R(c,t) = 0.11768;

}

}
end_c_loop_all(c,t)
}
}
DEFINE_RW_FILE(writer,fp)
{
face_t f;
Domain *d;
Thread *t;
float fc[ND_ND];
double pres,tem,vel,vels,mach;
thread_loop_f(t,d)
{
begin_f_loop_all(f,t)

{
F_CENTROID(fc,f,t);
if( fc[0]==0 || fc[0]==3.2 || fc[0]==6.4 || fc[0]==9.6 )

{
pres=F_P(f,t);
tem=F_T(f,t);
vel=F_U(f,t);
vels=pow(1.4*287.002*tem,0.5);
mach=vel/vels;
fprintf(fp,"%f: %f: %f: %f",pres,tem,vel,mach);

}

}
end_f_loop_all(f,t)

}

}

But when I interpret this code in fluent I get parse error on line no: 54 and 71. Could anyone tell why this error comes. I am just a beginner in Fluent and also doesn't have much experience in handling C

Best Regards

sreerajvarma July 11, 2014 14:05

I removed the parse errors and the udf is interpreting fine.But when I try to run the above UDF in ansys Fluent and calculate I receive the following error message:
Error: Received fatal signal (segmentation fault). and it closes automatically
I guess it must be problem in the udf coding. I also hooked the function in both write cas and data initially and later tried hooking only to write data file alone. I want to save the pressure , temperture velocity and mach no: at a few locations alone and later use them in cfd post.
Could anyone suggest a solution to this problem

sreerajvarma July 12, 2014 01:23

When I try to run the above UDF in ansys Fluent and calculate I receive the following error message:
Error: Received fatal signal (segmentation fault). and it closes automatically
I guess it must be problem in the udf coding. I also hooked the function in both write cas and data initially and later tried hooking only to write data file alone. I want to save the pressure , temperture velocity and mach no: at a few locations alone and later use them in cfd post.
Could anyone suggest a solution to this problem


All times are GMT -4. The time now is 22:59.