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 April 18, 2011 06:00

ok I must be missing something, I keep getting the same error, do I need the dynamicFvMeshDict? it seems like perhaps I need to remove '# include "dynamicFvMesh.H" ' from my solver, but then that brings other errors, like, createDynamicFvMesh.H does not work any more :S

abminternet April 18, 2011 06:50

wait, I modified the solver, I think I answered my own question :p

abminternet April 18, 2011 06:59

hey Peter, so I modified the solver to be able to use engineTopoChangerMesh, and seems to compile alright, do you maybe have a test case I could run? there are many keywords I need to add and I'm not familiar with :S Would appreciate it :D

Peter_600 April 18, 2011 07:13

Try to replace # include "createDynamicFvMesh.H" with
# include "createEngineDynamicMesh.H"
in the sonicTurbDyMEngineFoam. C file and recompile.

Peter_600 April 18, 2011 07:31

I don t have a test case. But feel free to post any question you have. We may debug it together here.

abminternet April 18, 2011 07:54

great :) I have one :D well I am testing verticalValves now but perhaps you know, it asks for valveHeadPatch, but also for poppetPatch, I thought they were the same, so I know what is the poppetPatch from my simpleEngine test case, but do u know what is the valveHeadPatch?

Peter_600 April 18, 2011 08:38

http://powerlab.fsb.hr/ped/kturbo/Op...Zagreb2007.pdf
Maybe this can be useful for you.

Peter_600 April 18, 2011 08:54

Try for valveHeadPatch -> none;

abminternet April 18, 2011 10:34

thx for the tutorial :) so one quick question, what is the difference between valveTopTol and deformationLift? they are from the class verticalValves and engineVerticalValves respectively, but from the definition, it looks like they both do the same thing, disable top layering for the valves when lift < valveTopTol (or deformationLift).

jajcevic May 20, 2011 14:30

1 Attachment(s)
Hi guys,
I have started the tutorial "simpleEngineStem" posted by abm, but after only several time steps following error occurs:

"Floating point exception"

I am using 1.6-ext and "sonicTurbDyMEngineFoam".


Do you have any idea why I can not successfully run this tutorial?

abminternet May 23, 2011 10:55

hi Peter,

could you send me the engineGeometry file you used for your accordionEngineMesh class and for the verticalValves too? I would really appreciate it :D

Peter_600 May 23, 2011 14:57

Hi,

no problem. Here is my engineGeometry file for the accordionEngineMesh class. U will find a lot of things which are not used by the class, but the class requires an entry for it in the script. I didn t check which entry is really needed, thus I used it always like that. I will highlight the parts which are important for you.

I don t have a file for the verticalValves class.

Peter
Quote:

conRodLength conRodLength [0 1 0 0 0 0 0] 0.161;

bore bore [0 1 0 0 0 0 0] 0.084;

stroke stroke [0 1 0 0 0 0 0] 0.09;

clearance clearance [0 1 0 0 0 0 0] 0.0014;

rpm rpm [0 0 -1 0 0 0 0] 2000;



cylinderHeadName cylinderHead;
linerName liner;
pistonAuxPoints pistonPoints;


moveDetach on;
correctPointsMotion yes;

delta 0.0001;
offSet 0.0005;

valveTopTol 1e-3;
bottomValveTol 5e-3;
poppetValveTol 5e-3;
checkMesh on;
cylinderSetName cylinder;


engineTopoChangerMesh accordionEngineMesh;

deformAngle 34;

piston
{
patch piston;
// patch none;

coordinateSystem
{
type cartesian;
origin (0 0 0);
axis (0 0 1);
direction (0 1 0);
}

minLayer 0.0005;
maxLayer 0.0015;
pistonCellSetName emptyfaces;
pistonFaceSetName emptyfaces;
pistonPointSetName emptyPoints;

bowlInPistonPatchName off;
bowlInCylinderPatchName off;

}

