CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Upwind scheme, surface flux (https://www.cfd-online.com/Forums/openfoam-programming-development/157670-upwind-scheme-surface-flux.html)

wenxu August 4, 2015 23:03

Upwind scheme, surface flux
 
Dear, everyone,

Now I implement level set into OF, during the reinitialization process , the discrete scheme should be implemented myself. The WENO scheme is the best choice, however, for unstructured mesh, this scheme is not easy to implement. So I choose the upwind scheme instead.

My question is how can we know the neighbour meshes location relative to the owner mesh. That means I can calculate all of the neighbours of a owner mesh as this (for a specific cellI):

Code:

  const cellI = mesh.cells()[cellI];
                const labelUList& owner = mesh.owner();
                const labelUList& neighbour = mesh.neighbour();
                forAll(cellI, facei)
                {
                    scalarList UneighbourList(6,0.0);
                    //- for explame ,the velocity field (U) we can get all of the neighbours cell values as follows:
                    UneighbourList.append(U[neighbour[facei]]);  //there will be six values if the mesh is  hexahedron.
                    //- Also we can get the owner mesh value as this;
                    scalar Uowner = U[owner[facei]];
                }


Then how can know these neighbour cells location relative to the owner cell? That means which one of these six values is on the left of the owner, which is on the right, top, bottom etc......

Could anyone give me some hints? Any comment is appreciated!

Best,
Wen


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