CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   engine simulation with mesh motion and topological changes (https://www.cfd-online.com/Forums/openfoam-solving/83177-engine-simulation-mesh-motion-topological-changes.html)

abminternet December 16, 2010 11:55

engine simulation with mesh motion and topological changes
 
Hi guys,

I have been trying to figure out how to set up a case for a cold flow simulation of an ic engine. I found a tutorial using an old solver which is no loger present in openfoam 1.6-ext (neither in 1.5-ext), and I would like to learn how to set up a case with the newer OF versions. Has anybody had any success? I am trying my luck with sonicTurbDyMEngineFoam without success. In my first attempt I used mesh motion only without topological changes, using the velocityLaplacian solver, and the piston moved slightly, then I tried setting it up with laplacdFaceDecomposition solver, but it gets stucked as soon as it gets to mesh.update(). I am really not sure if I have set up the case, and it appears to be almost no information on the net or forums, and the little information there is, is for previous versions using libraries that are apparently not there any more. Any ideas???
I would very much appreciate it.

Frederic Muller

Peter_600 December 18, 2010 10:37

Can you send me ur tutorial. I have some experiences with engineDyMFoam for 1.5-dev. I propably can help u, at least with the mesh motion. I know this is a quite challenging topic.

Regards
Peter

abminternet December 20, 2010 04:16

1 Attachment(s)
Hi Peter,

thanks for your reply. I have attached the tutorial file i got for an older OpenFOAM-ext version. there, -270 is the initial time directory, I had to remove the rest of them, except for the last one, because it was too big to upload here, but if you need the rest of the time directories please let me know and I will find a way to upload them. I appreciate any guidelines you could give me.

best regards,
Alberto

faithhidy December 20, 2010 06:26

help
 
Hi Peter,

You said you have experience on the engineDyMFoam in 1.5-dev. Do you mean "icoDyMEngineFoam" ?
Curently, I am also troubled by using "simpleEngine" case to realize the mesh layerAdditionRemoval. If you run it succesfully,please help me.

Can you send me your case? My email address is faithhidy@hotmail.com .

Merry Christmas to you~

Josiah

Peter_600 December 20, 2010 06:44

For the moment I still struggling with installing 16-ext in my system. I will come back to u guys as soon as possible. you can also contact me on my email.

abminternet December 20, 2010 07:16

@Josiah: Hey Josiah, I think we are stuck at the same part. I am trying to use sonicTurbDyMEngineFoam, and am also stuck with the topological changes. Mesh motion without topological changes seems to work, but I have only tried it with the velocityComponentLaplacian solver. Of course this is not enough, there is very little information about dictionary setup, etc, available. If you know anything please let me know, and I'll do the same for you.

@Peter: sure thing, don't worry, if we can be of help, please let us know.

Peter_600 January 8, 2011 07:17

Ok guys. I am ready :) Sorry for the big delay.
I would suggest we open a new group for ic engine simulations. Since something like this doesen t really exist. I opened a discussion group http://www.extend-project.de/user-gr...s/viewgroup/48. Join this group! We can discuss our projects together.

deepsterblue January 8, 2011 09:21

Will something like this work? The only limitation is that you would be restricted to pure tetrahedral / triangular meshes.

http://www.ecs.umass.edu/~smenon/Mov...stonMotion.avi

This stuff is already in 1.6-ext. Look at the circCylinder3d tutorial for some ideas. I can probably try and help you guys set it up, so let me know.

Peter_600 January 8, 2011 13:30

This is great :)
This is exactly what I am looking for. I will like to set up a case. Do u think it is also possible with spray interaction? I would like to simulate a direct injection engine, with spray....
Do you thin it s possible to use it with dieselEngineFoam?

Peter

deepsterblue January 8, 2011 13:35

I'm pretty sure it would be possible. The code for cloudMapping is not in there yet, but I think that should be taken care of with just one line of code. I would suggest getting getting the mesh to work first, then adding a flow solver, and finally adding the spray stuff.

Peter_600 January 8, 2011 13:58

Great :) I will do my best and working hard on it. Hope to provide you guys soon with a solution and of course everyone is welcome in contributing to it.

Peter

abminternet January 13, 2011 05:07