accordionEngineMesh
(
valve1
{
coordinateSystem
{
type cylindrical;
origin (-0.0203 -0.015518978 0.097944030);
axis (0 -0.258819 0.965926);
direction (1 0 0);

}
bottomPatch valve1_intake_bottom;
poppetPatch valve1_intake_top;
stemPatch valve1_intake_stem;

sidePatch off;
minLift 0.00025;
curtainInPortPatch off;
curtainInCylinderPatch off;
detachInCylinderPatch valveDetachInCyl1;
detachInPortPatch valveDetachInPort1;

valveHeadPatch off;
detachFaces detach1;
detachDistance 0.95e-8;
detachTol 0.005e-8;
stemEdge (0 0 0);
diameter -10;
deformationLift 0.005;
liftProfileFile valve1.lift;
staticPoints valve_fixed_points_1;
movingPoints valve_moving_points_1;
movingInternalPoints valve_moving_inernal_points_1;
staticCells valve_fixed_cells_1;
movingCells valve_moving_cells_1;

}

valve2......
.......
);

abminternet May 24, 2011 13:41

Hi Peter, thanks a lot!! it is very helpful. I've got a couple of questions though:

When you set a variable to off, does that actually turn it off in the motion solver, so that it won't use it?
Also, what is the difference between the movingPoints and movingInternalPoints for the valve?

and the pistonCellset, pointSet and faceSet, what should they contain? the cells in the piston bowl but not the cylinder maybe?

thanks a lot for your help :)

Peter_600 May 24, 2011 17:36

Hi
First of all, do you have a mesh which has a similar designed like this?

http://www.engines.polimi.it/images/...eMotionGDI.gif

Which tools did you use to create the mesh? It is crucial to have a folder (named sets) in the polyMesh folder which conists all the different regions. For instance, I create the meshes in Gambit and name the boundaries directly there. Than I use
Code:

FluentMeshToFoam -writeSets
and the sets folder is automatically created with the required files. Do you follow a similiar approach?

Peter

abminternet May 27, 2011 06:19

Hi Peter,

I am following a similar approach, but I am using Ansa for meshing. The thing is, I haven't really done it before and am not sure if I can write out the sets from ansa. So the moving points would be the points moving together with the valve, and the movingInternal points would be the ones were layering is being done on the picture? Is there some kind of documentation on this?

vangelis May 28, 2011 05:07

Hi there,

I would like to help on the ANSA part of the issue.
I assume you are using ANSA v13.1.3
and that you are starting in CFD mode.
If you want to create SETs of nodes or elements
in ANSA for OpenFOAM you should do the following.

Activate the SET button at the top main toolbar
Press NEW
The selection mode window opens
you can mark if you want to select Nodes or Elements
or Properties
Select from the screen the entities you want to load
in the SET and confirm with middle mouse button.
The SETs card opens
Type in the name of the SET and press OK
The SET is created and displayed in the list

Now you can output in OpenFOAM format
In the output options window
activate the Output Sets flag.

ANSA will create the sets folder inside polymesh
as needed

Hope this helps

Vangelis

abminternet May 30, 2011 06:46

wow great tipp, thanks a lot :D

vangelis May 30, 2011 07:10

Let me know if you need anything about ANSA

abminternet May 31, 2011 04:47

