CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Stratified Charge Engine Combustion Chamber Design (http://www.cfd-online.com/Forums/openfoam/95057-stratified-charge-engine-combustion-chamber-design.html)

AdamL December 4, 2011 22:57

Stratified Charge Engine Combustion Chamber Design
 
Hello OpenFOAM world,

I am new to the forum and to OpenFOAM. I'm getting started on an engine simulation. I would greatly appreciate any insight from those of you who have run engine simulations. Here's a little background on my project:

For my capstone project my team and I are redesigning the combustion chamber of the engine of our SAE Supermileage vehicle to facilitate stratified charge combustion.

The ultimate goal for the model is to simulate airflow and the fuel spray to guide the design of the combustion chamber. Our advisor has suggested that we keep the fuel spray model as simple as possible -- he suggests modeling the spray with solid spheres.

How difficult would it be to implement something like what's used in dieselFoam?

Currently I am working on getting the moving mesh working. My first goal is to model just airflow during compression and expansion strokes. Later I will add in the fuel spray. I am having a hard time finding any documentation on how the moving engineMesh works. The mesh in KivaTest is structured in layers and it moves like an accordian. My best guess is that the points and faces is just being mapped to the new position. I also see that you define the patches for the piston, the liner and the cylinder head.

How does this engineMesh work?
Do I simply create a mesh, define patches, and set the engineGeometry object ?
Does the orientation of the mesh matter?
(ex. Does the axis of the cylinder have to be aligned in a particular direction)

Thanks in advance for your help! :)

AdamL December 5, 2011 17:02

Anyone familiar with the engine mesh utilities?

Does anyone know of any good documentation on engineMesh?

For now I will make a mesh and assume that the mesh is remapped in-between time steps based on the position in relation of the piston patch. I'll you know how that goes.

mturcios777 December 5, 2011 18:50

The cylinder axis must be aligned with the z-axis, and you must have the specified patches defined for the mesh motion to work.

With the modeling of the spray, you have a huge degree of customization through the sprayProperties and injectorProperties dictionaries. The modeling of sprays in OpenFOAM uses Lagrangian particle tracking, which is what I believe your advisor is suggesting.

AdamL December 5, 2011 19:14

Thank you mturcios777. That's good to know.

What my advisor is suggesting is that we model with solid partials rather than particles that can breakup and evaporate. He wants us to keep it simple.

I am I correct to think that the composition of the mesh in the cylinder is unimportant? i.e. Is there any specific structure the mesh must have in the deforming portion of the cylinder?

mturcios777 December 5, 2011 19:53

I've only ever used layeredMesh with structured hex mesh (in the compression region). There is a lot of flexibility, but with that comes the possibility that the particular combination you want may not work. For a student project, I would recommend to sticking to what works and keep it as similar to the tutorial as possible.

You can specify the breakup and evaporation models in sprayProperties, including having none at all.

AdamL December 10, 2011 23:35

I'm happy to report that I have gotten my mesh working with the coldEngineFoam solver. Now onto a convergence study and then spray modeling.

AdamL December 21, 2011 00:28

Is it possible to use the injection model without evaporation, breakup and chemistry?

mturcios777 December 22, 2011 13:26

Yes. As I said earlier, have a look at the sprayProperties and injectorProperties dictionaries in the constant directory to change (or turn off) the spray, breakup, heat transfer and other such models. Chemistry calculations are controlled by the chemistryProperties dictionary.

AdamL December 28, 2011 14:41

What entries necessary in the thermoPhysicalProperties dictionary when using thermoType hsPsiMixtureThermo<multiComponentMixture<gasThermo Physics>> ?

mturcios777 January 2, 2012 19:43

Happy New Year (I've been on holiday and haven't been on the forum)!

If you look at the thermophysicalProperties file from the dieselFoam tutorial ($FOAM_TUTORIALS/combustion/dieselFoam/aachenBomb) will be a file sufficient to run. Note that you will need a chemkin folder and chem.inp file: just copy the folder over and you should be fine.

AdamL January 6, 2012 13:21

1 Attachment(s)
Happy New Year!

I have good news...

Air is flowing in the virtual engine using solver dieselEngine. See attched screenshot.

