|
[Sponsors] |
[mesh manipulation] EngineMesh utilitities |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 22, 2015, 16:42 |
EngineMesh utilitities
|
#1 |
New Member
Grzegorz Karpiński
Join Date: Nov 2014
Location: Olsztyn, Poland
Posts: 6
Rep Power: 12 |
Hello,
I'm new in Open FOAM software (just after one basic online course). I'm interested in I.C. engines simulations. Do you know how I can get explanations (tutorials, descriptions) about engine utilities in Open FOAM? Specially: - "MoveEngineMesh". I want to know how to prepare walls in "blockMeshdict" file (or in other utility to prepare mesh if it is better for engines) and files "MeshModifiers" , "DynamicMeshDict" - Also what is necessary to run "engineFoam" solver (files in "0" and "system" folders). My purpose is to run simulation for case of my master thesis (I did it already in AVL FIRE software which license I borrow for thesis preparation period). Below I present you link to presentation of my thesis: http://prezi.com/dmif50zywkzl/?utm_c...py&rc=ex0share Do you think it will be difficult to run in Open FOAM software ? |
|
March 23, 2015, 14:04 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Have a look at the engineFoam tutorial case ($FOAM_TUTORIALS/combustion/engineFoam). For multispecies diffusion flames, you may need to go to sprayEngineFoam.
The main thing with the current existing engine mesh types is to have the proper patches (cylinderHead, liner and piston) and the right values in the constant/engineGeometry dictionary. You can use moveEngineMesh to determine if the mesh quality will be acceptable during the stroke. I suspect you will need to remesh periodically to keep aspect ratio of the cells at a good quality. |
|
April 1, 2015, 16:37 |
|
#3 |
New Member
Grzegorz Karpiński
Join Date: Nov 2014
Location: Olsztyn, Poland
Posts: 6
Rep Power: 12 |
Thank you Marco for your response. It really helps me to start. I did not answer for a while because using OpenFoam takes me long time.
- About using sprayEngineFoam for multispecies diffusion: I didn’t activate multispecies module in AVL FIRE because homogeneous mixture of methane was used, so I’ve just wanted to simulate combustion. In the following link you can see movies how it looks: https://www.dropbox.com/sh/w62sss9wm...5AyofEwIa?dl=0 - About tutorial which you recommend me ($FOAM_TUTORIALS/combustion/engineFoam) : this is kiva test tutorial and I cannot find the executive files for mesh. I’m using “simple engine” tutorial which I found at following site: http://powerlab.fsb.hr/ped/kturbo/Op...neTutorial.tgz Now I stuck in following steps: 1. I don’t know which command I can use to execute the mesh (I tried “moveEngineMesh”, “moveDynamicMesh”, “moveMesh”. Do you know how to execute this mesh? 2. If I good understood I must only assign “cylinderHead”, “liner” and “piston” patches. I have to deactivate all valves settings. Do you know how? 3. Maybe you have access to more suitable tutorial? 4. About mesh: I prepare this with blockMesh utilities. I did “mergePatchpairs” but mesh is complicated in joint area. In link below you can see result: https://www.dropbox.com/sh/xxwfbp7ye...QHYf1oaIa?dl=0 In OF 2.3.0 one error appears in “checkMesh”: https://www.dropbox.com/s/rnbq4yegp7...checkmesh?dl=0 Using OF ex 3.1 2 is not possible to execute “mergePatchpairs” tool (it is of interest for me). 5. Do you know how to manipulate mesh: - Is it better to re-mesh periodically or make layer removal during stroke movement? How to execute one of these methods? - how to prepare sliding interface ? I look forward to hearing from you. Best regards Gregory |
|
April 1, 2015, 18:50 |
|
#4 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
1. The foam engine tutorial isn't completely straightforward. If you look at the Allrun script you will see how the mesh is initialized (converted from KIVA file) and then the application engineFoam is run (its being fancy and getting the application name from the controlDict).
moveEngineMesh and similar only move the mesh to see if your mesh motions are working properly. 2. engineMesh will work fine with additional patches beyond cylinderHead, liner and piston, but only the liner and piston patches will be moved; everything else will stay stationary, unless you are using fvMotionSolverEngineMesh 3. The kivaTest is very straightforward once you look at the Allrun script 4. Before using mergePatchPairs, make sure the mesh is acceptable without merging. I've found merging only works for the very simplest cases and you are usually better off ensuring your blocks are co-located. 5. When compressing, layer removal works well and shortens your runtime. On expansion you are better off remeshing. |
|
August 19, 2015, 10:22 |
|
#5 |
Member
Join Date: Jul 2015
Posts: 33
Rep Power: 11 |
hi mturcios777,
I want to run kivaTest ,but i don't know how create my favorite compression ratio.Can you help me? BlockMeshDict doesn't exist in this case |
|
August 19, 2015, 13:22 |
|
#6 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Hello kaveh,
The compression ratio is set by the mesh itself, but there is a utility that can help you adjust your mesh to get what you want. engineCompRatio will calculate the compression ratio for your engine based on the parameters set in the constant/engineGeometry file. Once you have the major parameters selected (stroke, conRodLength, stroke), you can make minor adjustments using the clearance. Its a bit of guess and test, but the equations of piston motion should give you a rough estimate of what your clearance value should be. Good luck |
|
August 21, 2015, 08:10 |
|
#7 |
Member
Join Date: Jul 2015
Posts: 33
Rep Power: 11 |
Dear mturcios777,
For example, I want to run the blow case by the default mesh in kivaTest ,It's data in an article, Bore=86 mm Stroke=86 mm Compression ratio=14.04 Connection rod length=154.49 ***** My engineGoemetry is conRodLength conRodLength [ 0 1 0 0 0 0 0 ] 0.15449 bore bore [ 0 1 0 0 0 0 0 ] 0.086; stroke stroke [ 0 1 0 0 0 0 0 ] 0.086; clearance clearance [ 0 1 0 0 0 0 0 ] 0.02115; rpm rpm [ 0 0 -1 0 0 0 0 ] 1500; ***** but i receive blow results CA = 0 deltaZ = 0.086 clearance: -0.000361 Piston speed = 4.3 m/s Vmax = 0.000631297, Vmin = 5.97945e-05 Vmax/Vmin = 10.5578 ************* Of course by changing conRodLength & clearance, compression ratio doesn't change. please help me. thanks in advance. |
|
August 21, 2015, 17:07 |
|
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@kaveh19: I was curious about this and did some researching on how the names relate to the geometry of the piston+conrod+crankshaft. This wikipedia page pretty much explains it all: https://en.wikipedia.org/wiki/Engine_balance - the section "Secondary (non-sinusoidal) balance" In addition, I already mentioned in another thread: http://www.cfd-online.com/Forums/ope...tml#post560092 - post #123 - what each parameter is identified as in the source code, since you asked about it there. So, after playing around with the tutorial case, what I found out is that most likely you are going to create your own new mesh for your cylinder. This is because the mesh on the tutorial "combustion/engineFoam/kivaTest" already geometrically includes:
Now, if you still want to try and manipulate this mesh until you can get a close enough mesh, here's what you can try doing:
Beyond this, I can still provide a few more details about the parameters defined in "constant/engineGeometry":
Code:
Calculate the geometric compression ratio. Note that if you have valves and/or extra volumes it will not work, since it calculates the volume at BDC and TCD. Best regards, Bruno PS: Here's another related answer: http://www.cfd-online.com/Forums/ope...tml#post560580 - post #5, on how to calculate the geometry settings.
__________________
Last edited by wyldckat; August 21, 2015 at 19:27. Reason: fixed typo |
|
August 21, 2015, 18:10 |
|
#9 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Very good post Bruno. I had forgotten that I adjusted clearance on our own internal mesh generation utility, not the engineMeshDict
|
|
August 23, 2015, 10:41 |
|
#10 |
Member
Join Date: Jul 2015
Posts: 33
Rep Power: 11 |
hi mturcios777,
I really appreciate u,but compression ratio doesn't change in fact by this way we have changed the geometry .am i right? |
|
August 23, 2015, 14:55 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
As explained in post #8, yes, the mesh is manipulated so that the mesh matches the same stroke and bore you asked for. That is what transformPoints is used for.
The parameters specified in "constant/engineGeometry" are for adjusting the parameters for the mesh motion. The detail you're not seeing, perhaps because you did not follow all of the steps described in post #8, is that the mesh isn't simply a simple geometrical cylinder. It also has:
My guess is that if you did follow the steps I wrote in post #8, you possibly would have seen this situation already. In addition, if you had seen the mesh in ParaView, you possibly would have asked as to how you could change the dimensions when the piston is located in the top position... which you didn't ask about. Sometime after I wrote my answer in post #8, I did some additional thinking and perhaps it is possible to change the dimensions of the head of the cylinder and the head of the piston even further. The big problems are:
The case can be executed by running: Code:
./Allrun Code:
./Allclean It should work with OpenFOAM 2.3 and 2.4. And since I took the time to comment every step in "Allrun", here's the contents of the file as well: Code:
#!/bin/sh cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Get application name application=`getApplication` # get the original mesh from the original tutorial cp $FOAM_TUTORIALS/combustion/engineFoam/kivaTest/otape17 ./ # convert the mesh runApplication kivaToFoam -file otape17 # reshape the cylinder so that it has the same bore and stroke as desired runApplication transformPoints -scale '(0.934782609 0.934782609 1.021013891)' # rename the log file, so that it doesn't collide with the next time we use # the same application mv log.transformPoints log.transformPoints.A # create the temporary angle folder for -180 degrees, which is the starting # position for the piston mkdir ./-180 # use the controlDict that was created for moving the piston from -180 degrees # to 0 degrees cp system/controlDict.displaceMeshTo0 system/controlDict # Move the piston from -180 degrees to 0 degrees runApplication moveEngineMesh # rename the log file, so that it doesn't collide with the next time we use # the same application mv log.moveEngineMesh log.moveEngineMesh.A # Reshape the height of the cylinder, so that the volume is reduced to the desired # compression ratio runApplication transformPoints -scale '(1.0 1.0 0.6283667)' # rename the log file, so that it doesn't collide with the next time we use # the same application mv log.transformPoints log.transformPoints.B # use the controlDict that was created for moving the piston from 0 degrees # to 180 degrees cp system/controlDict.displaceMeshBackTo180 system/controlDict # Move the piston from 0 degrees to 180 degrees runApplication moveEngineMesh # rename the log file, so that it doesn't collide with the next time we use # the same application mv log.moveEngineMesh log.moveEngineMesh.B # Move the "points" file of the final position to the main mesh, because this # is the starting position mv 180/polyMesh/points constant/polyMesh/ # remove all temporary angle (time) folders that were used for manipulating # the mesh. rm -rf 180 0 ./-* > /dev/null 2>&1 # copy the angle folder that has all of the fields for running the case cp -r ./original.-180 ./-180 # switch to using the original controlDict for engineFoam cp system/controlDict.originalRun system/controlDict # Calculate the compression ratio first runApplication engineCompRatio # Uncomment this line for also running the solver #runApplication $application # ----------------------------------------------------------------- end-of-file Warning: This example does not achieve the compression ratio of 14.04: Code:
Vmax = 0.000539505, Vmin = 4.0116e-05 Vmax/Vmin = 13.4486
__________________
|
|
August 25, 2015, 17:22 |
|
#12 |
Member
Join Date: Jul 2015
Posts: 33
Rep Power: 11 |
hi wyldckat,
I really appreciate you. according to AckivaTest tutorial-fault on temperature (engineFoam) I could fix my compression ratio ,but i have problem with boundary condition now. I will be happy if you participate in our discussion. Thanks for your guides. |
|
August 31, 2015, 09:51 |
kivaTest
|
#13 |
Member
Join Date: Jul 2015
Posts: 33
Rep Power: 11 |
Hello guys,
I have modified the kivaTest for compression ratio equal to 14.04. I want to change the fuel of kivaTest to gasoline . Would you mind telling me how i should start? In combustionProperties : fuel IsoOctane; says that fuel is Isooctane , but GuldersCoeffs { Methane { W 0.422; eta 0.15; xi 5.18; alpha 2; beta -0.5; f 2.3; } Propane { W 0.446; eta 0.12; xi 4.95; alpha 1.77; beta -0.2; f 2.3; } IsoOctane { W 0.4658; eta -0.326; xi 4.48; alpha 1.56; beta -0.22; f 2.3; } } specify some weird coefficient ,of course for me , for Methane ,Propane,and Isooctane. In thermophysicalProperties; thermodynamics { Tlow 298.15; Thigh 5000; Tcommon 1000; highCpCoeffs ( 19.3963 0.0488137 -1.55798e-05 2.17831e-09 -1.08391e-13 -37133.9 -78.8531 ); lowCpCoeffs ( 0.429357 0.0765769 8.41306e-06 -5.86603e-08 2.79414e-11 -30446.4 25.6735 ); } transport { As 1.67212e-06; Ts 170.672; } are really unfamiliar for me. Thanks in advance. |
|
March 17, 2017, 08:49 |
|
#14 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12 |
Quote:
Recently, I use the OpenFOAM-extend-4.0 to simulate engine combustion. I use the layerAR. And I also find that the case will crash when expansion. You said remeshing for expansion. But I still don't know how to deal with it. Would you tell me more details about this? |
||
March 17, 2017, 12:46 |
|
#15 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
No worries. layerAR on expansion is a bit tricky as you have to interpolate the values of the cells in the new layer properly and ensure the flux on the newly created faces is oriented properly. I've got a some threads on this in the mantis for 2.3.x, can't find them at the moment.
But since re-meshing works better on expansion anyway, I usually end up doing that. Layer addition adds cells continuously on expansion, so if your flow isn't really sensitive to aspect ratio there is no great need for layer addition. What I do is just use the normal layered mesh and start with highly compressed cells (~5:1 aspect ratio) and expand until the liner cells are almost 1:1.5-2 aspect ratio. I then stop the simulation, map the results to a newer mesh with more cells that are compressed, then repeat the process as required. I have a bash script that performs this, and since my mesh is parametrically generated with Python and blockMesh, its pretty quick. Obviously if you are using sHM this process can be more involved. Hope this helps, Marco |
|
March 18, 2017, 21:47 |
|
#16 |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12 |
Hi Marco,
Thanks for your suggestion. And I have run moveEngineTopoMesh solver successfully, both compression and expansion. So I think I can use the mesh generated by moveEngineTopoMesh for expansion in dieselEngineDymFoam(revised by myself). Yan Last edited by zhangyan; April 17, 2017 at 03:05. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
engineMesh with layered addition removal | mturcios777 | OpenFOAM Programming & Development | 19 | May 20, 2014 19:16 |
engine simulation with fvmotionSolver engineMesh | sasanghomi | OpenFOAM | 10 | September 4, 2013 17:23 |
Autorefinement and deforming enginemesh | Rickard.Solsjo | OpenFOAM | 0 | August 22, 2011 05:20 |