CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

Need a help!!!

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

Sponsored Links

LinkBack Thread Tools Display Modes
Old   August 8, 2006, 00:16
Default Need a help!!!
Posts: n/a
Sponsored Links
Hello fellows! I haven't solved the problem yet. Please, someone, give me a hand here! I never programmed unstructured 3d tetrahedral mesh.

This is a part of a program to find a flux in the center of a tetrahedra for the advection equation: dU/dt=-CxdU/dx-CydU/dy-CzdU/dz, using simple Godunov method. I get spurious results. What do I do wrong? Flux vector splitting doesn't help.
here U - scalar, Ci - velocity, cosX[i], cosY[i]... - normals, so that cosX[i]^2+cosY[i]^2+cosZ[i]^2=1, S[i] - face square, Ut- scalar outside the tetrahedra face i, cv[number].U - inside the tetrahedra in the center
double compressible_flow::calculate_advection() { double ret=0.0; // for each face for(int i=0;i<4;i++){ double Ux=0.0; double Uy=0.0; double Uz=0.0; double Cx=-0.5;//velocities double Cy=0.0; // double Cz=0.0; // if(cosX[i]*Cx>0) // Nx*VelocityX Ux=cv[number].U; // U inside of a tetrahedra else Ux=U_t; // U outside of a tetrahedra, next to the face 'i' if(cosY[i]*Cy>0) Uy=cv[number].U; else Uy=U_t; if(cosZ[i]*Cz>0) Uz=cv[number].U; else Uz=U_t; ret=ret+S[i]*( Cx*Ux*cosX[i]+Cy*Uy*cosY[i]+Cz*Uz*cosZ[i] ); } return ret; }

Thanks in advance

  Reply With Quote
Sponsored Links


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Sponsored Links

All times are GMT -4. The time now is 05:07.