CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

to correct me an udf program

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   December 18, 2004, 06:54
Default to correct me an udf program
farida hamadi
Posts: n/a
I will want to know if my program that I have write to calculate the temperature of the surface during the interaction pulsed laser with matter is correct.

this is my program

/*user defined function to calculate temperature and velocity*/ /*fluent6*/ /************************************************** **/ #include"udf.h"

DEFINE_PROFILE(unsteady_temperature,thread, position) { int t,its; float gamma=1.66; float cgp=8.3144e7 ; float avogn=6.02e23; float bk=1.38e-23; float bkcgs=1.38e-16; // propriétés du matériau (Fer) float amass=27; float rhom=6.98; float rhos=7.8; float difftm=0.07; float diffts=0.14; float capcm=0.748; float capcs=0.628; float tfus=1808; float clv=6088; float clm=276; float b0=3.9e13; float a=0.55; float tamb=300; float coefabs=0.5; float romsros=rhom/rhos; float ab0=a*b0; float tau=-1.e-9; //ns float F=1.75; //j/cm2 float rl=0.05; //mm float u=amass*clv/(avogn*bk); float dens=amass/avogn/bkcgs; int ts=1800; float eps=0.001; float cnorm[10000]; float v0,vv,vdv,vm,vg,psatur,aiabs,precul,exputs,rmrsvv, tevap,diff,tconv,absi,tcond,tetoil,difsrl,vd,absmw ,abs1,rhog,prbar,pablat,pabar,veject,alpha,tempera ture;

float tl=26e-9; float tp=6e-9; float tlp=tl*(tl-tp); float anorm=1000; cnorm[0]=1000;

face_t f; begin_f_loop(f, thread) { t = RP_Get_Real("flow-time");

if(t >0 && t<tp) {aiabs=2.*F*coefabs*t/(tp*tl);} if(t>=tp && t<=tl) {aiabs=2.*F*coefabs*(tl-t)/tlp; } if(t > tl) {aiabs =0;}

if(aiabs==0)goto etiq2; ts=1800; for(its=1;its<=9200;++its) { ts=ts+1; exputs=exp(-u/ts); v0=sqrt(gamma*cgp/amass*ts); vv=v0*exputs; vdv=romsros*vv; psatur=b0*exputs/sqrt(ts); precul=a*psatur; vm= sqrt(2.*precul/rhom); rmrsvv=romsros*vv; difsrl=difftm/rl; vd=0.5*(rmrsvv+sqrt(rmrsvv*rmrsvv+4*romsros*difsrl *vm)); tetoil=tfus+0.9*(ts-tfus); tconv=rhom*(capcm*tetoil+clm)*vm*difftm/(vd*rl)-rhos*capcs*tamb*vd; tcond=rhos*capcs*(tfus-tamb)*vd/sqrt(difftm/diffts+vd*rl/diffts); tevap=rhom*vv*clv; absi=tconv+tcond+tevap; cnorm[its]=(abs(aiabs-absi))/aiabs; if(cnorm[its]<cnorm[its-1]) {anorm=cnorm[its]; }



veject=sqrt((gamma*cgp*ts)/amass); veject= veject*0.01; goto etiq1;}

goto etiq2; etiq1: continue; etiq2: continue;

F_PROFILE(f, thread, position) = ts; } end_f_loop(f, thread) }

  Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29

All times are GMT -4. The time now is 21:58.