I have some parameters for the injector set, but have not simulated any spray yet...

[IMG]file:///D:/MyDocs/Desktop/streamTracer.PNG[/IMG]

AdamL January 6, 2012 13:30

I also have bad news... (maybe not that bad...)

After 45 BTDC the simulation crashes. My best guess is that there is a problem with the mesh. Maybe I'm paying the price for a shortcut that I took while making the mesh:
The mesh being used was created using STL surfaces and snappyHexMesh. The cylinder mesh has no specific form.

Here's the error:
Courant Number mean: 0.224104 max: 217.678
Crank angle = -42.75 CA-deg
deltaZ = 7.3878e-05
clearance: 0.00551224
Piston speed = 6.38306 m/s
Solving chemistry
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
#5
in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
#6 __libc_start_main in "/lib/libc.so.6"
#7
in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
Floating point exception
Does this seem like it could be a mesh related problem?

mturcios777 January 6, 2012 13:48

Quote:

Originally Posted by AdamL (Post 338158)
I also have bad news... (maybe not that bad...)

After 45 BTDC the simulation crashes. My best guess is that there is a problem with the mesh. Maybe I'm paying the price for a shortcut that I took while making the mesh:
The mesh being used was created using STL surfaces and snappyHexMesh. The cylinder mesh has no specific form.

Here's the error:
Courant Number mean: 0.224104 max: 217.678
Crank angle = -42.75 CA-deg
deltaZ = 7.3878e-05
clearance: 0.00551224
Piston speed = 6.38306 m/s
Solving chemistry
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
#5
in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
#6 __libc_start_main in "/lib/libc.so.6"
#7
in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/dieselEngineFoam"
Floating point exception
Does this seem like it could be a mesh related problem?

The reason the run crashes is because of a call to sqrt somewhere, so you might have either a negative quantity or NAN. Your maximum Courant number is HUGE, which means somewhere in your domain U*dt/dx has blown up, probably due to a tiny dx. If you are using layered mesh, then the usual way around this problem is to stop your simulation before the aspect ratio of your cells gets too extreme (I use 2:1 as my threshold, more a rule of thumb), then remesh the domain with a new density and map the old fields over. Divide up the cycle into several cases (like case1, case2, case3) just in case you need to tweak your remeshing periods. Its helpful to write a bash script to handle the transition from one phase to the next.

Let me know if you have questions about this procedure. Good luck!

AdamL January 6, 2012 14:19

Ah ha! Thank you! I'll give it a try let you know how it goes.

I do have a few questions before I give it a try:

Do you use any routines to output aspect ratio and do it automatically or do you just think/calculate it out before hand?

Also, do you have any recommendations for how to re-mesh? My first thought is to go back to snappy hexMesh and re-mesh the whole thing then use mapFields to swap the data over to the new mesh. Re-meshing from STL's in snappyHexMesh would be somewhat of a hassle though...

How hard would it be to make the combustion chamber mesh in snappyHexMesh, make the cylinder with extrude2DMesh and combine the two meshes?

Thanks!
Adam

mturcios777 January 6, 2012 14:47

There isn't a strict method, but an odd number of cases works well since you'll probably want a single phase right around TDC. They don't necessarily have to by symmetric (but it makes it easier to start with), and going beyond 5 seems like its too much work, so I'd say 3-5, remembering that when the piston is travelling fastest is when you are going to see the greatest change in aspect ratio.

Your remeshing approach sounds good, remember that since you are doing the same operation over again (just on a different dataset) scripting is your friend.

I've considered an approach like that but haven't pursued it seriously. You could try using mergeMeshes, though since the matchup between the combustion chamber STL and the cylinder won't be perfect there may be issues there. If you decide to go that route and get it working be sure to post results, I'm sure many people would be grateful (I'd be first in line to give you a high-five)!

AdamL January 27, 2012 21:47

Hello again.

Not much has happened on the CFD front of the project lately. I've been spending lots of time modeling the dynamics of the injector. I have successfully re-meshed the engine and the simulation continues. No fancy meshing programs have been written... yet...

I am wondering: how is a moving mesh solved? Is a element size term formulated in the conservation equations? or is it some kind of in-between-time-step thing? A remapping onto the new deformed or moved mesh?


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