View Full Version : Computational Fluid Dynamics (CFD) Q&A
OopsClunkThud
14th April 2021, 04:29
Starting this thread to share tips and tricks for simulating 2D and 3D flows in engines. The hope is that we can build up a database of tools and common settings/methods that deliver reliable results, and that this will allow us to investigate and validate engine design ideas. There are many tools openly available now, but it's still a steep learning curve. Hope this helps.
Fancy picture to inspire you to give it a go:
348867
Velocity flow lines exiting the exhaust port
OopsClunkThud
14th April 2021, 06:20
Following is a list of tools and resources:
Online Service:
https://www.simscale.com web based service to generate the mesh, run the simulation, view the results. Well organized and documented, a great way to get started.
<ul>Example projects:
<li>https://www.simscale.com/projects/muhr/test_radie-stinger/
<li>https://www.simscale.com/projects/OopsClunkThud/tutorial_2-_pipe_junction_flow/
</ul>
Mesh Tools:
http://gmsh.info
Simulation / Solver:
https://su2code.github.io
https://openfoam.org
Visualization:
https://www.paraview.org
Frits Overmars
14th April 2021, 22:42
348867
Velocity flow lines exiting the exhaust portA textbook example of eddies resulting from an exhaust floor that is too low for the blowdown phase.
Muhr
15th April 2021, 07:47
Hi Fun with this thread! Good initiative. I thought I could repost the latest test I did where I tried to compare CFD with a real test in dyno.
Can not say that I became completely wise but a simple little test that can still give an insight into what CFD can do. (For oneself, however, there is a long way to go before you feel that you know what you are doing)
Engine: tm kz-R1
Dyno: Dynostar
EGT: Auto release 550 ° C
Compensation: 0.025 hp / kmh driveline loss (shown as 0.03)
Water temperature: 50c ° (external temperature controlled coolant)
Test: Dyno
Purple: With air box (Righetti)
Green: Without +5 on jetting for the same EGT for all below
Red: With little Bellmouth
Blue: With huge Bellmouth
Test: CFD
- Without Bellmouth
- Little Bellmouth
- Very large Bellmouth
mcshaz
19th April 2021, 08:05
This may we'll show my ignorance, but the post is labelled fluid flow dynamics, but the diagram and comments seem to refer to gas flow dynamics. Obviously gas flow and fluid flow are modelled by different formulas (gasses being compressible and fluids having different viscosities.
Sent from my Mi Note 10 Pro using Tapatalk
Muhr
19th April 2021, 10:01
Hi both liquid and gas is a fluid. Then exactly as you say, substances have different properties in terms of eg viscosity, density and compressibility. but all fluids can be calculated with Navier-Stokes equations
Many fluids can be either liquid or gas depending on the pressure
OopsClunkThud
19th April 2021, 10:28
the difference between a "fluid" and a "gas" has a lot to do with the conditions, and you go for the simplest model that will give the needed accuracy in the result.
at the speeds of a motorcycle (or even an F1 car) assuming that the air is incompressible gives good results and is way easier to calculate. Rule of thumb is that this holds up to about Mach 0.3 and above that the reality of the gas compressing starts to impact the results.
Hopefully we can build out some examples of what settings to run in what situation.
OopsClunkThud
19th April 2021, 11:19
<b>First attempt to calibrate 3D flow in Simscale with the 1D results in EngMod2T</b>
https://www.simscale.com/projects/OopsClunkThud/tutorial_2-_pipe_junction_flow/
The engine targeted for this examination is a Lambretta TV175 with an aftermarket Imola cylinder running a stock 62mm bore and 58mm stroke on a 116mm rod. The transfer ports have sufficient STA for 30hp at 8500rpm with the A port timing duration of 127°. The placement of the studs limits the use of auxiliary exhaust ports so every effort is being made to optimize a single port. The exhaust port has an open duration of 190° and a 70% of bore width of 43.4mm. The initial downward angle of the port was set to 10° in order to provide sufficient blowdown area.
<b>Comparison of 3D and 1D Simulations</b>
EngMod 2T was used to simulate the engine, and the cylinder and exhaust port pressure, temperature, and mass flow rate data was extracted from the output files. The cylinder and exhaust port was modeled with straight side walls and 10° downward angle as defined in EngMod with the piston positioned at 8° intervals through the blowdown period as well as fully opened. Steady state turbulent flow was simulated through these models, matching the cylinder pressure and temperature at each crank position. The walls were held at the same constant temperature as used in EngMod, and were tested with both a slip and no-slip boundary condition.
Images showing the velocity for the slip boundary conditions:
348889348888348887348886
Mass Flow Rate of EngMod, Slip, and No-Slip
348892
The mass flow rate at the entry was captured and compared to the values from EngMod. The slip wall boundary closely matched EngMod throughout the blowdown period with the steady state value being within 3% of the unsteady 1D model. The steady state flow of the fully opened port was more than 7% higher than in EngMod and the steady state condition had not yet been reached.
348891
While the results are not bad for a first calibration, there are known areas where improvements could be made:
1. The fluid used in the simulation was air. This should be changed to reflect the actual combustion products
2. Viscosity was set as constant (for air). this could be improved by using a constant value based on the combustion products, or by using the Sutherland model
Vannik
26th April 2021, 07:14
The videos by Steve Brunton on turbulence is very good, he shows the difference between RANS and LES in this video:
https://www.youtube.com/watch?v=zIQpxmLwbXQ
But he has a number of other videos on turbulence modeling that is as good. The one linked here is just the latest one in a series on turbulence and the Navier-Stokes equations.
OopsClunkThud
26th April 2021, 12:23
The videos by Steve Brunton on turbulence is very good, he shows the difference between RANS and LES in this video:
https://www.youtube.com/watch?v=zIQpxmLwbXQ
But he has a number of other videos on turbulence modeling that is as good. The one linked here is just the latest one in a series on turbulence and the Navier-Stokes equations.
Great video! thanks for posting that.
S.A.E. Miller has some good materials on mesh generation here:
https://www.youtube.com/playlist?list=PLbiOzt50Bx-l2QyX5ZBv9pgDtIei-CYs_
OopsClunkThud
29th April 2021, 07:58
I've been running a large matrix of 2D simulations in SU2 of the exhaust mass flow rate over the following parameters:
Piston Crown Angle: 0, 5, 10, 15°
Exhaust Roof Angle: 0, 5, 10, 15, 20, 25, 30°
Crank Position ATDC: 85 (EPO), 90, 95, 100, 105, 110, 115 (TPO), 120, 125, 130
Still analyzing the data, but an interesting observation popped out.
At ATDC 130° there is a huge amount of turbulence in the horizontal exhaust (top image), and it's smoother as the port angles downward (best ~20°). I had been looking at the blowdown phase to maximize flow. But seeing this got me thinking about the mixing of exhaust with the fresh charge that the turbulence would cause.
348936
Muhr
29th April 2021, 08:36
I think it has been tricky to get a definite idea of what might be the best way to try to simulate the flow at a certain port angle. I have reasoned as if I divide the time area at a selected RPM by the area for the simulation and thereby get a time interval to study. How do you view this issue
I can also recommend Michel van Biezen if you are interested in fluid dynamics in general, not just simulations
https://m.youtube.com/watch?v=GM627aCRwcc
regards Johan
OopsClunkThud
29th April 2021, 15:36
For now I'm running everything as steady state but at each given crank angle I use the pressure, temp... from the 1D simulation for my boundary conditions and fluid properties. To do a proper transient simulation would require taking the flow state at the output of one step as the initial condition for the next. The 2D model is simple enough that I think this is possible, and SU2 gives a restart file that could be used as the input. I've built my mesh so that it keeps the same cell count and structure as the piston moves through the angles, but I've not tried this yet.
In the series above where all cases are at ATDC = 130°, I used the same boundary conditions with a different CAD model (exhaust from horizontal to 30° down in 5° steps).
I build a configuration file that has the test parameters, fluid properties, and boundary condition values and use that to drive the generation of CAD, mesh, and CFD config files. Here's a shot of the flat piston and 20° downward port, with the piston moving 5° between each step.
348938
Muhr
30th April 2021, 08:07
Good work!!! It will be very interesting to see the results of these adjustments you are making. waiting with excitement
OopsClunkThud
7th May 2021, 16:04
On my prior run of simulations the scripts were just to get the job done to prep the data for running. They were hard coded to the models and cases I was running. Now I'm cleaning them up so they can be general tools for planning, preparing, and running a test plan including many simulations.
First up is a Fusion 360 script that can set the user parameters in a model and then export the file in STEP format. This is how I loop through the piston position for each crank angle as well as the port and piston angles. It could also be used like a Creo Family table to create variations on a design.
https://github.com/OopsClunkThud/BulkStepExport
Vannik
7th May 2021, 17:50
Are you planning to do an unsteady flow sim with moving piston?
In Post4T I have an option to output the inlet, exhaust and cylinder pressures in a format as used by Siemens' Simcenter STAR-CCM+ for in-cylinder simulation, do you need something like that in Post2T?
OopsClunkThud
7th May 2021, 18:16
That would be the ultimate goal, but quite a ways off I think.
For now I've been working from the files that post2T reads in to pull out the pressure, temp, mach, and mass flow rate into a single sheet. the data is there to do 1° steps, but for now I'm stepping in 5°. Current aims are two fold: 1. get the work flow down so I can run a batch of cases and collect the outcomes (half way there on this one) 2. get a feel for how things flow at different points in the cycle (5° step and 2D models inform, but are not the whole picture).
With my current flow, I think I could do a test of unsteady as each mesh is a morph of the prior with the same number of nodes. When I finish this round of cleanup on the scripts I'll give that a try.
Another goal would be to determine a Cd value for the exhaust at the given crank positions after optimization. But not sure if or how that could be rolled back into the engmod2T run.
Frits Overmars
7th May 2021, 22:46
Another goal would be to determine a Cd value for the exhaust at the given crank positions after optimization.That's about the top item on my wish list. It would allow a great extension of the angle-area approach.
lohring
8th May 2021, 02:43
I'm following your efforts closely. I need to get more flow information for my opposed piston design. I'll use your Fusion 360 script and see if I understand the method.
Lohring Miller
OopsClunkThud
8th May 2021, 11:46
Here's a demo fusion model and the CSV file. This generates 280 step files as the output, so if you want to just test it, remove lines from the CSV.
349008
OopsClunkThud
13th May 2021, 06:10
Been tracking down the exhaust gas constants called for in the simulations:
From Blair for AFR 13:
Gas % by Volume:
CO 5.85%
CO2 8.02%
H2O 15.6%
O2 0.0%
N2 70.52%
Ratio of Specific Heats:
500K gamma=1.362
1000K gamma=1.317
Gas Constant:
293K-1000K R=299.8
NASA gas tables is a likely a better source for these values:
https://cearun.grc.nasa.gov/ThermoBuild/):
For Dynamic Viscosity what I have here is likely better than just using air, but I don't fully trust that it's right:
simscale (openFOAM) and SU2 both use Sutherland law.
https://www.cfd-online.com/Wiki/Sutherland's_law
https://www.grc.nasa.gov/www/BGH/viscosity.html
Sutherlands law allows us to use the viscosity at a reference temperature and compute the viscosity at another. Just need to come up with the Sutherland constant for our mixture of exhaust gas and the reference temp/viscosity. Seems the norm is to back into the Sutherland constant by curve fitting.
found two ways to get viscosity values for the exhaust gas mixture:
1. use someone else's model and hope it's correct: https://www.firecad.net/engineering-calculations/boiler/GasProperties
2. Calculate the mixed value using the Herning and Zipperer approximation (have not tried this yet)
By curve fitting I came up with the following values to use in Sutherland's law:
Sutherland Viscosity Ref (1.716E-5 default value for AIR SI)
MU_REF= 2.400E-05
Sutherland Temperature Ref (273.15 K default value for AIR SI)
MU_T_REF= 500
Sutherland constant (110.4 default value for AIR SI)
SUTHERLAND_CONSTANT= 217.5
Had to use a higher reference temp as the water vapor makes things go wonky at the lower temp.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.