View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002488 | OpenFOAM | Bug | public | 2017-03-06 17:54 | 2017-03-07 10:09 |
Reporter | ali.sh | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 14.04 |
Summary | 0002488: sample and sampleField functions return repeated results | ||||
Description | When you use sample function of e.g. class sampledPlane the output length is twice what expected. This means that e.g. consider a cavity case with 20*20*1 cells in xyz direction. A cutting plane is defined with a normal vector (0 1 0) in the middle of the box. You expect to have 20 cells cut by this face but the reported result is 40. Not surprisingly the function meshCells() reports 40 cutted cells. The reported cellIDs is sth like this: (cell0 cell0 cell1 cell1 cell2 cell2 ...) Am I did or understood sth wrong? | ||||
Steps To Reproduce | add #include "sampledPlane.H" in icoFoam.C add required libraries in options file: EXE_INC = \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lsurfMesh \ -ltriSurface \ -lsampling in createFields create: IOdictionary sampleDict ( IOobject ( "sampleDict", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); word aa("aa"); sampledPlane splane1(aa,mesh,sampleDict); in the main function we have: splane1.update(); scalarField sU=splane1.sample(p); Info<<" sample U is " <<sU<<endl; Info<<" cutcells are " <<splane1.cutCells()<<endl; create sampleDict in constant forlder of cavity tut: normalVector (0 1 0); basePoint (0.0025 0.0925 0.005); | ||||
Tags | No tags attached. | ||||
|
Quick question: Did you inspect the resulting surface? |
|
When I saw the face centers by Cf(), I found out that the oroginal hex faces are triangulated! That is why you see everything twice. So the solution is to set triangulate to false while creating cutting planes. Thanks a lot Bruno! |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-03-06 17:54 | ali.sh | New Issue | |
2017-03-06 20:17 | wyldckat | Note Added: 0007862 | |
2017-03-07 10:01 | ali.sh | Note Added: 0007865 | |
2017-03-07 10:09 | henry | Assigned To | => henry |
2017-03-07 10:09 | henry | Status | new => closed |
2017-03-07 10:09 | henry | Resolution | open => no change required |