CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   sprayEngineFoam- Segmentation fault (https://www.cfd-online.com/Forums/openfoam-solving/110857-sprayenginefoam-segmentation-fault.html)

ris December 22, 2012 19:12

sprayEngineFoam- Segmentation fault
 
1 Attachment(s)
Hello,

I am attempting to run a simulation using sprayEngineFoam using a 72 degree sector of a cylinder. I have used the system folder and engine geometry files of enginefoam and the spraycloudproperties/chemistry/thermophysical/combustion files of sprayfoam.

I have set injection to begin at -40 CAD, at this point injection starts and will run until about -36 CAD where it will then crash, giving the following error:

Solving cloud sprayCloud

--> Cloud: sprayCloud
Added 2 new parcels

Cloud: sprayCloud
Current number of parcels = 3610
Current mass in system = 1.70977e-06
Linear momentum = (0.000166392 6.9773e-09 -3.26749e-05)
|Linear momentum| = 0.00016957
Linear kinetic energy = 0.0167423
Rotational kinetic energy = 0
Total number of parcels added = 3610
Total mass introduced = 2.00024e-06
Parcel fate (number, mass)
- escape = 0, 0
- stick = 0, 0
Mass transfer phase change = 2.90471e-07
D10, D32, Dmax (mu) = 3.91206, 4.50172, 111.982
Liquid penetration 95% mass (m) = 0.0280364

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 0.000444601, Final residual = 2.87983e-07, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.000470113, Final residual = 1.44322e-07, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.000604705, Final residual = 2.33324e-07, No Iterations 1
DILUPBiCG: Solving for C7H16, Initial residual = 0.000474272, Final residual = 1.67864e-07, No Iterations 1
DILUPBiCG: Solving for O2, Initial residual = 0.000474398, Final residual = 9.92173e-08, No Iterations 1
DILUPBiCG: Solving for CO2, Initial residual = 0.000309029, Final residual = 5.13046e-08, No Iterations 1
DILUPBiCG: Solving for H2O, Initial residual = 0.000309029, Final residual = 5.13046e-08, No Iterations 1
DILUPBiCG: Solving for hs, Initial residual = 0.000802303, Final residual = 4.58431e-07, No Iterations 1
T gas min/max = 339.898, 433
DICPCG: Solving for p, Initial residual = 0.027073, Final residual = 3.18903e-05, No Iterations 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 7.64935e-08, global = 5.54941e-09, cumulative = -4.36819e-05
DICPCG: Solving for p, Initial residual = 6.23113e-05, Final residual = 5.02629e-07, No Iterations 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.20153e-09, global = 9.24188e-10, cumulative = -4.3681e-05
DILUPBiCG: Solving for epsilon, Initial residual = 0.000277237, Final residual = 1.9287e-07, No Iterations 1
DILUPBiCG: Solving for k, Initial residual = 0.000247236, Final residual = 2.27356e-07, No Iterations 1
Mean pressure:1.40142e+06
Mean temperature:372.209
Mean u':3.21806
ExecutionTime = 6601.42 s ClockTime = 6614 s

Courant Number mean: 0.00323022 max: 0.0998081
deltaT = 1.34013e-07
Crank angle = -36.6628 CA-deg
deltaZ = 6.5285e-07
clearance: 0.0104988
Piston speed = 4.87153 m/s

Solving cloud sprayCloud
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib64/libc.so.6"
#3
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#4
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#5
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#6
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#7
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#8
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#9
in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam"
#10 __libc_start_main in "/lib64/libc.so.6"
#11
at /home/abuild/rpmbuild/BUILD/glibc-2.15/csu/../sysdeps/x86_64/elf/start.S:116
Segmentation fault

I have attached my case folder, please could someone have a look at this and see where I could be going wrong.

Many thanks,

ris.

ris December 23, 2012 13:44

Today I restarted the simulation from the last saved time, switched off adjustTimestep and reduced the deltaT, this seems to have solved the problem.
How does adjustTimestep alter the timestep? Is it solely based on the maxCo?

ris.

bigeddy January 7, 2013 18:56

Looks like adjustTimestep is simply a boolean variable, if you take a look at this in the source files shows where its used,

http://foam.sourceforge.net/docs/cpp...ce.html#l00031

also,

http://foam.sourceforge.net/docs/cpp...ce.html#l00260

im reading this a little bit late so im going to give a quick answer, the latter links lines of code around no 290, appears like the timestep for the discrete spray parcels is an integer fraction of the actual timestep. Its unclear to me currently as to whether or not the timestep of the actual simulation controlled by adjustTimestep accounts for the discrete phase velocity, which might also be causing your problem. i.e. a discrete particle should not move more than 1 domain cell per timestep, so that may also cause a segmentation fault since the program cant find the spray droplet in the cell (im speculating here only from experience with other codes).

Ill look into this further later this week.

Out of curiosity are you running any secondary atomization models? is there a minimum drop size before you remove it from the simulation i.e. any droplet less than 1 micro m?

G

ris January 8, 2013 14:41

Hello G,

Thank you for the response, I am only running the ReitzDiwakar breakup model no primary atomization.
The drop size distribution is Rossinrammler and the minimum value is 1e-6. The minimum particle mass is 1e-15.

This is another post I started last week with a few changes to my setup (mainly mesh).

http://www.cfd-online.com/Forums/ope...njections.html

I receive the same error as shown above, again restarting the simulation allows it to continue.

bigeddy January 9, 2013 17:59

Hi ris,

Im running your 72degree case atm (its taking a while, cfd whey hay :rolleyes:), -80 CAD after 4 hours, trying to get up to the point where a seg fault arrives. Ive turned off the chemistry and combustion so it speeds up faster.

Firstly, thank you for setting up a case a providing the files, I have to set up a different case myself will be running a full 3d, basic combustion engine with swirl and multiple injections in the near future.

Its peculiar how a seg fault ceases to exist once you restart, ill have to set the debug flags and recompile openfoam to trace back to a line number, unfortunately debug mode takes a lot longer to run.

Are you working on this for uni project work or something?

ris January 10, 2013 10:38

Hello,
I would recommend using the case from this thread: http://www.cfd-online.com/Forums/ope...njections.htm, There are problems with the mesh in the 72degree case.
It is peculiar how the restart allows the simulation to continue. From looking at the log files, it behaves as if the seg fault never occurred.
I am working on this for a Uni project.

bigeddy January 10, 2013 12:58

Yeah no worries, Im yet to run it with the debug flags, my computer should have recompiled openfoam by now. Although i don't have a line number yet, it may be running out of main droplet parcel array storage.

i.e. it allocates storage for a set number of spray parcels, once storage gets used up by all particles it tries to inject new ones but accesses a fictitious part of the array hence seg fault. During restart program reads number of particles existing in the restart files, then allocates storage for a factor > 1 of that amount i.e. it allocates storage for 150% of the number of particles in restart, hence you're simulation can go on up until it runs out of memory.

A work around fix would be to program a clause that pauses if array is 5% space remaining, a) allocates temporary array, b)copies existing array of particle data into temporary array, c) de-allocates the main and reallocates the main array with another factor of space, then d) copies temporary array over and deallocates temporary array.