wow that is really amazing, it is also exactly what I am trying to do :) is it possible to do the same with 2 tilted valves? if you could help us set up this case, we would really appreciate it :) I have been trying for a while now, I've only got to moving the piston with layering, but as soon as I introduce the valves (straight in 2D still :( ) it doesn't go past the first iteration. Any ideas??

best regards,
abm

deepsterblue January 13, 2011 08:38

The video there uses two tilted valves - so no problem there. I can probably try and set up a simple demo case, but that might take me a little time, so I may not be able to get to it immediately.

abminternet January 13, 2011 09:27

Thanks I would really appreciate it, I have been struggling with this for quite some time now. Are you using 1.5-dev or 1.6-dev? I guess the setup will be pretty much the same anyways. Don't worry if it takes you a while, any help you can provide now will be very much appreciated. I am really looking forward to seeing how you did that :D

Peter_600 January 13, 2011 13:49

Me too :)
@abminternet
i am working for the moment on a modification of the accordionEngineMesh class. I try to add to the piston motion a layering. If you have experiences in it we can create a new class in the meantime.
Peter

abminternet January 14, 2011 04:54

@Peter: Hi Peter, my programming skills are a bit limited but I would be quite interested on that, but I thought the accordionEngineMesh class already performed layering for the piston, am I mistaken?

Peter_600 January 15, 2011 08:53

I ve done somet simulation with the accordion class. And it uses no layering.
Have u seen someone who did that?
I will try to add it ;) But it will take me a while since I am also not so good in C++. Which strategies do u use for moving the mesh and which version of OpenFoam do u use?

abminternet January 18, 2011 04:20

I haven't actually used it or seen it work, but the description of the class at the beginning of the code says that layers are added and removed for the piston.

perhaps the class is not complete? let me know of your progress and if I can help, as I am also interested :D.
At the moment I am using OpenFOAM 1.6-ext, with sonicTurbDyMEngineFoam.
dynamicFvMesh simpleEngineTopoFvMesh;
solver laplaceFaceDecomposition;
diffusivity uniform 1.0;

it seems it only works with solvers based on the laplace equation for motion. Even though I still don't get past the first iteration :S, it seems to update the mesh, but I'm having troubles with my Temperature Boundary conditions. I am working at the moment with vertical valves while I get to know how it all works, but my aim is to do tilted valves with edge swapping and smoothing, or something similar :D so I'll be glad to see Sandeep's test case :)

deepsterblue January 18, 2011 13:16

I've posted a simple case for tilted valves. Use with moveDynamicMesh. It should be sufficient to give an idea about how it would be done.

You can find the necessary files here:

http://www.ecs.umass.edu/~smenon/tarballs/enginePointPatchFields.tgz

http://www.ecs.umass.edu/~smenon/tarballs/simpleEngine.tgz

It's probably helpful to use ParaView to see how the patches are defined.

Peter_600 January 18, 2011 13:16

Since you are also using 1.6-ext, could you check if the dieselFoam tut runs for you to the end? For me it doesn t. I would like to include this solver, too. So I have to be sure if this is a bug or my Foam verison doesnt work properly.

I am also waiting unpaticently on the test case of Sandeep :)

Peter_600 January 18, 2011 13:25

That was quick ;) Thank you very much. I will have a look on it.

Peter_600 January 18, 2011 14:21

I didn t succeed in compiling the file you have attached. I get this error:

Quote:

