how to use the NormalSolver in a CFD problem

Numerical methods and mathematical models of Elmer
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

how to use the NormalSolver in a CFD problem

Post by Roland »

Hi,
I am working on a CFD model by using the laminar Navier Stokes equation in a liquid metal contained in a tank with a top free surface and submitted to an electromagnetic Lorentz body force produced by a surrounding high frequency inductor. In addition of these two coupled physics (electromagnetics and laminar Flow) a third "MeshUpdate" physic is activated in order to model the top free surface shape of the liquid due to the Lorentz force. This model is made in the GUI and after entering the classical ALE (Arbitrarian Lagrangian/Eulerian) relation on the free surface boundary by using the normal/tangential components of the Navier Stokes velocity to impose the normal mesh nodes displacement, I get error messages like "node X conflicting normal directions" and the solver fails.
I heard of a NormalSolver solver which could perhaps fix this problem but I don't know how to use this solver in the GUI, as it is not a .xml file in the edf-extra directory but it is a .dll file in the lib directory.
Does somebody know how to manage this kind of dll solver in the Elmer GUI?
Thanks in advance for any help about that!
Best regards
Roland
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: how to use the NormalSolver in a CFD problem

Post by Rich_B »

Hello Roland,

Short answer, you don't have to use Elmergui.

You can use Elmergui with the current set of edf files and edf-extra files, and create working sif files, which you have been doing.

Then, make a copy of your project folder, and start editing the sif file manually. This is a one way street, so you can no longer use Elmergui to edit the project, since it will overwrite the manually edited sif file.

So use Elmergui to create a basic working sif file with all the solvers you need from the edf/edf-extra xml files, followed by manually adding your other non-gui solvers. Use a command prompt to run your sif file.

(Note that it is possible to use Elmergui to run a manual sif file, although it may be a little awkward. Create your manually edited sif file in a separate folder. Start Elmergui in your copied project folder, click on 'Sif', then 'edit', followed by deleting the contents of the sif file. Open your manually edited sif file in an editor, select all and copy, followed by pasting into the empty Elmergui sif file. Then click on the green arrow inside the 'Sif' edit window, which will run the modified sif file.)

For examples of using NormalSolver in a working non-gui sif file, two test cases might be useful for you.

fem\tests\normals
fem\tests\Shell_With_NormalSolver

Hope this helps, let us know what happens.

Thanks, Rich.
Last edited by Rich_B on 20 Nov 2021, 22:41, edited 1 time in total.
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: how to use the NormalSolver in a CFD problem

Post by Roland »

Hello Rich,
Thanks for your answer and sorry for beeing a bit late to answer.
I will try what you explain in order to run a sif file with Elmer GUI.
I want to do that because for me it is easier to use the GUI since I don't know the Elmer commands syntax you see?
This is why I asked if it is possible to use a dll file solver (like the NormalSolver) like a xml file in the GUI.
Concerning the Elmer commands for editing manually the sif file, how is it possible to learn these commands?
Thanks in advance for your help!
Best regards
Roland
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: how to use the NormalSolver in a CFD problem

Post by Rich_B »

Hello,

To learn how to manually create and edit Elmer sif files, you should start by going through the tutorials. There are tutorials that use ElmerGui and also some tutorials that do not use ElmerGui. As you work through the tutorials, look at each sif file. You can learn a lot by reading each sif file.

Rich.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: how to use the NormalSolver in a CFD problem

Post by kevinarden »

There are numerous test files for every type of solver. Where you can look at the sif files

https://github.com/ElmerCSC/elmerfem/tr ... /fem/tests

To run the ElmerSolver from, the command line type, by default it runs the sif file in ELMERSOLVER_STARTINFO

ElmerSolver

or
ElmerSolver siffilename
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: how to use the NormalSolver in a CFD problem

Post by Rich_B »

Be sure to read the manuals located here:

http://www.nic.funet.fi/pub/sci/physics/elmer/doc/

In particular, the ElmerModelsManual and the ElmerSolverManual will give detailed information about each of the solvers, and how to create sif files for those solvers.

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

