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

dieselEngineDyMFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mturcios777

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2011, 17:12
Default dieselEngineDyMFoam
  #1
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi Foamers,

Does anyone of you know how to make from dieselengineFoam ->dieselEngineDyMFoam?
I woul like to use the mesh strategies from the engineTopoChangerMesh class.

Thx
Peter
Peter_600 is offline   Reply With Quote

Old   November 21, 2012, 01:02
Default
  #2
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
I have same question. How to modify dieselEngineFoam to work with layer addition and removal ? I use 1.6-ext...
u22 is offline   Reply With Quote

Old   November 21, 2012, 07:35
Default
  #3
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi,

you have to include following header files in your solver before the main part will be executed.

#include "engineTopoChangerMesh.H instead of #include "dynamicFvMesh.H"

change mesh.move() to mesh.update()

Furthermore, you have to link the compiler to this lib with
-ltopoChangerFvMesh

in EXE_LIBS

cheers Peter
Peter_600 is offline   Reply With Quote

Old   November 22, 2012, 06:06
Default
  #4
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Thanks, Peter!

Already figured out the issue. I did some change in code similar to the sonicTurbDyMEngineFoam.C

Here is diff dieselEngineDyMFoam.C dieselEngineFoam.C
35,37c35
< #include "engineTopoChangerMesh.H"
---
> #include "engineMesh.H"
55,56c53
< # include "createEngineDynamicMesh.H"
---
> # include "createEngineMesh.H"
>
82,83c79
< mesh.update();
---
> mesh.move();

And make diff options is
18,21d17
< -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
< -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
< -I$(LIB_SRC)/dynamicMesh/topoChangerFvMesh/lnInclude \
< -I$(LIB_SRC)/meshTools/lnInclude
41,45c37
< -llduSolvers \
< -ldynamicFvMesh \
< -ldynamicMesh \
< -ltopoChangerFvMesh \
< -lmeshTools
---
> -llduSolvers
u22 is offline   Reply With Quote

Old   December 12, 2012, 06:06
Default engineGeometry
  #5
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Hello, foamers!

Mоdified solver dieselEngineDyMFoam removes layers correсtly, but crashes in first layer addition.
Please explain purpose of the coordinate system (how it should be oriented for a piston patch? what means origin, direction and axis? ), as well as other parameters in engineGeometry dict.

I use
engineTopoChangerMesh layerAR;
minLayer 0.002;
maxLayer 0.005;
delta 0.001;
offSet 0.002 // i gues, it means "work area" for add/removal. In which direction?? And offset from which point??

My mesh is 0.005 m in Z directions...

piston
{
patch piston;

coordinateSystem
{
// type Cartesian;
type cylindrical;
origin (0 0 0);
axis (0 0 1);
// direction (0 1 0);
direction (1 0 0);
}
minLayer 0.002;
maxLayer 0.005;
}
Attached Images
File Type: png mesh.png (7.8 KB, 88 views)
u22 is offline   Reply With Quote

Old   December 12, 2012, 13:28
Default
  #6
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'll tackle this one as layer addition/removal is something I managed to get working after a long struggle.

