ff3d-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff3d-dev] how to use "function"


From: Robert Li
Subject: [ff3d-dev] how to use "function"
Date: Fri, 30 Jan 2004 10:43:44 -0800 (PST)

Stephane Del Pino,
I have some problems with using function in input
file.

1.Can we define a function fun(T), where T is a 
unknown variable T of solve(T), not x,y,z?
such as: function p=0.5*T;

2. Can we define a function using characteristic
function 
and unknown variable T of solve(T)?
such as 
function Theatu1=0.04*one(T<=-2) +
(0.5*T+1.05)*one(T<=-0.5 and T>-2) 
+ (1.6*T)*one(T<=0 and T>-0.5) + 0 * one(T>0);

3. When we set boundary conditions, can we call our
selfdefined function?
such as:
T = UserSelfDefineFunction(zmin) on M zmin;

4. What is the difference between femfunction and
function?
when should we use femfunction?
when should we use function?

Thanks,
Robert



>>>>>>>>>>>>
vector n = (20, 20, 20);
vertex a = (-2, -2, -5);
vertex b = (2, 2, 1);

scene Sc = pov(".\\data\\void.pov"); // the pov-ray
file for the geometry

mesh M = structured(n,a,b);

domain O = domain(Sc);



femfunction Tn(M) = 0;  //T0; when t=0; T
double  i = 0;          //loop times
double  dt = 0.1;       //time step
double  Kx=1920000.0;   //conductivity in x direction
double  Ky=1920000.0;   //conductivity in y direction
double  Kz=920000.0;    //conductivity in z direction
double  Cu=4184000.0;   //unfrozen volumetric heat
capacity(1000*4184)
double  Cf=1932000.0;   //frozen volumetric heat
capacity (920*2100)
double  Tpc=0.0;                //phase change temperature
function Cp=Cu*one(T>Tpc) + Cf*one(T<=Tpc);
double  Lf=334000000.0; //Latent heat of fusion of
water
double  Theat=0.8;              //Normalized volumetric water
content(0-1)
function Theatu1=0.04*one(T<=-2) +
(0.5*T+1.05)*one(T<=-0.5 and T>-2) + (1.6*T)*one(T<=0
and T>-0.5) + 0 * one(T>0);

do {
         solve(T) in  M {
                 pde(T)
                        T-( dx(Kx*dx(T))+dy(Ky*dy(T))+dz(Kz*dz(T))
)*dt/(Cp+Lf*Theat*Theatu1) = Tn
                        T = -1 on M zmax;
                    T = 1 on M zmin;
         }

        //Save result 
        save (medit , "heat4.00".i , T, M, dos ) ;
        save (medit , "heat4.00".i,  M, dos ) ;

        // you can compute deltaT here
        Tn = T;
        i=i+1;

} while (i<=10);



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]