CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

engineFoam with layers - pressure problems when adding layers

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   March 28, 2012, 16:04
Default engineFoam with layers - pressure problems when adding layers
  #1
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
So after my post on getting certain engine functionality from 1.6-dext into 2.1.x (layer addition/removal), I was finally able to compile the ext engine library (with engineTopoChangerMesh, layerAR/layerARGambit and some other capabilities) and get it work with 2.1.x (there were changes with the underlying mesh topology changer interface).

I've been running on the included kivaTest tutorial and a simple cylindrical piston mesh, and have been running into problems with the pressure on the expansion side. I've turned off combustion so that we're only looking at the compression and expansion of the gas. I'm posting a comparison of the volume averaged pressure, temperature and u' that are written to the logFile by engineFoam. The discontinuities occur at layer addition/removal for both cases, but in 2.1.x we see severe unphysical ones).

The 2.1.x version of the solver uses PIMPLE while 1.6-ext uses PISO, but all the fvSchemes are identical and fvSolution are comparable. The layer controls are identical. I haven't worked much with meshes with topological changes; I did a test with the movingCone topoChangerFvMesh (which is incompressible) as icoDyMFoam and saw similar pressure fluctuations in 2.1.x but wasn't sure what to make of them. Comparing the solvers from 1.6-ext and 2.1.x, it appears that I should be doing some flux correction, but I'm not exactly sure how I should do that. Any suggestions to deal with this would be most welcome.

Thanks in advance
Attached Images
File Type: png pPlot.png (5.9 KB, 58 views)
File Type: png Tplot.png (6.1 KB, 43 views)
File Type: png uPPlot.png (4.6 KB, 42 views)

Last edited by mturcios777; March 28, 2012 at 16:08. Reason: Question about flux correction
mturcios777 is offline   Reply With Quote

