CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Sliding Interface for engine simulations in OF 1.6-ext not working!! (https://www.cfd-online.com/Forums/openfoam/89456-sliding-interface-engine-simulations-1-6-ext-not-working.html)

abminternet June 13, 2011 12:29

Sliding Interface for engine simulations in OF 1.6-ext not working!!
 
Hi,
I am trying to set up a 3D case of an engine using sonicTurbDyMEngineFoam, and the simpleEngineTopoFvMesh library, but it seems to have troubles with the sliding interface. In the 2D model done with blockMesh that I have, there is no problems, but of course, I declare the nodes corresponding to the valveCurtain on the port and cylinder side twice. In my 3D case, I can't do this since I can't use blockMesh so I do different meshes, one on the cylinder side and one on the port side. Of course there is no 100% correspondence in the nodes of one side with the ones in the other, but there shouldn't be right? After all it is an interface. So anyway when I try to move the mesh (I use moveDyMEngineMesh for that, I get the following error:

--> FOAM FATAL ERROR:
Cannot determine best atan point. Doing face: 8(341038 343492 315477 342504 342498 315158 315187 315506) position: 8((0.0149632 0.0296278 -0.000179636) (0.0149746 0.0296291 -0.000181112) (0.0149626 0.029633 -0.000621048) (0.0149623 0.0296355 -0.000725428) (0.0150071 0.0292114 -0.000721191) (0.0150074 0.0292089 -0.000621048) (0.0150143 0.0291975 -0.000181112) (0.0149754 0.0296224 -0.000181112)) Cur point: 2808 position (0.0149632 0.0296278 -0.000179636) Next points: 3(4578 1971 1982) position: 3((0.0149746 0.0296291 -0.000181112) (0.0149754 0.0296224 -0.000181112) (0.0149234 0.0300459 -0.000181112))

From function void enrichedPatch::calcCutFaces() const
in file polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line 277.

FOAM aborting

any ideas? I am really stuck. Any help would be greatly appreciated.

abminternet June 13, 2011 12:31

Forgot to say, I also get sometimes the following error:

--> FOAM FATAL ERROR:
Error in point ordering: mixed used and unused points at the end of point list.
Last used point: 342613 (-0.00971171 0.0164894 -0.00451531)
First unused point: 342614 (-0.0100352 0.0167666 -0.00451531)
and point 343782 (0.0128704 0.0202011 0.00089242) is used by a live face.
Face 955211 4(343792 340112 340111 343782) with points 4((0.0130863 0.0205699 0.000890163) (0.0130861 0.0205699 0.000350817) (0.0128675 0.0202027 0.000352848) (0.0128704 0.0202011 0.00089242))
Done.

From function void polyMesh::initMesh()
in file meshes/polyMesh/polyMeshInitMesh.C at line 174.

FOAM aborting

kalle June 14, 2011 02:41

1 Attachment(s)
Hi!

I've also seen these errors quite a lot. As relief I have found that it helps to have similar mesh density on both sides of the sliding interface. Further I is important to have the two interfaces in the same plane. For cylindrical (I guess your valves are round) sliding interfaces this means you should assure that the points on your patch are all on the same radius... Meshers are usually not that accurate, so the user needs sometimes to manually move the points. I have attached a tool for this I made some time ago. It will not work for cylinders which: 1) axis is not in z-direction and 2) center is not on the z-axis... once the code is understood, it should not be any problems to modify it (I guess all your valves are not in the center) though.

Good luck,
Kalle

abminternet June 15, 2011 06:27

great :) I'll give it a try, thanks. Maybe you can help me with something else, it is actually the first time that I set up the sliding interface for a real case, before I did it with blockMesh, and I just declared the points for the sliding interface patches (valve curtain) two times and it worked. But now I have the meshes with ansa. I have read that people say they use mergeMesh or stitchMesh to set up interfaces, do you anything about that? I thought opening both meshes in Ansa and saving them as one would be enough.

best regards,
abm

kalle June 15, 2011 09:35

Hi,

please find out if the tool is useful. It is a bit ugly written as it is "turning itself inside out" to get hold of the points to move. There are easier ways to go about the problem, but I did not have the time to fix it.

The stitchMesh tool is a front-end for sliding interfaces. I do not know why people would use it to set up a sliding interface, except for the purpose of testing if the meshes can be stitched (which is sometimes useful as it may not always work as you have found out above). Setting up a sliding interface only requires specifying the names of the patches involved. (if you stitch them together, the patches will vanish and you have no way of setting the sliding interface up afterwards.)

You say you import and joins the meshes in ansa. I do not know much about ansa, but just joining two meshes you can use mergeMesh. It will not connect the two meshes, just put them in the same points/faces/owner files, and checkMesh will report the mesh contains two regions. That is generally what you want initially when using sliding interfaces.

Feel free to ask more questions as they pop up!

Regards,
K

philippose June 15, 2011 17:26

Hello Kalle,

A Good Day to you!

I happened to be browsing through the posts, and came across your post regarding the sliding interface and the intended function of the stitchMesh utility.