I may not have time to code a fix soon myself but the processes i mentioned should already exist within the code as classes. I haven't really looked for them but if you can find the classes that perform those tasks it will save some time in the long run.

Ill know if its the problem for certain once I get a line number where the seg fault occurs, until then im still speculating. Ill need to get this fixed myself anyways.

Un-related to the issue at hand but have you tried running either your cases in parallel by any chance?

ris January 10, 2013 14:12

Hello,

Thanks for the information, I will have a look at it when I get some time.

I did try to run the cases in parallel but they crash at SOI. This is a bug and a report has been submitted:

http://www.openfoam.org/mantisbt/view.php?id=577

There is a workaround shown on the bug report that I am yet to implement.

A heads-up: as you will be running a similar case you might encounter the janaf problem, if it occurs refer to this http://www.cfd-online.com/Forums/ope...ombustion.html

carl_xw4 March 6, 2013 07:06

Hi all,

Did any of you manage to get the case up and run?

I have a problem at SOI. It went a little further if I reduced the number of parcel per second, but the temperature went crazy. :eek:

I have tested my case in older OpenFOAM and it worked perfectly. :confused:

Please advise. Thanks.
Carl

ris March 6, 2013 09:41

Hello Carl,

I have managed to get the case to work, well kind of... I am using a different mesh now and have reduced the parcelspersecond to 2e6. The case runs to the end, although this seems be random as when I change my injected mass it segfaults at the second injection. However restarting it allows it to continue to the end.
With regards to the temperature, check that the mass injected is equal to what you have specified in the sprayCloudproperties file.


regards,

ris


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