|
[Sponsors] |
October 8, 2015, 10:56 |
isoSurface normal
|
#1 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
Hi All,
i am facing some problems using sampleIsoSurface to extract the iso surface of alpha1 (interFoam) during the run. The case is 2D and i am simulating a simple drop relaxation. I correctly defined the surface which is triangulated and i extracted the centre and the normal of each triangle. There are two problems: first the normals are not pointing in the same direction (all inward, all outward with respect to the iso surface) but they seem to have random direction. Second i do not understand why, even if the case is 2D (x-y plane), there are some normals with non-zero z component. Does sampleIsoSurface work for 2D? If i do 3D, the problem on the random normal direction remains... Any clue? andrea |
|
October 8, 2015, 17:46 |
|
#2 |
Senior Member
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12 |
Try filling a bug report in the MANTIS OpenFOAM platform, maybe there is a bug in the code
|
|
October 9, 2015, 09:53 |
|
#3 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
I am not sure it is really a bug or (more likely) i am simply doing something wrong. So here are the steps i used to create the surface.
1) i created a dictionary name "alpha05Dict" and put it in /constant Code:
FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object sampleDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // isoField alpha1; isoValue 0.5; interpolate true; //zone ABC; // Optional: zone only //exposedPatchName fixedWalls; // Optional: zone only //regularise false; // Optional: do not simplify Code:
IOdictionary alpha05Dict ( IOobject ( "alpha05Dict", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); Code:
sampledIsoSurface alpha05("alpha05",mesh,alpha05Dict); alpha05.update(); tmp<vectorField> alpha05point = alpha05.points(); //points on the surface faceList surfaceFace = alpha05.faces(); //faces on the surface Code:
pointField pp(alpha05point ); vectorField areavec(surfaceFace.size(),vector(0,0,0)); vectorField centre(surfaceFace.size(),vector(0,0,0)); vectorField areavec1(surfaceFace.size(),vector(0,0,0)); vectorField centre1(surfaceFace.size(),vector(0,0,0)); forAll(surfaceFace,facei) { const face& ll = surfaceFace[facei]; //list of point label of facei const pointField& pll = ll.points(alpha05point); areavec[facei] = 0.5*(pp[ll[0]] ^ pp[ll[1]]) + 0.5*(pp[ll[1]] ^ pp[ll[2]]) + 0.5*(pp[ll[2]] ^ pp[ll[0]]); centre[facei] = (1.0/3.0) * (pp[ll[0]] + pp[ll[1]] + pp[ll[2]]); areavec1[facei] = ll.normal(pll); centre1[facei] = ll.centre(pll); } Then i pun some "Info" to print the calculated centers and normals. Code:
Points3((0.028 0.0290354 0.0001) (0.028 0.0290354 3.53975e-06) (0.0280251 0.0290251 9.74915e-05)) //points on a particular face areavec1(0 0 0) areavec(-4.97389e-10 -1.20984e-09 0) Centre1 (0 0 0) Centre (0.0280084 0.029032 6.70104e-05) If i plot the vector area obtained with the explicit formula i have the problem mentioned in my previous post: the direction of the vectors seems more or less random (sometime inward, sometime outward) and there are vectors with non-zero z component (case is 2D). I noticed that in isoSurface.H is reported "- does not do 2D correctly, creates non-flat iso surface.", which probably explains why i get strange orientation with 2D. Despite this if I sum up the face area vector magnitude i get the total interfacial area with an error less than 0.002% for a fine mesh, so the triangulated isosurface seems to well represent the 0.5 contourn of the VOF function. I simulated the same case 3D but i still have problem with the orientation of the vectors. Any help will be really appreaciated. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Wedge patch '*' is not planar | LilumDaru | OpenFOAM Meshing & Mesh Conversion | 6 | January 12, 2021 05:55 |
[snappyHexMesh] determining displacement for added points | CFDnewbie147 | OpenFOAM Meshing & Mesh Conversion | 1 | October 22, 2013 09:53 |
[CAD formats] my stl surface is seen as just a line | rcastilla | OpenFOAM Meshing & Mesh Conversion | 2 | January 6, 2010 01:30 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 15:57 |