I use stitchMesh quite often, and would not really consider it as simply a front-end for the sliding mesh interface. Rather, I would say, that stitchMesh is a utility which makes use of the sliding mesh library.

Basically, stitchMesh joins two or more individual meshes together, by reconnecting the patches in contact with each other such that the overlapping faces become faces internal to the mesh, and the non-overlapping faces remain in the original patches.

It just happens, that since the sliding interface in OpenFOAM also uses the same concept, stitchMesh piggybacks on this library to achieve its goal.

Some of the uses of this kind of mesh stitching are:

1. To connect up meshes which have different mesh densities.... You might need a specific part of your mesh to be much finer than the others.

2. To connect up meshes with different cell types or meshed using different meshing tools or concepts..... You might have parts of the entire geometry meshed using a structured mesh, and other more complex parts meshed using unstructured meshing concepts.

3. To perform a series of simulations at different discrete positions or orientations, in which case you would use transformMesh to reorient parts of the mesh, and then use stitchMesh to put them together.

4. In order to be able to put together a very large mesh which would be cumbersome or impossible to mesh in one shot as a whole because of memory or system constraints.

And so on......

I am sure others can come up with more uses for stitchMesh :-)!


Its really interesting that you found one of the possible reasons why sliding mesh interfaces might fail!! I have also had trouble multiple times.... sometimes with stitchMesh failing when one part of the mesh has been translated by a some amount.

I shall try using your concept of making both meshes coplanar.... In my case too, the interfaces are primarily cylindrical, and I should put together a small utility for forcing points to a given radius.


Thanks for the insight, and have a nice day ahead :-)!

Philippose

kalle June 16, 2011 02:28

Hi Philippose,

A good day to you :-)

Thank you for clearifying this! Sure, stitchMesh is a very handy tool for a lot of mesh operations, I formulated myself somewhat ignorant.

I just wanted to clarify what it might be used to when setting up sliding interfaces. If people who are new to sliding interfaces hear that stitchMesh can be used setting the sliding interface up, they might, for instance, try use it to stitch the interface together before they start their simulations. Then it won't work...

Regards,
K

abminternet June 16, 2011 07:08

Hi guys,

I just wanna say I already made the appropriate modifications to kalle's program, and set up the case, it seems to be running just fine :D It is still running but doesn't seem like it'll have any problems, I hope :) Thanks again for this handy utility kalle!!

abminternet June 16, 2011 12:01

