CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   engineFoam with layers - pressure problems when adding layers (http://www.cfd-online.com/Forums/openfoam-solving/99214-enginefoam-layers-pressure-problems-when-adding-layers.html)

mturcios777 March 28, 2012 16:04

engineFoam with layers - pressure problems when adding layers
 
3 Attachment(s)
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

mturcios777 March 30, 2012 14:43

5 Attachment(s)
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!

Abhishekd18 May 30, 2012 00:20

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

mturcios777 May 30, 2012 13:00

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.

Abhishekd18 May 30, 2012 13:10

Yes. Layer removal runs perfect. I am using 1.6-ext version.

mturcios777 May 30, 2012 13:17

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?

Abhishekd18 May 30, 2012 13:22

pistonLayer

mturcios777 May 31, 2012 16:16

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.

nikwin August 9, 2012 10:03

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

conceptone October 12, 2012 13:39

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?

mturcios777 December 17, 2012 19:01

conceptone, did you still need help with this?

conceptone February 3, 2013 17:28

Hi Marco,
I am done with this problem, thanks and happy new year!

conceptone February 3, 2013 17:39

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

mturcios777 February 4, 2013 15:19

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.

conceptone February 4, 2013 21:59

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

mturcios777 February 5, 2013 13:15

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.

conceptone February 5, 2013 17:38

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);

Vito31388 April 11, 2013 05:41

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

mturcios777 April 11, 2013 16:21

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.

Vito31388 April 12, 2013 07:51

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?


All times are GMT -4. The time now is 18:15.