Offset is how far away from the highest z value of the piston patch you want to start looking for your add/remove surface. So if your piston patch has max z coordinate of -0.02 m, establishing the add/remove surface will begin looking there. If offset = 0, then the faces of the piston patch itself will be used (unless your piston patch is reasonably flat, don't do this)

delta is the range where you want to look for faces to make the add/remove surface. if delta is 0.001 m, then all faces in the range [-0.021, -0.019] will be eligible for being part of the add/remove surface.

Its always good to check the pistonLayerFaces faceZone that is created to ensure that the resulting faceZone is a singly connected surface, and that there aren't any faces whole normal deviates much from the z direction (if you create the surface with offset > 0, this should be okay).

Coordinate system is for the creation of the piston (which is a member of the layerAR class). As long as the coordinate system is aligned with your simulation domain (which looks like what you have done).

Hope this helps! Note that the entire engine library can be ported to work with 2.1.x.
mturcios777 is offline   Reply With Quote

Old   December 13, 2012, 05:10
Default
  #7
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
mturcios777, thanks for your comment!

So, my setup in engineGeometry looks reasonable for me. But i still get FPE in layer addition. And no printStack output...

I attached a mesh and pistonLayer facezone pictures for last saved CAD (deformAngle=20)

Why OpenFoam does not produce printStack output in that case?

How to debug what goes wrong with layer addition?

---After a while----

I discover, that moveDyMEngineMesh works fine when it start adding layers after deformAngle CAD.

And dieselEngineDyMFoam crashes in layerAR.C, in

autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh();

....
Attached Images
File Type: png 22CAD_mesh.png (17.8 KB, 64 views)
File Type: png 22CAD_faceZone.png (21.7 KB, 65 views)

Last edited by u22; December 13, 2012 at 08:17.
u22 is offline   Reply With Quote

Old   December 13, 2012, 13:26
Default
  #8
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
Ok, I'm assuming that the flat faces above your piston patch are the faceZone, so they look good. Not sure why the stack trace isn't output, though since the error looks like its occurring inside layerAR, you should probably turn on the debug options for polyTopoChange, polyTopoChanger, layerAdditionRemoval and dynamicMesh.

I would also recommend removing the cell/face/pointZones and meshModifiers file in your starting mesh every time until you are sure that the problem isn't from the mesh. It doesn't take that long to regenerate them when you start the simulation, plus if you've made changes to the layerAR in engineGeometry, it won't be updated until you delete all those files (have a look at addLayerARMeshModifiers.C).

Also, try switch to a cartesian coordinate system. You'll definitely need to remove the zones and modifiers to see the change (if any).
mturcios777 is offline   Reply With Quote

Old   December 14, 2012, 06:35
Default
  #9
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Marco, thanks for help again.

1. I run simulation from -180 with cartesian CS and get same error
2. I compiled OF 1.6-ext with DEBUG , but didn't get no additional output in log file
how to switch on debug for polyTopoChange and etc.? I see many of "if(debug) ..." lines there

3. moveDyMEngineMesh works fine for my case. WHY? This is realy bother me.

4. May be, I need some additonal changes in dieselEngineFoam.C, not only replacing mesh.move() by mesh.Update().

code in sonicTurbDyMEngineFoam looks more sofisticated then just "mesh.Update".

Could you share your version of dieselEngineDyMFoam please...? Or working cases for this solver..
u22 is offline   Reply With Quote

Old   December 14, 2012, 13:18
Default
  #10
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
There are additional debug flags in the etc/controlDict file. As for moveDyMEngineMesh, remember that only the mesh is being changed, so its possible that the crash is ocurring after the mesh has been changed.

I don't have dieselDyMEngineFoam, but I was working on a sprayDyMFoam, which pretty much has the same changes that you need to make. Its posted on the Mantis site:

http://www.openfoam.org/mantisbt/view.php?id=672

Good luck!
u22 likes this.
mturcios777 is offline   Reply With Quote

Old   December 17, 2012, 02:26
Default
  #11
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Thanks, Marco! I enable additional debug flags in etc/controlDict. There is tail of log output:
------------------------------------------------------------
polyTopoChanger::changeMesh
(
const polyTopoChange& ref
) : completed topological change.

void polyTopoChanger::update(const mapPolyMesh& m) : Updating mesh modifiers
layerAdditionRemoval::updateMesh(const mapPolyMesh&) for object pistonLayer : Clearing addressing on external request. Pointers not set.

void polyMesh::setInstance(const fileName& inst) : Resetting file instance to "22.93"
void polyMesh::setMotionWriteOpt(IOobject::writeOption) Setting motion writeOpt to 0
void polyMesh::setTopoWriteOpt(IOobject::writeOption) Setting topo writeOpt to 0
Updating object pointMesh
Updating object volPointInterpolation
volPointInterpolation::makeWeights() : constructing weighting factors
volPointInterpolation::makeWeights() : 1
volPointInterpolation::makeWeights() : 2
Floating point exception
------------------------------------------------------------
So, FPE generated in volPointInterpolation::makeWeights(), in following code
(i think, divide by zero). May be an error in my case setup? Is it mesh related problem?

------------------------------------------------------------
if (debug) Info<< "volPointInterpolation::makeWeights() : 2" << endl;

// Calculate inverse distances between cell centres and points
// and store in weighting factor array
forAll(points, pointi)
{
scalarList& pw = pointWeights_[pointi];
const labelList& pcp = pointCells[pointi];

forAll(pcp, pointCelli)
{
pw[pointCelli] =
1.0/mag(points[pointi] - cellCentres[pcp[pointCelli]]);

sumWeights[pointi] += pw[pointCelli];
}
}
------------------------------------------------------------
u22 is offline   Reply With Quote

Old   December 17, 2012, 13:21
Default
  #12
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
The divide by zero makes sense as far as where the error is ocurring. Not sure as to why, but most likely a mesh generation error. I can't remember the last time (or if ever) I tried layerAR on a sector mesh with periodic boundaries (it may be possible it doesn't work).

Could you make a simple flat piston mesh (use same angle for sector mesh) and try layerAR there with offset = 0? Then try it full cylinder with the same flat piston. Based on these tests we can figure out what the problem is. I'll see if I have an old cylinder mesh somewhere, but it may be faster for you to make your own.