Old   March 30, 2012, 14:43
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
So I've done a little digging and it seems my problem is in the mapping of the phi field. When layer addition is required, every other field seems to map fine (I've including rho and U as reference) on the bottom added layer, but phi (which I am outputting as as volScalarField by area weighted averaging for debugging/post-processing) gives a field inconsistent with the previous time step (I'm outputting every time step to debug).

I've switched to a simple cylindrical mesh (checkMesh gives stats much better than the kiva mesh) and I'm including the time step before and after the layer add. When the solver then moves to solve the continuity equation, my density suddenly increases in the bottom layer which messes up all the subsequent calculations. In this mesh, the bottom surface is the piston patch, which is moving downwards.

As I said before, I'm only just starting with the underlying mesh and topology changers in OF, and assistance would be greatly appreciated!
Attached Images
File Type: jpg rhoAfterAdd.jpg (43.6 KB, 55 views)
File Type: jpg UBeforeAdd.jpg (41.0 KB, 46 views)
File Type: jpg UAfterAdd.jpg (41.2 KB, 42 views)
File Type: jpg phiVBeforeAdd.jpg (49.1 KB, 46 views)
File Type: jpg phiVAfterAdd.jpg (50.6 KB, 43 views)
mturcios777 is offline   Reply With Quote

Old   May 30, 2012, 00:20
Default
  #3
Member
 
Abhishek
Join Date: Dec 2010
Posts: 37
Rep Power: 5
Abhishekd18 is on a distinguished road
Hi,

I am also having problems when there is a layer addition. There seems to be problem with volPointInterpolation when it is in the function makeWeights() (Inverse Distance Interpolation).
I don't know how to solve this. I tried to force value 1 to the weighting factors, but still getting the same error.


Volume: new = 5.4396962024093466437e-06 old = 5.43936934481404751e-06 change = 3.2685759529913372291e-10
Motion continuity errors : sum local = 1.3227076008919697477e-15, maximum = 5.7008204028280440458e-13
Courant Number mean: 0.0017958118753054295048 max: 0.099190629050353751328 velocity magnitude: 558.85251806463747926
deltaT = 9.6342123901196508317e-08
Crank angle = 15.303233970753638005 CA-deg
deltaZ = -3.807320981541462146e-07 Piston at:-0.0064712143060197541145
pistonLayerID: 0
Piston layering mode
[1] bool layerAdditionRemoval::changeTopology() const for object pistonLayer :
[1] Layer thickness: min: 0.00037621794099957056156 max: 0.0011002007786471443371 avg: 0.00096770822115539072497 old thickness: 0.00096737337184838638818
[1] Removal threshold: 0.00040000000000000001917 addition threshold: 0.0011000000000000000663
[1] bool layerAdditionRemoval::changeTopology() const for object pistonLayer : Triggering layer addition
[0] bool layerAdditionRemoval::changeTopology() const for object pistonLayer :
[0] Layer thickness: min: 0.00037621794099957056156 max: 0.0011002007786471443371 avg: 0.00096770822115539072497 old thickness: 0.00096737337184838638818
[0] Removal threshold: 0.00040000000000000001917 addition threshold: 0.0011000000000000000663
[0] bool layerAdditionRemoval::changeTopology() const for object pistonLayer : Triggering layer addition
[2] bool layerAdditionRemoval::changeTopology() const for object pistonLayer :
[3] bool layerAdditionRemoval::changeTopology() const for object pistonLayer :
[2] Layer thickness: min: 0.00037621794099957056156 max: 0.0011002007786471443371 avg: 0.00096770822115539072497 old thickness: 0.00096737337184838638818
[2] Removal threshold: 0.00040000000000000001917 addition threshold: 0.0011000000000000000663
[2] bool layerAdditionRemoval::changeTopology() const for object pistonLayer : Triggering layer addition
[3] Layer thickness: min: 0.00037621794099957056156 max: 0.0011002007786471443371 avg: 0.00096770822115539072497 old thickness: 0.00096737337184838638818
[3] Removal threshold: 0.00040000000000000001917 addition threshold: 0.0011000000000000000663
[3] bool layerAdditionRemoval::changeTopology() const for object pistonLayer : Triggering layer addition
[0] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Adding cell layer
[1] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Adding cell layer
[3] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Adding cell layer
[2] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Adding cell layer
[1] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Using edges for point insertion
[3] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Using edges for point insertion
[2] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Using edges for point insertion
[0] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Using edges for point insertion
[0] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Finished adding cell layer
[0] layerAdditionRemoval::setRefinement(polyTopoChange & ref) for object pistonLayer : Clearing addressing after layer addition.
[3] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Finished adding cell layer
[3] layerAdditionRemoval::setRefinement(polyTopoChange & ref) for object pistonLayer : Clearing addressing after layer addition.
[2] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Finished adding cell layer
[2] layerAdditionRemoval::setRefinement(polyTopoChange & ref) for object pistonLayer : Clearing addressing after layer addition.
[1] void layerAdditionRemoval::addCellLayer(polyTopoChange& ref) const for object pistonLayer : Finished adding cell layer
[1] layerAdditionRemoval::setRefinement(polyTopoChange & ref) for object pistonLayer : Clearing addressing after layer addition.
[0] layerAdditionRemoval::updateMesh(const mapPolyMesh&) for object pistonLayer : Clearing addressing on external request. Pointers not set.
[3] layerAdditionRemoval::updateMesh(const mapPolyMesh&) for object pistonLayer : Clearing addressing on external request. Pointers not set.
[2] layerAdditionRemoval::updateMesh(const mapPolyMesh&) for object pistonLayer : Clearing addressing on external request. Pointers not set.
[1] layerAdditionRemoval::updateMesh(const mapPolyMesh&) for object pistonLayer : Clearing addressing on external request. Pointers not set.
volPointInterpolation::makeWeights() : constructing weighting factors

[cfd007_sm:13769] *** Process received signal ***
[cfd007_sm:13769] Signal: Floating point exception (8)
[cfd007_sm:13769] Signal code: (-6)
[cfd007_sm:13769] Failing at address: 0x1f7000035c9
[cfd010:30921] *** Process received signal ***
[cfd010:30921] Signal: Floating point exception (8)
[cfd010:30921] Signal code: (-6)
[cfd010:30921] Failing at address: 0x1f7000078c9
[cfd009:07983] *** Process received signal ***
[cfd009:07983] Signal: Floating point exception (8)
[cfd009:07983] Signal code: (-6)
[cfd009:07983] Failing at address: 0x1f700001f2f
[cfd008:26025] *** Process received signal ***
[cfd008:26025] Signal: Floating point exception (8)
[cfd008:26025] Signal code: (-6)
[cfd008:26025] Failing at address: 0x1f7000065a9
Abhishekd18 is offline   Reply With Quote

Old   May 30, 2012, 13:00
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
Abhishek,

I never figured this one out; I tried a simple case with pimpleDyMFoam and was able to run the case but with large errors in the pressure and velocity fields. I believe the problem is in the setting of the flux field phi in the the layers that have been added, as layer removal seems to work okay. Have a look at this bug report I submitted (and that has yet to be addressed...)

topoChangerFvMesh not working properly with pimpleDyMFoam


If we can solve the problem with incompressible flow, my guess is that the fix will be similar (if not identical) to the compressible case. What version are you using? It seems that 1.6-ext has resolved their issues with topology changes.

Last edited by mturcios777; May 30, 2012 at 13:00. Reason: Typo in flux field
mturcios777 is offline   Reply With Quote

Old   May 30, 2012, 13:10
Default
  #5
Member
 
Abhishek
Join Date: Dec 2010
Posts: 37
Rep Power: 5
Abhishekd18 is on a distinguished road
Yes. Layer removal runs perfect. I am using 1.6-ext version.
Abhishekd18 is offline   Reply With Quote

Old   May 30, 2012, 13:17
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
I was able to get both additional and removal working in 1.6-ext. Only layer removal works in 21x, layer addition has problems with the flux field. Which engineTopoChangerFvMesh are you using?
mturcios777 is offline   Reply With Quote

Old   May 30, 2012, 13:22
Default
  #7
Member
 
Abhishek
Join Date: Dec 2010
Posts: 37
Rep Power: 5
Abhishekd18 is on a distinguished road
pistonLayer
Abhishekd18 is offline   Reply With Quote

Old   May 31, 2012, 16:16
Default
  #8
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
Could you upload your mesh and case? Also, I have only ever run this serially, and it seems like you are running the case in parallel.
mturcios777 is offline   Reply With Quote

Old   August 9, 2012, 10:03
Default
  #9
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 7
nikwin is on a distinguished road
Hello,

I'm working on an engine simulation and are interested in the layer addition removal possibility. Did you get it to work? In parallel and if so in which OF version?

Abdishek, I downloaded your test case, MesquiteSimpleCylinder and updated the 1.6-ext version with the dynamicFvTopoMesh library, but I can still not get the case to work. (used a blockMesh cylinder) Do you have a running test case you could provide me with?

Right now I'm just running the compression and expansion stroke using several meshes which I'm interpolating in between.

Thanks
/Niklas
nikwin is offline   Reply With Quote

Old   October 12, 2012, 13:39
Default
  #10
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 4
conceptone is on a distinguished road
Dear Marco,
Hi, right now I am also running the engineFoam. Since I didn't figure out how to realise the dynamic mesh addition and removal in the cylinder(I mean when piston moving up and down), I switch to openfoam-1.6-ext version. I feel this version can realise this and you were also done by this version(the pressure as a function of crank angle plot is awesome). But I didn't find clear tutorial about how I can run dieselenginefoam with dynamic mesh. Could you tell me how to set up parameters in the case file with this 1.6-ext version?
conceptone is offline   Reply With Quote

Old   December 17, 2012, 18:01
Default
  #11
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
conceptone, did you still need help with this?
mturcios777 is offline   Reply With Quote

Old   February 3, 2013, 16:28
Default
  #12
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 4
conceptone is on a distinguished road
Hi Marco,
I am done with this problem, thanks and happy new year!
conceptone is offline   Reply With Quote

Old   February 3, 2013, 16:39
Default
  #13
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 4
conceptone is on a distinguished road
Hi Macro, actually I got another problem right now, did you ever try sprayFoam with combustion(multi-step kinetics mechanism)? For my case, the multi-step reactions lead to very little combustion while one-step global reaction burns normal.
Thanks
conceptone is offline   Reply With Quote

Old   February 4, 2013, 14:19
Default
  #14
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
I have used multi species combustion and it has worked, though the combustion is handled by an in-house code. Combustion is very sensitive to the choice of chemistry scheme.
mturcios777 is offline   Reply With Quote

Old   February 4, 2013, 20:59
Default
  #15
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 4
conceptone is on a distinguished road
Thanks for the information. But what do you mean by the choice of chemistry scheme, I mean with openFoam's original combustion code, does the multi-step kinetics mechanism combustion still work? If so, can you share your case file to me?(without the mechanism file is fine), because I am struggling on this problem and wonder it's caused by code bugs or my input problem.
Thanks
conceptone is offline   Reply With Quote

Old   February 5, 2013, 12:15
Default
  #16
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
Sorry, yes the multi step kinetics has worked in the past for us. What I meant was that the mechanism plays the biggest role in the extent of combution.

You are on the right track with trying to see if the setup has a problem first. I wish I could share a sample case but I have none available that would work. If you look at the reactingFoam tutorial that should get you started.
mturcios777 is offline   Reply With Quote

Old   February 5, 2013, 16:38
Default
  #17
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 4
conceptone is on a distinguished road
Hi Marco,
Thanks for suggestion. Actually I have tried reactingFoam to check the chemical and combustion part. While I always get messages like below after a period of time(0.0007s):
[0] --> FOAM FATAL ERROR:
[0] Maximum number of iterations exceeded
[0]
[0] From function specieThermo<Thermo>::T(scalar f, scalar T0, scalar (specieThermo<Thermo>::*F)(const scalar) const, scalar (specieThermo<Thermo>::*dFdT)(const scalar) const) const
[0] in file /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 69.
[0]
FOAM parallel run aborting
[0]
[1]

so I use tutorial case's mechanism and therm.dat...I don't know what's the problem here(even tutorial case can't run..)