Thanks Vangelis, I do have a question, how do I create facesets in ansa? I need a set of internal faces, and I tried with the volToshell function to transform them to a shell and then selecting them in the sets option, but when I tried to write the mesh out, I didnt see the "write sets" option, and indeed the set was not written :( any ideas? Would appreciate it :D

abminternet May 31, 2011 05:39

Hi Peter, I've also got a question for you, hope I'm not causing too much problem. Which faces would you set as the attach/detach faces? I mean, in the test case I did, the faces were at the very entrance of the port, but this faces were not moving. So, is it possible to select faces which are in the valve curtain for example? or faces in the layering zone, etc? Say in the picture you posted, which ones would be the attach/detach faces?

vangelis May 31, 2011 05:43

Hi there,

The "Output Sets" option was introduced
in ANSA v13.1.2, so if you have an earlier
version you will not see it.

I would recommend that you get the latest
one which is v13.1.3.

If you also want internal faces, you can indeed
create them with VOL-SHELL and then assign
them to a PID of type INTERNAL (you can do this
if you edit the PID card).

These elements will then be output in the faceZones
file. I believe you can then change this into a SET
using openfoam utility tools.

Best regards

Vangelis

abminternet May 31, 2011 06:33

Great thanks, you were right, I was using the wrong version :D now it works like a charm, it even writes the sets itself, no need to do zones to sets :D

vangelis May 31, 2011 07:02

you are welcome

abminternet May 31, 2011 18:19

Hey guys, so now that i can do sets, (thanks again vangelis :D ) it turns out I may be doing them wrong. The piston does not move, the cells that are supposed to move with the valve just get streched (only the points in contact with the valve top move), and the cells that are supposed to move and layered do nothing :S. So maybe I got it wrong. The pistonAuxPoints are the points that are supposed to move right? So that would be for example all 8 points of each cell in direct contact with the piston??
also, what is the cylinderSet, is it every other cell in the cylinder that does not contain those points? (that would mean the layer of cells just above the piston cells are not in the cylinderSet either?

and for the valves, staticPoints are the points belonging to the tetra cells above the hexas? and the movingInternalPoints, are they the points belonging to the hexa cells for layering? and the
movingPoints are then the lower tetra cells, the ones that move together with the valve?, and also the staticCells and movingCells, they correspond to the staticPoints and movingPoints i guess.

sorry that i ask so many questions, i just feel i am so close to making it work. Any help would be greatly appreciated

kind regards

abminternet June 1, 2011 08:33

hi everyone, so, after reading the code carefully, I have one question. Is the code even complete? It seems like it is not :S

Peter_600 June 9, 2011 09:00

Hi,

sorry I am a little bit busy at the moment. I ll come back to u the days with a small instruciton for the accordionEngineMesh class.
Could you post a figure of ur grid ?

thx
Peter

abminternet June 10, 2011 05:29

Hi Peter
 
No problem. My mesh looks like the picture. It is a simplified 2D mesh of my 3D case. I am using it for testing. The valve is not really tilted, but it is just a test, so I guess it should work just the same way, cause the axis and direction of the valve are specified. :) Well good luck with all the work, I guess I'll hear from you when you are a bit more relaxed.

abminternet June 10, 2011 05:30

1 Attachment(s)
forgot the pic, here it is

_DF_ August 17, 2011 10:58

Hi,

Is there sonicTurbDyMEngineFoam solver for OpenFOAM 2.0.1?

Paebin November 29, 2011 11:11

Hello everybody,

I have downloaded the simpleEngine case and it works great. It is a good example to understand the preparation of a dynamic mesh case in openFoam.

But in fact I'm more interested by the flow inside an injector than in a whole combustion chamber. I would like to move the injector needle, so I have to use a dynamic mesh. I don't need engineTime, I have no piston and my valve does not have a bottom, but my case is really similar to an engine valve (need sliding, layering and attach/detach). For that, and to start, I used the original linearValveLayersFvMesh class. But The attach/detach feature is not included in this class, so I have mixed linearValveLayersFvMesh and simpleEngineTopoFvMesh in order to add it.

I have tested my mesh with moveDynamicMesh and it works great. But with the interDyFoam multiphase solver, I have a problem with attach/detach, I got a "Floating point exception" during the first time step in both RANS (K-epsilon) and LES (oneEqEddy). If I switch off the turbulence in RANS or use laminar with attach/Detach, it works. If I use turbulence (RANS or LES) without attach/Detach (by removing all the faces in the "detachFaces" dict), it works too. I'm using 1.6-ext (updated last week).

My problem seems really similar to the one in the beginning of this thread but the simpleEngineStem case works on my computer, so the problem should be solved. Did anyone try to use attach/Detach with interDyFoam ?

Regards,
Fabien.

Abhishekd18 January 11, 2012 23:38

Seqmentation fault in engineTopoChangerMesh layerAR
 
Hi,

I am trying to run dieselEngineFoam_Scania case with layering. I have done the necessary changes in dieselEngineFoam solver and created dieselEngineDyMFoam solver. But I am getting segmentation fault in first time step. It seems that the solver enters mesh.update() and doesn't come out which is causing segmentation fault. Can anyone help on this problem?

My mesh is not the sector mesh. I have extruded it 360 deg full so I don't have cyclic boundaries.

kaparzo-shb January 27, 2012 21:31

HCCI geometry
 
Hi, every one,
please i need a engine 3d chamber gemetry for running un test of my film model. am working with Gambit and fluent.

Thanks.

Abhishekd18 February 10, 2012 04:57

dieselEngineFoam solver crashes in parallel at the start of injection
 
Hi,

I am running dieselEngineFoam in parallel on 4 processors. But as the spray injection starts the solver crashes. The setup runs perfectly fine in serial. I am using OpenFoam 1.6 ext. Can anyone help me on this?

Thanks.

Abhishekd18 February 15, 2012 07:10

Hi, everyone,

Does anyone know how openFoam maps fields while using layer Addition? I am using openfoam 1.6-ext dieselEngineFoam. The solver crashes (Floating point exception) when layer addition starts. Velocity magnitude is very high 7783 m/s and courant no. is also high. I think it is related to mapping fields after adding the layer.

Please reply if anyone knows anything about this.

Thanks.

deepsterblue February 15, 2012 08:44

Mapping fields for layer addition is meant to be relatively straightforward - All cells in the new layer are inflated from zero-volume.

Are you using adaptive time-stepping?

Abhishekd18 February 15, 2012 10:29

Yes. I am using adjustable Time Step. I am limiting max courant number to 0.1. But after layer addition it shows maxCo = 1.8 something.

deepsterblue February 15, 2012 10:35

You might want to manually print out the velocity field in the newly created cells (and face-fluxes phi for newly created faces) after the mesh-update to ensure that it looks reasonable.

Is this in parallel? If so, you might have to ensure that the partitioning is perpendicular to the motion-axis, since layer-addition / removal is known to be finicky there..

Abhishekd18 February 15, 2012 11:01

I have done manual decomposition which takes care of the direction of motion of piston, cyclic boundaries and layering. In fact, it runs perfectly fine when piston moves from BDC to TDC. The problem starts during expansion stroke when layering starts.

But the solution crashes after layer is added. I don't have even single time step after layer addition so that I can plot the velocity field.

deepsterblue February 15, 2012 11:05

That's because your runTime.write() is after your solution loop. Place it after the mesh.update() call, and you'll get the mapped field written out to disk.

You'll have to roll-up your sleeves and write some code for this.

Abhishekd18 February 15, 2012 11:18

Ok. I will do that.

What should I do after that?

What kind of code do I have to write?

And few more questions
1. When I modified dieselEngineFoam for layering, I did it as it is done in sonicTurbDyMFoam. But the solution diverges when layering starts. When I commented the statement "# include compressibleCorrectPhi.H" it runs perfectly fine. As far as I understood, compressibleCorrectPhi.H solves pressure correction after mesh change and it should be included.

2. While running in parallel, the solution crashed at the start of injection. When I started debugging the code, it turned out to be some problem with the statement "# include findInjectorCell.H" in sprayInject.C. Again on commenting the line, the solver runs and I can see the spary injected from the desired location.

What could be the reasons?


All times are GMT -4. The time now is 23:36.