Transient Phase Change Solver

Numerical methods and mathematical models of Elmer
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Transient Phase Change Solver

Post by Rich_B »

Hello Roland,

Peter's attached archive isn't an ElmerGUI project, so it would not load. The contained readme.txt file gives the instructions on how to run the case from the command prompt. If I remember right, you are running Windows, so allow me to provide some guidance.

Unzip the archive and change into the new directory.
Open the Readme.txt file in an editor.
Open a command prompt in the new directory.
change the line
elmerf90 -o HurleProfile.so HurleProfile.F90 ! or .dll in Windows
to be
elmerf90 -o HurleProfile.dll HurleProfile.F90
.
Copy and paste the modified line into your command prompt window and press enter. You should have the newly compiled HurleProfile.dll in your directory.
next, enter in the command prompt window:
elmergrid 14 2 CG_04 -autoclean
This should generate the Elmer format mesh files.
next enter in the command prompt window:
elmersolver case.sif
The resulting vtu files will be in the CG_04 folder.

Hope this helps, Rich.
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Transient Phase Change Solver

Post by Roland »

Thanks a lot, Rich, for these precious help elements!
I will try this and keep you informed.
Roland
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Transient Phase Change Solver

Post by raback »

Hi Roland,

Note that you need the nightly build. I did minor updates.

There is no basic reason why this could not be done with ElmerGUI (either using the custom box or adding some keywords to XML files). However, when trying to get a complicated problem to work properly we always do it manually editing the sif file. Then, if so desired, we try to reproduce the case with the GUI.

-Peter
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Transient Phase Change Solver

Post by Roland »

Hi Peter and Rich,
After following your instructions, Rich(thank you for your help!), your file, Peter, works well with the prompt commands.
Plot_0.12s.PNG
(187.34 KiB) Not downloaded yet
Plot_0.1s.PNG
(160.07 KiB) Not downloaded yet
As seen on the attached plots, the phase change interface goes nicely a little upward at 0.1s(with fixed triple point), but a little later, at 0.12s, the mesh seems to "explode". This is perhaps due to the parameters values which must be well choosen...? Is it for instance to choose a bigger crystal radius than 10 mm, say 20 or 30 mm?
But more generally say that I have some questions about this model, which are following:
1/ What is exactly this HurleProfile program? What does it do?
2/ What does the command line "elmerf90 -o HurleProfile.so HurleProfile.F90 ! or .dll in Windows"
and the command line "ElmerGrid 14 2 *.msh -autoclean"?
3/ In the case.sif file , on boundary condition_7 (the liquid free surface), what does the command line "Mesh Update 2 = Variable "Coordinate 1"
Real Procedure "HurleProfile" "HurleProfile"?
Is this the same as the "ComputeNormal" solver which, according to your explanations, Peter, calculates the normal Navier Stokes displacement on the liquid free surface (as you saw this works well for the EM_levitation models)?
4/ More more generally, I will have to make a presentation of the Elmer models which I have made these last months to my lab (the people are more and more interested by Elmer...!). As I worked mainly with the GUI for the moment, I don't know very much about the whole Elmer software context, meaning what can be done with Fortran, with Python, etc.... So, Peter, is there perhaps a recorded webinar or some documentation which presents the general context of Elmer?
Many thanks in advance for your help and we keep us informed.
Roland
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Transient Phase Change Solver

Post by Rich_B »

Hello Roland,

As Peter mentioned, one must use the installer with the recent changes. Yesterday, I ran the case using the windows installer dated 25 Jan 2023, and at about iteration 10, the mesh starts to explode, and only ran to about 20 iterations before stopping early. Then today, using the windows installer dated 26 Jan 2023, the same case posted by Peter ran to completion at 100 iterations, with a nicely behaved mesh. So if you download and install any version dated 26 Jan 2023 or newer, it should run properly.

For item 2, the elmerf90 command compiles the HurleProfile.F90 Fortran source code into an executable windows dll, which Elmersolver then can call and run.

Also for item 2, the command 'elmergrid 14 2 *.msh -autoclean', is the elmergrid command line equivalent of 'File -> Open' a gmsh msh file in ElmerGUI. Note that I had to change it to be 'elmergrid 14 2 CG_04 -autoclean', probably because the windows command prompt didn't like using '*.msh' for the input file name.

Rich.
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Transient Phase Change Solver

Post by Roland »

Hello Rich,
Ok now I understand the things better(I didn't well understand when Peter said"you need fresh code"...)!
I will install the latest Elmer version and keep you informed.
Yet many thanks for your precious help!
Roland
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Transient Phase Change Solver

Post by raback »

Hi

The "HurleProfile" gives an analytical profile for the shape of the free surface. Some of my colleagues wrote that long ago and I found it on some old repo. As the name suggest this is probably from some paper published by Hurle et al. I would guess that this shape that is related to surface tension has a time scale much smaller than that related to liquid-solid interface. If the shape is not really what you're studying then computing it as a transient problem makes things more difficult. Also, when radiation heat transfer & view factors are added to the computation you should recompute the view factors every timestep if geometry changes which is also somewhat overkill.

In the case of molten metal in magnetic field we had to use the NormalSolver since the suggested displacements were not a bijection. Now we have the luxury that the displacement u_z=u_z(r) which means than we can make the mesh follow the free surface just tampering with the z coordinate of the (r,z) coordinate system. For arbitrary shape we should use some local coordinate system and hence NormalSolver.

-Peter
sebastien ROUQUETTE
Posts: 97
Joined: 05 Nov 2011, 16:50
Antispam: Yes
Location: Nimes, France

Re: Transient Phase Change Solver

Post by sebastien ROUQUETTE »

Hi guys,

i just interfere quickly in your discussion without reading all the previous post.
I have a question to Peter Raback:

"In the case of molten metal in magnetic field we had to use the NormalSolver since the suggested displacements were not a bijection. Now we have the luxury that the displacement u_z=u_z(r) which means than we can make the mesh follow the free surface just tampering with the z coordinate of the (r,z) coordinate system. For arbitrary shape we should use some local coordinate system and hence NormalSolver. "

Does that mean that we can use the free surface solver and mesh update under 2D axi-symmetry assumption?

thanks for your reply

Keep going all of you on this subject because it is interesting .. quite far from my field "welding" but at some point it could help me !

Cheers

Sebastien
Rouquette Sébastien
University of Montpellier / Mechanical and Civil Engineering Lab. / Welding Group
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Transient Phase Change Solver

Post by raback »

Hi

The PhaseChangeSolver is a special type of FreeSurfaceSolver used in conjunction with HeatSolver. Both solvers assume that you can make a dimensional reduction such that the solvers work in (x,y) plane and map z coordinate (in cartesian 3D, and other coordinate system similarly).

-Peter
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Transient Phase Change Solver

Post by Roland »

Hi,
Thanks a lot, Peter, for all your clarifying explanations.
As discussed I will install the latest Elmer version and run again your HurleProfile model. I hope also that my model (I guess you saw the promizing animation over 10s?), which sure is simplified, will also work better with the latest code (meaning will it solve over a longer time, for instance 100s or 500s?).
Still many thanks and we keep in touch.
Roland
Post Reply