CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   pressure profile behind projectile (http://www.cfd-online.com/Forums/fluent/103195-pressure-profile-behind-projectile.html)

mcwat June 13, 2012 06:58

pressure profile behind projectile
 
Hi, I have a problem with my simulation. I have to get the proper conduct of the pressure for a missile. But I have no formula for the pressure, only the results of another simulation in *. txt. This pressure is exerted on the bottom of the projectile. I tried to get them through UDF'a, but I get the error:

cpp -I"c:\ANSYSI~1\v121\fluent\fluent12.1.4/src" -I"c:\ANSYSI~1\v121\fluent\fluent12.1.4/cortex/src" -I"c:\ANSYSI~1\v121\fluent\fluent12.1.4/client/src" -I"c:\ANSYSI~1\v121\fluent\fluent12.1.4/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "D:\ANSYS_p
ojekt\ETAP III\pbase.c.txt"
Error: D:\ANSYS_projekt\ETAP III\pbase.c.txt: line 16: parse error.
Error: D:\ANSYS_projekt\ETAP III\pbase.c.txt: line 24: parse error.

This is my UDF:

/************************************************** ********************
unsteady.c
UDF for specifying a transient parameters profile boundary condition
************************************************** *********************/
#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position)
{
face_t f;
real t = CURRENT_TIME;

if (t <= 0.00084315)
{
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = -14 275 547 954 749 500 000 000.0*t*t*t*t*t*t + 43 436 065 414 501 600 000.0*t*t*t*t*t - 48 268 301 672 906 800.0*t*t*t*t + 23 694 384 396 288.0*t*t*t - 4 644 259 507.75*t*t + 469 948.4355*t + 36.8189;
}
end_f_loop(f, thread)
}
else
{
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = 5 315 344 214 775 300.0*t*t*t*t*t - 78 873 823 528 841.0*t*t*t*t + 435 375 156 550.906*t*t*t - 1 075 741 334.8709*t*t + 1 046 010.0566*t - 39.2758;
}
end_f_loop(f, thread)
}}

(I am a layman in writing UDF: ()

I do not think it worked, but I have other ideas how to figure it out.
If anyone has any idea how to move, I will be grateful.

Waiting for information

Regards

ghost82 June 13, 2012 12:34

Here is your udf:
Code:

#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position)
{
  face_t f;
  real t = CURRENT_TIME;

  begin_f_loop(f, thread)
    {
    if (t <= 0.00084315)
          F_PROFILE(f, thread, position) = -14275547954749500000000.0*t*t*t*t*t*t+43436065414501600000.0*t*t*t*t*t-48268301672906800.0*t*t*t*t+23694384396288.0*t*t*t-4644259507.75*t*t+469948.4355*t+36.8189;
    else
          F_PROFILE(f, thread, position) = 5315344214775300.0*t*t*t*t*t-78873823528841.0*t*t*t*t+435375156550.906*t*t*t-1075741334.8709*t*t+1046010.0566*t-39.2758;
    }
  end_f_loop(f, thread)
}

This one compiles/interprets fine.
Copy and name it whatyouwant.c

Daniele

mcwat June 19, 2012 04:38

Thanks,

It looks fine. But I have another problem because projectile moves through the six DOF and this UDF is compiled. When I'm using the UDF with pressure profile behind the projectile then I have a message that "the six DOF can not be negative mass".

Does anyone know how to combine these two UDFs or has any idea how I can enter the desired pressure profile for a missile while taking advantage of its six DOF motion?

Waiting for information

Regards


All times are GMT -4. The time now is 20:27.