Hi guys, I got the first error on my case :( Actually, I have to say, I am running two cases, the first one is like the first image, I just simulate the cylinder with piston, and the bottom of the valve, so the valve moves, but there is only the bottom of it, and this case is a bit slow but still running. Then, as you can see in the second image, I added the rest of the valve, so the cell layer that is on top of the valve seat also comes in contact with the valveCurtainCylinder patch of the sliding interface. So I used Kalle's program to align my valveCurtainCylinder and valveCurtainPort, and it runs until 13.6 CAD, layering on the piston starts at 10 CAD (in case it is useful to know). But then I get the following error:

--> FOAM FATAL ERROR:
Cannot determine best atan point. Doing face:
11
(
23368
23457
23458
23456
21506
21494
23462
23464
23463
23366
239
)
position:
11
(
(0.0102205 0.0170397 0.00088472)
(0.0102211 0.0170401 0.000552161)
(0.0102219 0.0170409 2.70768e-05)
(0.0102226 0.0170417 -0.000474441)
(0.0102662 0.0169944 -0.000566257)
(0.00820917 0.0153866 -0.000548567)
(0.00816982 0.0154468 -0.000472886)
(0.00816883 0.0154461 2.91591e-05)
(0.0081678 0.0154454 0.000555474)
(0.00816716 0.015445 0.000892139)
(0.00953105 0.0163524 0.000881636)
)
Cur point: 537 position (0.000837689 0.0130237 0.0008765) Next points: 3(29 657 27) position: 3((0.00143819 0.0130219 0.000875007) (0.000837674 0.0130236 0.000557639) (-0.00152063 0.0130309 0.000882362))

From function void enrichedPatch::calcCutFaces() const
in file polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line 277.

FOAM aborting


Any ideas?? I would really appreciate it.

Best regards,
abm

abminternet June 16, 2011 12:05

only valve bottom
 
1 Attachment(s)
this is just the cylinder and valve bottom

abminternet June 16, 2011 12:06

complete valve
 
1 Attachment(s)
this is after adding the rest of the valve

kalle June 17, 2011 03:56

Hi again,

I've experienced similar issues, but without finding a water proof solution. The method of moving the patches to the correct radius is the only countermeasure I know of...

Else:
You can try to switch on debug for both sliding interface and layer addition removal (/etc/controlDict) to see if, for instance, the error comes at the same time as layering is performed.

Go find the position (using paraview) where the error is indicated - something looks strange there?

Turn off layering for those layers who is stretching (compressing layers will get inverted cells if layering is turned off)

During layering and mesh motion: Are you sure your sliding interfaces stay at the radius they had initially?

Turn off sliding interfaces and let the layering run alone. Check intermediate results in paraview, using checkMesh, and maybe my program too see if the patches needs re-alignment.

Just a few things you can try checking... the error may be elsewhere too. Let us know your progress!

Good luck,
K

abminternet June 20, 2011 11:51

Hi guys,

well, it seems to me that it is not the layering. I reduced the minLift in the engineGeometry file, I set it to the smallest lift my valve has, which is 0.000092 and now it crashes at time 1.2. My timestep is 0.2, so it just lasts about 6 timesteps :S. Checkmesh is ok for -constant, but for all time folders, including he first, it reports errors of skewness and nonorthogonality, and the number of cells with errors increases as timestep increases :S I have no idea how I can fix this. I am setting it up with three meshes. First I merge the cells directly below the valve and those above the valve, then I align the curtain patches with Kalles program (thanks again for that). Then I merge the resulting mesh with the rest of the cylinder and realign the curtain patches to the valve radius. That's it, then I run it and it crashes :S Any ideas? I'll let you know if I manage to figure out what is wrong...

Best regards,

abm

abminternet June 20, 2011 12:29

ok I get this lines in the output:

bool layerAdditionRemoval::changeTopology() const for object valveBottomLayer1 :
Layer thickness: min: 0.000440998 max: 0.000460247 avg: 0.000448184 old thickness: 1e+15
Removal threshold: 0.000225 addition threshold: 0.00045

It corresponds to the last timestep, where it crashes. It is obviously wrong since the valve Bottom layer thickness can't be 1e+15. It must be calculated to this value because of bad mesh deformation, I guess, this is 1.4 CAD, layering starts at 10 CAD

kalle June 21, 2011 07:43

Hi again,

If my memory do not fail me now, the 1e+15 thickness is used as initial value when there has not been any layering done yet (so there is no info of previous thickness)

Let us know if you get further... else, GGI should work for you as long as you keep both patches perfectly overlapping each other.

K

abminternet June 21, 2011 11:52

Hi guys,

well actually I am also trying to set it up with GGI. The thing is, I am doing first a 2D case for that and can do it if I don't have attachDetach faces, but if I set it up with attachDetach faces, I get an error on the second iteration saying:
--> FOAM FATAL ERROR:
Problem with patch-to zone addressing: some patch faces not found in interpolation zone

From function void ggiPolyPatch::calcZoneAddressing() const
in file meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C at line 77.

FOAM aborting

I really don't know what happens, the boundary file is set up correctly, if it weren't, the first iteration wouldn't run. Could it be that when the attachDetach faces come into play, because the boundary changes, the GGI somehow has problems with this?

Also, with regards to the slidingInterFace problem, I think I'm gonna try to reproduce the problem in 2D. Could it be that the problem is because on the cylinder side of the sliding interface, the cells are much more thicker than the cells on the port side? maybe because of this it can't couple them... well I'm just gonna try to reproduce it and let's see...

cheers,
abm

sasanghomi March 29, 2013 07:39

1 Attachment(s)
Quote:

Originally Posted by kalle (Post 311884)
Hi!

I've also seen these errors quite a lot. As relief I have found that it helps to have similar mesh density on both sides of the sliding interface. Further I is important to have the two interfaces in the same plane. For cylindrical (I guess your valves are round) sliding interfaces this means you should assure that the points on your patch are all on the same radius... Meshers are usually not that accurate, so the user needs sometimes to manually move the points. I have attached a tool for this I made some time ago. It will not work for cylinders which: 1) axis is not in z-direction and 2) center is not on the z-axis... once the code is understood, it should not be any problems to modify it (I guess all your valves are not in the center) though.

Good luck,
Kalle

Hi Karl ,

I have an error similar to abminternet...Can you explain how can I use your utility?
I am simulating an engine with sonicTurbDyMEngineFoam and simpleEngineTopoFVmesh library...
I imported the mesh from GAMBIt to OPenFOAM..when I ran the cae I had below error:
Code:

--> FOAM FATAL ERROR:
Cannot determine best atan point.  Doing face: 5(99740 325 130 63594 99810) position: 5((2.76426 0.993757 0) (2.73987 2.75152e-15 0) (2.73987 2.75152e-15 -0.000249261) (2.76186 0.993863 -0.00025) (2.76426 0.993757 -0.000249261)) Cur point: 65 position (2.73987 2.75152e-15 0) Next points: 2(0 704) position: 2((2.73987 2.75152e-15 -0.000249261) (2.76426 0.993757 0))

    From function void enrichedPatch::calcCutFaces() const
    in file polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line 277.

FOAM aborting

Aborted (core dumped)

I appreciate your help
Thanks and best regards ,
Sasan.

dreamilam April 29, 2013 15:44

Hi Foamers,
I am also trying to do a 3D engine simulation and I have no clue how to define the sliding interface. I was able to define all the other patches. can someone tell me how to define the valve curtains?? I am using snappyHexMesh for meshing.http://file:///home/kaipulla/OpenFOA.../case/Tvs1.png


All times are GMT -4. The time now is 02:11.