I guess I can try to change the function T in speciethermoI.H like in openfoam-ext-1.6 to avoid computing ending..
if (iter++ > maxIter_)
{
// Improvements: graceful exit with recovery. HJ, 11/Oct/2010
InfoIn
(
"specieThermo<thermo>::T(scalar f, scalar T0, "
"scalar (specieThermo<thermo>::*F)(const scalar) const, "
"scalar (specieThermo<thermo>::*dFdT)(const scalar) const"
") const"
) << "Maximum number of iterations exceeded. Rescue by HJ"
<< endl;

// Use value where dFdT is calculated using T0. HJ, 11/Oct/2010
Tnew = f/(this->*dFdT)(T0);

return Tnew;
}

} while (mag(Tnew - Test) > Ttol);
conceptone is offline   Reply With Quote

Old   April 11, 2013, 05:41
Default
  #18
New Member
 
Vito Raso
Join Date: Apr 2013
Location: Bari(Italy)
Posts: 7
Rep Power: 3
Vito31388 is on a distinguished road
Hi Marco, I'm new in OF, I want to know how you calculate volume averaged pressure in engineFoam and how you plot a graph average pressure-time.
Thanks a lot

Vito
Vito31388 is offline   Reply With Quote

Old   April 11, 2013, 16:21
Default
  #19
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
Hi Vito,

The logSummary file that is created has the pressure and temperature history. If you want to know how these quanitites are calculated, look at logSummary.H in the engineFoam folder.
mturcios777 is offline   Reply With Quote

Old   April 12, 2013, 07:51
Default
  #20
New Member
 
Vito Raso
Join Date: Apr 2013
Location: Bari(Italy)
Posts: 7
Rep Power: 3
Vito31388 is on a distinguished road
Marco,thanks for your reply but now I'd plot in a graph in Paraview the results written in the logSummary file; is it possible? How can I do it?
Vito31388 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Problems with extrapolation of pressure in BC Sergio Main CFD Forum 0 July 17, 2008 09:05
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 13:19
Has the pressure correction method problems? X. Ye Main CFD Forum 17 September 1, 1999 16:14


All times are GMT -4. The time now is 09:06.