Also, please send me a picture of the faceZone that is being used to create the layers.

Last edited by mturcios777; December 17, 2012 at 13:26. Reason: Additional question
mturcios777 is offline   Reply With Quote

Old   December 18, 2012, 23:37
Default
  #13
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Dear Marco,

I construct cylindrical mesh for 45 degree sector and full 3d without cyclic BC.
Unfortunately, I got same errors. I enlarge the clearance and use zero offset. Here is pictures for last saved CA (23 degree). Piston patch looks equal pistonLayer faceZone...

There is post by Abhishekd18 with the same error volPointInterpolation::makeWeights() : constructing weighting factors http://www.cfd-online.com/Forums/ope...ng-layers.html

I guess, he used same "scania" case as I (by N. Nordin, without layerAR) and case conversion to 1.6 ext was not completed in right way...

May you have a look on case files??

This error not only IC-related, Look at here http://www.cfd-online.com/Forums/ope...tml#post398179
Attached Images
File Type: png simplecylmesh.png (31.3 KB, 27 views)
File Type: png simplesectormesh.png (26.0 KB, 28 views)
Attached Files
File Type: gz simplesector.1.6-ext.copy.tar.gz (12.2 KB, 53 views)

Last edited by u22; December 19, 2012 at 02:36.
u22 is offline   Reply With Quote

Old   December 19, 2012, 13:38
Default
  #14
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
Thanks for the files, but your points file appears to be missing; can you double check your case and re-submit it?
mturcios777 is offline   Reply With Quote

Old   December 20, 2012, 01:23
Default
  #15
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
Hello Marco,

There is small file limit on the forum, i put files on file hosting here
u22 is offline   Reply With Quote

Old   December 23, 2012, 22:49
Default
  #16
u22
Member
 
Anthony Nitski
Join Date: Aug 2009
Location: Earth
Posts: 35
Rep Power: 17
u22 is on a distinguished road
So, one of possible solutions been found Next step - to check whether the solver with layerAR to work in parallel.
u22 is offline   Reply With Quote

Old   August 11, 2014, 12:27
Default
  #17
Member
 
sajad
Join Date: Aug 2013
Posts: 71
Rep Power: 13
seju is on a distinguished road
Quote:
Originally Posted by u22 View Post
So, one of possible solutions been found Next step - to check whether the solver with layerAR to work in parallel.
hi
I wanna compile dieselEngineDyMFoam .
plz help me how can I do it?
best regards
Sajad
seju is offline   Reply With Quote

Old   January 15, 2017, 04:14
Default
  #18
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Hi,
I also met the same FPE problem after the first layer addition.
Have you got a solution?
zhangyan is offline   Reply With Quote

Old   March 24, 2017, 11:13
Default
  #19
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Quote:
Originally Posted by zhangyan View Post
Hi,
I also met the same FPE problem after the first layer addition.
Have you got a solution?
YES!

particle tracking & topo changes -> simulation crashes in 1.6-ext
zhangyan is offline   Reply With Quote

Old   July 10, 2017, 03:22
Default
  #20
New Member
 
Qiyan Zhou
Join Date: Sep 2016
Posts: 16
Rep Power: 10
zhouqy1994 is on a distinguished road
Quote:
Originally Posted by u22 View Post
mturcios777, thanks for your comment!

So, my setup in engineGeometry looks reasonable for me. But i still get FPE in layer addition. And no printStack output...

I attached a mesh and pistonLayer facezone pictures for last saved CAD (deformAngle=20)

Why OpenFoam does not produce printStack output in that case?

How to debug what goes wrong with layer addition?

---After a while----

I discover, that moveDyMEngineMesh works fine when it start adding layers after deformAngle CAD.

And dieselEngineDyMFoam crashes in layerAR.C, in

autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh();

....


Hi u77

Since I post the message on the cfd online app, I cannot see you full name... sorry for calling you nickname...
I read your post, and have several questions

My layerAR can run smoothly with full cylinder simulation on foam-extend 4.0,and the results are acceptable. But you know, simulating the full cylinder is really costly, so I try to use the engine sector

The boundary for two sides of the sector is cyclic Ggi (my combustion chamber geometry is a little complex, so cyclic is not suitable...) when define the cyclicGgi boundary conditions, the facezones of the two sides are needed. But after that, the layerAR will skip adding zones since there are already two facezones. As a result, the simulation will crash since no pointzone and pistonlayer zone have been defined.

However, your post is a sector with layerAR, so I want to seek some advice from you about using layerAR with cyclicGgi boundary conditions

Thanks in advance



Sent from my iPhone using CFD Online Forum mobile app
zhouqy1994 is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 15:55.