Re: how to use the NormalSolver in a CFD problem

Post by Roland »

Hi,
Thanks for your answer and again sorry to be a bit late for answering.
About the NormalSolver, say that I would make a transient fluid mechanics model consisting of a simple tank with a top moving freesurface. For that, I have to use the Navier Stokes FlowSolver and the MeshUpdate solver. But the problem is how to give the correct boundary condition on the top moving freesurface: the boundary condition is the (wellknown) ALE (Arbitrarian-Lagrangian-Eulerian) relation which says that the normal mesh nodes velocity must be equal to the normal Navier Stokes velocity. My questions are:
1/As the MeshUpdate solver variable is the displacement, how is it possible, in MATC language, to make a time integration of the normal Navier Stokes velocity to get a displacement? Meaning how write in MATC something like: displacement = time_integration_of_normal_velocity?
2/ Is it possible to write the ALE relation (meaning normal_mesh_nodes_velocity = normal_navier_stokes_velocity) in MATC as the Boundary condition on the top free surface? Is this possible in the GUI by clicking on "Use tangential-normal coordinate system"?
I have some discussions with Peter (Raback) about doing this with the NormalSolver but, as it seems a bit difficult, I wonder if this is possible without using the NormalSolver, but just by writing the ALE relation directly in the boundary condition (as in question 2 above).
It would be very wellcome if you had some ideas about that and is there some tuto or example of a fluid mechanics model using such a freesurface?
Many thanks in advance for your help!
Roland
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: how to use the NormalSolver in a CFD problem

Post by kevinarden »

sounds more like the freesurface solver not the normalsolver there are several test cases for freesurfce solver

https://github.com/ElmerCSC/elmerfem/tr ... /fem/tests
freesurface.png
freesurface.png (5.74 KiB) Viewed 1275 times
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: how to use the NormalSolver in a CFD problem

Post by Roland »

Hi,
Thanks.
But I heard that the Fresurface solver works for a freesurface which has end points against a wall. This will be ok for my tank example(I will take a look at your mentionned Freesurface examples). But after that I would like to make an electromagnetic "levitation"model which couples induction electromagnetics, Navier Stokes solver and moving mesh in order to levitate a liquid charge (of initially circular shape which then deforms) due to the electromagnetic forces. In this case the freesurface has no end points since it is levitating and don't touch any wall. Thus I wonder if it is still possible to use the Freesurface solver in this case? This is why I ask if it is possible (without the NormalSolver) to directly write (in MATC) the ALE relation in the freesurface boundary condition (meaning how get the normal components of the Navier Stokes velocity and then how make the time integration of this normal velocity to convert it into a displacement for the MeshUpdate boundary condition?)
If you have any idea....
Thanks
Roland
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: how to use the NormalSolver in a CFD problem

Post by raback »

Hi

So we are talking about Lagragian free surface problems here. Basically the Navier-Stokes should use the ALE formulation automatically given that the case is transient and MeshSolver is used to provide Mesh Update field.

The MeshSolver can deform the mesh but it needs some BCs. The most natural BCs for it are, for example, in case of FSI when you can directly associate the displacement of the structure to be the same as the mesh update field. Unfortunately for many problems this is not as easy.

In some free surface problems you are convecting the shape of free surface tangentially. You cannot use these directly for the MeshSolver as the mesh would get distorted. Then we have used FreeSurfaceSolver. Examples include computational glaceology and civilized sloshing tank. The assumption behind the solver is though that the height of free surface is h=h(x,y). Roland's case however is topologically a sphere where the free surface cannot be mapped to a plane.

As neither of the two strategies is possible I suggested a modification to the NormalSolver. Basically it can compute the normal vectors of any solver but now it can also project a vector field to that direction. So if you have a velocity field with both tangential and normal components you can pick up just the normal direction and feed that as BCs for the MeshSolver. Technically it seems to work there is just some problem in finding the right scale of this interesting problem that has not been solved with Elmer before.

-Peter
Post Reply