Elmersolver crashes when Porous Media is activated

Numerical methods and mathematical models of Elmer
kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Elmersolver crashes when Porous Media is activated

Post by kishpishar » 16 Jul 2018, 22:09

Dear All,

I am trying to simulate solidification of hot metal in a cavity (top isolated; cooled from other 3 sides) using heat and navier-stokes solvers with 'spatial 2' phase change model and Boussinesq body force. I need to model the liquid part like a porous media, so I added Porous Media in the Materials section. As soon as this keyword is activated, the solver crashes with the output:

ELMER SOLVER (v 8.3) STARTED AT: 2018/07/16 15:00:49
ParCommInit: Initialize #PEs: 1
MAIN:
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 8.3 (Rev: unknown, Compiled: 2018-04-21)
MAIN: Running one task without MPI parallelization.
MAIN: Running with just one thread per task.
MAIN: HYPRE library linked in.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Loading input file: case.sif
WARNING:: LoadMesh: Unset BC already set by > Target Boundaries < : 3
MAIN:
MAIN: -------------------------------------
MAIN: Time: 1/100 1.0000000000000000
MAIN: -------------------------------------
MAIN:
SolveEquations: -------------------------------------
SolveEquations: Coupled system iteration: 1
SolveEquations: -------------------------------------
ComputeChange: NS (ITER=1) (NRM,RELC): ( 999.92102 2.0000000 ) :: heat equation
ComputeChange: SS (ITER=1) (NRM,RELC): ( 999.92102 2.0000000 ) :: heat equation
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.64272574E-04 1.9581613 ) :: navier-stokes
ComputeChange: SS (ITER=1) (NRM,RELC): ( 0.64272574E-04 2.0000000 ) :: navier-stokes
SolveEquations: -------------------------------------
SolveEquations: Coupled system iteration: 2
SolveEquations: -------------------------------------
ComputeChange: NS (ITER=1) (NRM,RELC): ( 999.88155 0.39474813E-04 ) :: heat equation
ComputeChange: SS (ITER=2) (NRM,RELC): ( 999.88155 0.39474813E-04 ) :: heat equation

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7FA737BE2E08
#1 0x7FA737BE1F90
#2 0x7FA7378324AF
#3 0x7FA737881512
#4 0x7FA737F7A2C0
#5 0x7FA7383E36A7
#6 0x7FA728550C5A
#7 0x7FA737FA9DD6
#8 0x7FA7381F499C
#9 0x7FA7381F2B06
#10 0x7FA73820384B
#11 0x7FA7382049C6
#12 0x7FA7384D1715
#13 0x7FA7384CB0F3
#14 0x40115F in MAIN__ at Solver.F90:?
Segmentation fault (core dumped)

Here is my sif file for reference. Any thoughts please?

Kumar
Attachments
case.sif
(3.13 KiB) Downloaded 18 times

dmitry
Posts: 50
Joined: 09 Dec 2014, 16:52
Antispam: Yes
Location: Russia

Re: Elmersolver crashes when Porous Media is activated

Post by dmitry » 20 Jul 2018, 13:58

Hi!
I remember, there was nice conversation with you a year ago :D May be now I also can help you.
I made a simple 2D GUI case for you (see in Mesh_1 folder), where massive composite casing of A356 alloy is crystallizing.

Elmer model manual says that for porous medium flow resistivity is to be specified, which is r=1/k reverse of Darcy permeability. In your sif it is 0.
Also Elmer model manual advises for porous medium to use bubbles stabilization only .

Code: Select all

  Stabilize = False
  Bubbles = True
Also for transient simulations Temporal method of eff. Heat capacity calc. is preferred.

Code: Select all

 Phase Change Model = Temporal
And finally, may be SIGSEGV: Segmentation fault - invalid memory reference is appearing when mesh is not proper (but I'm not sure).

https://drive.google.com/open?id=1oZuli ... prHHCNXRxs

kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by kishpishar » 20 Jul 2018, 23:41

Hi Dmitry,

Thanks very much for your working case file and observations!! I will do these and a couple of other modifications and will get back to you. As you suggested, I need to make sure there are no issues with the mesh.

kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by kishpishar » 29 Jul 2018, 15:19

Hi Dmitry,

Your case runs fine on my windows computer as well as on a previously compiled Elmer on Ubuntu (both running Elmer-8.3) but not on my newly installed Elmer on Ubuntu (compiled using cmake). So it looks like something is wrong with either my compilation or the mesh as you said. I'll recompile once more and see what happens. Thanks for your case and suggestions.

Kind Regards

raback
Site Admin
Posts: 3291
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmersolver crashes when Porous Media is activated

Post by raback » 01 Aug 2018, 00:12

Hi

The porous media model here is really simple: it just adds a resistivity term (isotropic or not) to the fluid that presents the friction by the media. The intended use could be a filter region in some device. If the drag dominates then the equation simplifies to Darcy flow. The idea here has been that Navier-Stokes is still necessary as the additional drag is only localized.

Now in your case you have zero resistance so the term does not even do anything. What if you add a finite resistance?

-Peter

kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by kishpishar » 01 Aug 2018, 10:26

Hi Peter,

The case crashed with a finite resistance at first, so I put a zero resistance just to see if it makes any difference. This should make no difference to the NS but still it crashed.

However the crash is occurring only on my newly compiled version (Elmer-8.3, using cmake) on Ubuntu 16.04 LTS. The case runs perfectly on an older compilation (Again Elmer-8.3) on Ubuntu 14.04 LTS. So I think something got broken in my new version. I will see if the problem persists after re-installing.

Thanks, Kumar

raback
Site Admin
Posts: 3291
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmersolver crashes when Porous Media is activated

Post by raback » 01 Aug 2018, 10:48

Hi Kumar,

Maybe you could share a minimal version of your problem. It is hard to capture the potential bugs simply by viewing the sif file.

-Peter

kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by kishpishar » 01 Aug 2018, 20:31

Hi Peter,

Here is a minimal version of my case. Also included is the solver dump (file 'log').

Regards/Kumar
Attachments
PorousMedia.tar.gz
(94.97 KiB) Downloaded 13 times

annier
Posts: 1102
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by annier » 10 Aug 2018, 16:08

Hi Kumar,
I too obtained segmentation fault when i activate porous media:

Code: Select all

porous media = logical true
I will seek the work around and reply you back.


Yours Sincerely,
Anil Kunwar

kishpishar
Posts: 31
Joined: 17 Jun 2015, 10:04
Antispam: Yes

Re: Elmersolver crashes when Porous Media is activated

Post by kishpishar » 13 Aug 2018, 09:45

Hi Anil,

Thanks for your efforts! As I said before, this crash comes only with a newly compiled Elmer (v8.3, cmake) on Ubuntu 16.04 LTS. I need to upgrade to 18.04 LTS anyway - so I will see if this problem still persists with the latest LTS version.

By the way, I assume your helpful instructions on compiling using cmake holds good for Ubuntu 18.04 as well. I will keep you guys posted -

-kumar

Post Reply