Making dependency list for source file derived/timeVaryingDisplacement/timeVaryingDisplacementPointPatchVectorField.C
SOURCE=derived/timeVaryingDisplacement/timeVaryingDisplacementPointPatchVectorField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/triSurface/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/timeVaryingDisplacementPointPatchVectorField.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/triSurface/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/timeVaryingDisplacementPointPatchVectorField.o -L/home/peter/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64GccDPOpt \
-lOpenFOAM -liberty -ldl -lm -o OpenFOAM.out
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/crt1.o: In function `_start':
/usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

deepsterblue January 18, 2011 14:23

Please use 'wmake libso', and not 'wmake'

Peter_600 January 18, 2011 15:04

Thx. It worked. But still doesn t run.
Quote:

Create time

Create dynamic mesh for time = 0

Selecting dynamicFvMesh dynamicTopoFvMesh
--> FOAM Warning :
From function dlLibraryTable::open(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 86
could not load libdynamicTopoFvMesh.so: cannot open shared object file: No such file or directory
Selecting metric Knupp
Selecting motion solver: mesquiteMotionSolver
Selecting quality metric: InverseMeanRatio
Selecting objective function: LPtoP
Selecting optimization algorithm: FeasibleNewton
Outer termination criterion (tcOuter) was not found. Using default values.
Time = 0.0001


--> FOAM FATAL IO ERROR:
file "/home/peter/OpenFOAM/peter-1.6-ext/run/simpleEngine/constant/pistonStroke.dat" does not exist

file: /home/peter/OpenFOAM/peter-1.6-ext/run/simpleEngine/constant/pistonStroke.dat at line 1.

From function IFstream::operator()
in file db/IOstreams/Fstreams/IFstream.C at line 168.

FOAM exiting

deepsterblue January 18, 2011 15:18

Sorry about that. I've been running my development version. Comment out this line in constant/dynamicMeshDict:

dynamicFvMeshLibs ("libdynamicTopoFvMesh.so");

This should pick up the library version on 1.6-ext.

Peter_600 January 18, 2011 15:28

The same error.

deepsterblue January 18, 2011 16:13

/home/peter/OpenFOAM/peter-1.6-ext/run/simpleEngine

Is this being run from that directory? Or have you extracted the tarball to another location? Please post the output error. This is really not that hard to figure out.

Peter_600 January 18, 2011 16:24

I shouldn t work so late ;) Stupid mistake
It runs :) Thank you very much!!!!!

kalle January 19, 2011 04:15

Really cool work, Sandeep! Thanks for sharing :)

Two questions: Can it run in parallel, and can it handle an opening and closing valve?

Regards,
Kalle

deepsterblue January 19, 2011 08:44

Kalle,
- Parallel topo-changes: Not yet, but almost there - few bugs to iron out.
- Valve opening/closure: I think this one's a little easier to figure out. I like the approach of using a GGI interface for valves, along with a run-time modification of GGI patches to wall to define opening/closure events. This could even be as simple as maintaining the GGI patch as-is, and explicitly over-riding the fixedValue/fixedGradient fields to reflect a wall condition.

kalle January 19, 2011 09:15

Thanks for your reply! Nice to hear that parallelization is under way.

I am having some contact with Martin Beaudoin regarding GGI. As it is now, the GGI cannot handle topological changes on the interfaces (as far as I could figure out). This would also be a problem for this case, except the issue with non-overlapping GGI patches you mentioned. Martin said he will have a look at it. Let's see what he comes up with!

Regards,
Kalle

philippose January 19, 2011 16:09

Hello Sandeep (and everyone else),

A Good Day to you :-)!

First and foremost, I must say..... Hats Off to you Sandeep.... this new functionality in OpenFOAM-1.6-ext is really amazing :-)! And its great to see it in action :-)! Thanks a lot for all the effort you have put into it over the last few years!

After seeing the test-case which you posted on this thread, I decided that it is finally time for me to try out something which is more relevant to the areas where I would be using these dynamic re-meshing and mesh optimisation features.

I used the dynamicMeshDict in your test-case as a base, and built up a very simple Poppet Valve test-case with an initial mesh of around 75000 - 80000 tetrahedral cells.

I then prescribed a motion to the poppet using the same special boundary condition which you had included in your test-case.

Initially I focused purely on the dynamic-mesh part of it, and got it moving (along with the re-meshing) using moveDynamicMesh.

Next I included the Fluid part to the simulation :-)! An inlet and outlet pressure, and used pimpleDyMFoam to simulate the case.

And well .... :-)! I was pleasantly surprised to see it work like a charm right on the first try (with the fluid i.e.)..... :-)! Really cool....

I don't know yet if the fluid solution is accurate or not, and I did not pay too much attention to the initial mesh, but I can say.... I have never been able to move that particular simulation case by such a gross displacement without totally destroying the mesh.... Using your solver..... the mesh non-orthogonality never went above 52° :-)! And the simulation is still running as I write this....

As a small demonstration of my test-case, I have put in links to two videos.... one which shows a close-up of the area near the seat of the valve where you can see cells being destroyed and created.... and the second video which actually shows the evolution of the velocity with time...

The quality of the animations are not that great, and please let me know if the links do not work as expected :-)!


* Video - 1
https://docs.google.com/leaf?id=0B0s...0YWQ1&hl=en_GB

* Video - 2
https://docs.google.com/leaf?id=0B0s...xNDUz&hl=en_GB


Now.... for two questions:

1. Is there a small document which kind of roughly explains what each of the different options in the mesquiteSolver and dynamicMesh dictionaries do and how they influence the capabilities of the library?

2. What are the particular disadvantages of the current fluid side field mapping algorithms you have implemented, and are you looking at improving them significantly over the next year or so, or are these algorithms already robust and accurate enough for normal use?


I wish you a great day ahead :-)!

Philippose

deepsterblue January 19, 2011 16:23

Philippose,
Great to see it being put to work... You could also do this in 2D, with a triangle-prism mesh.

1. The circCylinder3d tutorial should provide a rough guide for all available options. If something's not clear enough, post it here, and we can look into it.

2. The remapping in the current version on 1.6-ext is a simple inverse-distance based remap that's fast and reasonably accurate, but not conservative. My development version has an improvement that I'll put in at a later stage.

abminternet January 21, 2011 04:38

1 Attachment(s)
@deepster: hey Sandeep, thanks for posting the case, I will have a look into it :D

@Peter: hi Peter, I ran the dieselFoam case, it crashes almost at the beginning. I guess it has something to do with the thermoPhysical properties, I hope it is nothing serious because I get a similar error when running sonicTurbDyMEngineFoam. I attach the log file here. As for the accordionEngineMesh class, does that mean they just put it in the description but didnt really implemented it? well and now to work on sandeeps test case!! :D let me know also about the accordionEngineMesh class, I will also try to have a look into it :)

Peter_600 January 24, 2011 14:49

I got exactly the same error. I also hope it is nothing serious.
Indeed it is written but not implemented. I am working on it. I think I am close to the solution. i keep you posted.
Peter

Peter_600 January 26, 2011 08:43

I think it is not necessary anymore to implement the piston layers to the accordionEngineMesh class. I think the thobois class is exactly that what I need. Does anyone knows something about it. I think it is the same as the accordionEngineMesh class, except it uses a layering for the piston movemoment.
I am struggling since one several weeks with implementing it into the accordionEngineMesh class. I hope this class can everything what I need :)

abminternet February 3, 2011 05:48

@Josiah:

Hey Josiah,

I am making some modifications to the simpleEngine case, and would like to know how you found out the number (ID) of the detachFaces in the constant/engineGeometry file.

Thanks

faithhidy February 4, 2011 11:26

Muller,

You can find them in polyMesh/faceZones file in ''constant" easily ( detachFaceZoneV1/V2). You can define them by setting faceSetsDict in "system".

Happy chinese new year~

Josiah

abminternet February 21, 2011 07:16

engine compressible solver with mesh motion and topo changes
 
hi foamers,

is anyone doing or has anyone done any simulations with mesh motion and topological changes for IC engine simulation??? i have done a few runs of the simpleEngine case with an incompressible solver just to observe the cold flow, but the results are still not good. Mesh moves and everything, but velocity field doesnt look very real, even for an incompressible solver. Then I decided to use a compressible one, sonicTurbDyMEgineFoam, which is the one I wanted to use anyway, but I keep getting the following error:

From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const
in file /opt/software/openfoam/extend/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73
Maximum number of iterations exceeded. Rescue by HJ

Any suggestions??? I have been stuck here for a long while already, any help will be appreciated.

Peter_600 February 21, 2011 13:57

Hi abminternet

Yes, I succeed in doing an IC engine simulation with engineDyMFoam and the accordionEngineMesh class but wit 1.5-dev. I ve created an IC engine group at http://www.extend-project.de/ in order to discuss and gather all questions related to engines. I would like to have a look on your case.

With 1.6-ext I didn t run a case so far. I ve converted my stuff to 1.6-ext and it didn t work. I am working on it.
Peter


All times are GMT -4. The time now is 03:47.