|
[Sponsors] |
August 5, 2006, 17:31 |
Stupid question
|
#1 |
Guest
Posts: n/a
|
Hello all! Need a help, coz i can't see the mistake. What do i do wrong for the advection equation [ dU/dt=-Cx(dU/dx)-Cy(dU/dy)-Cz(dU/dz) ] in 3D unstructured tetrahedral mesh? Here's the code in C++ for the tetrahedra element. The spatial discrimination of the flux for a 1-st order Godunov method (made it just to check the code). CosX[i] etc.. are unit normals of a face. Here i calculate face values, to sum them, and divide by volume to get a flux in the center. It should work, but it doesn't! I know it's stupid, but what's wrong? I get spurious oscillations. Here's the part of the code:
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Static pressure at outlet - Stupid question??? | Miry | CFX | 0 | September 16, 2007 19:14 |
[blockMesh] Question possible stupid about grid | fabianpk | OpenFOAM Meshing & Mesh Conversion | 2 | April 10, 2007 06:55 |
Perhaps a stupid question... | HSeldon | FLUENT | 0 | March 9, 2007 13:14 |
stupid question | Andrew Hayes | Main CFD Forum | 9 | December 20, 2005 12:25 |
A (very, very) stupid FEM Question | Carlos | Main CFD Forum | 2 | September 21, 2002 10:31 |