Levelset method

Numerical methods and mathematical models of Elmer
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Levelset method

Post by kevinarden »

I general it is turned on by the parameters

Adaptive Mesh Refinement = True
Adaptive Remesh = True
Adaptive Save Mesh = False
Adaptive Error Limit = 0.01

in the solver section
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Levelset method

Post by kevinarden »

There are several adaptive mesh examples in the test cases

https://github.com/ElmerCSC/elmerfem/tr ... daptivity1
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Levelset method

Post by Roland »

Hi Kevin,
Yes I tried this from the adaptivity3 Github test but it does not work and the solver stops after 1s when he tries to make a first mesh refinement.
I attach the zipped Gui project in which I added the adaptive mesh refinement command lines in the free text area of the Navier Stokes solver.
It would be very nice if you could take a look at it and see what could be done to get mesh refinements in order to avoid this problem of mesh overlapping after a few seconds in the corner of the growing crystal which I metionned in the former post.
Thanks in advance for your help and we keep us informed.
Roland
"
Attachments
Phase_Change_Cp_eq_02_Adapt.zip
(249.17 KiB) Downloaded 23 times
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Levelset method

Post by kevinarden »

I will take a look
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Levelset method

Post by raback »

Hi,

I would dare to expect the adaptivity to work here. There is just too much happening. The error indicators do exist for heat solver and N-S solver. Which error should be controlled? Probably heat solver. I'm dubious whether enthalphy is included in the here. Also the in memory adaptivity takes use of MMG library which is tedious to compile.

When the error indicators & MMG do work they are indeed very nice machinery.

-Peter
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Levelset method

Post by kevinarden »

I got farther by making these changes but it still was a bomb
Adaptive Mesh Refinement = TRUE
Adaptive Remesh = TRUE
Adaptive Error Limit = 0.0001
Adaptive Save Mesh = True

there may be an issue since you are using many solvers, not just one.



FlowSolve: iter: 20 Assembly: (s) 0.16 3.28
FlowSolve: iter: 20 Solve: (s) 0.00 0.11
FlowSolve: Result Norm : 6.4077299769010548E-005
FlowSolve: Relative Change : 4.0180537780020653E-003
RefineMesh:
RefineMesh: ----------- M E S H R E F I N E M E N T --------------
RefineMesh: Initializing stuff on coarsest level!
RefineMesh: Using file I/O for mesh refinement
WARNING:: ListFind:
WARNING:: ListFind: Requested property: [Mesh Input File], not found
WARNING:: ListFind:
Mesh input file: ././
Mesh output directory: ./RefinedMesh1
*** ERROR: Error opening file: ././
ERROR:: systemc: Command exit status was 1
ElmerAsciiMesh: Base mesh name: ./RefinedMesh1
RefineMesh: The new mesh consists of:
RefineMesh: Nodal points: 630
RefineMesh: Bulk elements: 1141
RefineMesh: Boundary elements: 119
BuildQuandrantTree: Start
BuildQuandrantTree: Ready

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

Backtrace for this error:
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Levelset method

Post by Roland »

Hi,
Thanks Peter and Kevin for these elements.
My idea was to get an adaptive mesh only for the Navier Stokes velocity (since, as the velocity changes a lot around the phase change interface, a refined mesh could perhaps work, but not sure). So I will remove the error indicator for the temperature(I don't think that the temperature error indicator will trig a refined mesh since the temperature varies too smoothly).
But more generally, as I am not sure at all that a refined mesh will solve the problem of the mesh overlapping, is there another way to fix this problem?
Please, Peter, could you also give some explanations about what is the MMG library?
And finally could it be possible to get a working mesh refinement (or remesh) on the velocity error indicator in my model, just to see what it gives?
Many thanks in advance for you help
Roland
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Levelset method

Post by Roland »

Hi,
As discussed about my crystal_growth model, I kept the adaptive mesh refinement only in the Navier Stokes solver.
But unfortunately the mesh refinement does not work and the solver gives following message:

*********************************************************************************************************************
RefineMesh: ----------- M E S H R E F I N E M E N T --------------

RefineMesh: The new mesh consists of:
RefineMesh: Nodal points: 1233
RefineMesh: Bulk elements: 2283
RefineMesh: Boundary elements: 188

BuildQuandrantTree: Start

BuildQuandrantTree: Ready


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

Backtrace for this error:
#0 0x404bc3eb
#1 0x40437034
#2 0x1ba52231
#3 0x96bc7ff7
#4 0x984f221e
#5 0x984a14b3
#6 0x984f0d2d
#7 0x9847e3ca
#8 0x9847b44c
#9 0x96bb9d3f
#10 0x404c8644
#11 0x404b9e87
#12 0x404cd20f
#13 0x4e4a6299
#14 0x4e78c342
#15 0x7fcbe2e7
#16 0x4e75a506
#17 0x4e7733e3
#18 0x4e775147
#19 0x4e7764d3
#20 0x4ea37416
#21 0x4ea3ef86
#22 0x1ba516ef
#23 0x1ba52ac3
#24 0x1ba513c0
#25 0x1ba514f5
#26 0x970d7343
#27 0x984a26b0
#28 0xffffffff
*********************************************************************************************************************
Here attached is the zipped GUI project.
It would be very nice if you could take a look at it and make a suggestion for having this mesh refinement work.
Thanks in advance for your help!
Roland
Attachments
Phase_Change_Cp_eq_02.zip
(249.07 KiB) Downloaded 21 times
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Levelset method

Post by Roland »

Hi,
While waiting for some help about the unsuccessful mesh refinement problem mentionned in the former post, I tried to run the Github fem/tests "Levelset1" example in order to better understand how to use the levelset solver (this Eulerian approach could avoid the mesh overlapping problem which I mentionned in my crystal_growth model which uses for the moment the Lagrangian approach for the free surface moving).
But unfortunately, when trying to solve this "Levelset1" case, I get following error message:

Loading user function library: [InitSquare]...[InitSquare]
Can not find InitSquare.
Can not find InitSquare.dll.
Can not find .\InitSquare.
Can not find .\InitSquare.dll.
Can not find C:\Program Files\Elmer 9.0-Release/share/elmersolver/lib\InitSquare.
Can not find C:\Program Files\Elmer 9.0-Release/share/elmersolver/lib\InitSquare.dll.

Tanks in advance for any help for fixing this problem !
Roland
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Levelset method

Post by Rich_B »

Hello Roland,

Searching elmerfem for 'InitSquare' shows that InitSquare.F90 exists in the Levelset1 test folder. One must compile this source file manually with this command in the test folder in a windows command prompt:
elmerf90.bat InitSquare.F90 -o InitSquare.dll
For linux, the output filename would be *.so

Then running the test manually should work.

Rich.
Post Reply