CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

engineMesh with layered addition removal

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 2, 2012, 18:18
Default engineMesh with layered addition removal
  #1
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I was browsing through the old extend/dev code and found there used to be a lot more code in the $FOAM_SRC/engine folder than there is in the current 2.1.x version. The engineTopoChangerMesh/layerAR looks like it could be really useful to do engine simulation so I decided to try and port/adapt it to 2.1.x as an engineMesh subclass.

I've uploaded my first attempt which requires a few changes to the files in engineMesh to compile and link properly. In the Make/files, add

Code:
engineMesh/layeredEngineMeshAR.C
Additionally, we need a pure virtual bool function in engineMesh.H:

[CODE]
virtual bool deform() = 0;
[CODE]

And the function deform should be defined in all the other the subclasses (layeredEngineMesh, fvMotionSolverEngineMesh, etc). A simple one to use is
Code:
bool deform()
{
    this->move();
    return false;
}
Anyways, I compile, link and after adding the following entries to the engineGeometry dictionary:

Code:
engineMesh    layeredAR;
.
.
.
deformAngle 10;
delta 1e-4;
offSet 1e-4;
piston
{
        patch   piston;
        coordinateSystem
        {
                origin (0 0 0);
                coordinateRotation
                {
                        type    axes;
                        e1      (1 0 0);
                        e2      (0 1 0);
                        e3      (0 0 1);
                }
        }
        minLayer        1e-3;
        maxLayer        1e-2;
}
(the actual values are not so important, as I still need to test and see what the parameters do). Everything goes well until its time to do the layer addition/subtraction, when I get the following:

Code:
Courant Number mean: 0.000371093475 max: 0.00648838644
deltaT = 1.56621499e-06
Crank angle = 342.02585 CA-deg
deltaZ = 8.26588501e-06
pistonLayerID: 0
Piston layering mode
Cannot find point in pts1 matching point 0 coord:(0.000187666667 6.83333333e-05 0.000473727705) in pts0 when using tolerance 5.07608117e-08
Searching started from:0 in pts1
    Compared coord:(0.000187689683 6.82700891e-05 0.000473727705) with difference to point 6.73022297e-08
.
.
.
cyclicPolyPatch::order : Writing neighbour faces to OBJ file "/windows/D/dEFRectMeshLayerTest/side_half0_faces.obj"
cyclicPolyPatch::order : Writing my faces to OBJ file "/windows/D/dEFRectMeshLayerTest/side_half1_faces.obj"
cyclicPolyPatch::order : Dumping currently found cyclic match as lines between corresponding face centres to file "/windows/D/dEFRectMeshLayerTest/side_half1_faceCentres.obj"
--> FOAM Serious Error : 
    From function cyclicPolyPatch::order(const primitivePatch&, labelList&, labelList&) const
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 1383
    Patch:side_half1 : Cannot match vectors to faces on both sides of patch
    Perhaps your faces do not match? The obj files written contain the current match.
    Continuing with incorrect face ordering from now on!
--> FOAM FATAL ERROR: 
Not implemented

    From function cloud::autoMap(const mapPolyMesh&)
    in file fields/cloud/cloud.C at line 65.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/printStack.C:201
#1  Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/error.C:249
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/errorManip.H:85
#3  Foam::cloud::autoMap(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/fields/cloud/cloud.C:66
#4  Foam::mapClouds(Foam::objectRegistry const&, Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/mapClouds.H:52
#5  Foam::fvMesh::mapFields(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/fvMesh/fvMesh.C:489
#6  Foam::fvMesh::updateMesh(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/fvMesh/fvMesh.C:674
#7  Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) at ~/OpenFOAM/OpenFOAM-2.1.x/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C:293
#8  Foam::layeredEngineMeshAR::deform() at ~/OpenFOAM/OpenFOAM-2.1.x/src/engine/engineMesh/layeredEngineMeshAR/layeredEngineMeshAR.C:257
#9  
 at ~/OpenFOAM/OpenFOAM-2.1.x/applications/solvers/combustion/myEngineFoam/myEngineFoam.C:93
#10  __libc_start_main in "/lib/libc.so.6"
#11  
 at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/i386/elf/start.S:122
Aborted
I've attached a picture of a periodic face and the corresponding dumped *.obj files. It looks like the solver dies after a cell is removed. Could someone familiar with these classes give me a hand? Again, I think this would be VERY useful for lots of people.
Attached Images
File Type: jpg delCell.jpg (84.2 KB, 275 views)
Attached Files
File Type: gz layeredEngineMeshAR.tar.gz (9.0 KB, 114 views)
mturcios777 is offline   Reply With Quote

 


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Boundary layer addition at corners with sHM bouclette OpenFOAM Meshing & Mesh Conversion 6 July 27, 2011 08:32
Modelling sound propagation through layered porous media nkinar Main CFD Forum 0 July 4, 2010 14:45
layer removal only- OpenFOAM-1.5-dev phsieh2005 OpenFOAM Running, Solving & CFD 0 July 2, 2010 05:57
How to use the engine solvers with layer addition and removal francesco OpenFOAM Running, Solving & CFD 2 March 19, 2009 03:29
UDF for heat addition and mass addition Srikanth FLUENT 2 September 20, 2006 19:12


All times are GMT -4. The time now is 17:51.