Transfer basal drag from one mesh to another mesh

Extension of Elmer in computational glaciology
hanbinglele
Posts: 4
Joined: 23 Mar 2016, 08:32
Antispam: Yes

Transfer basal drag from one mesh to another mesh

Post by hanbinglele »

Hi, Elmer users

I simulated the basal drag coefficients from the Adjoint Inverse methods for a 3D mesh (See attached fig). The mesh is just for grounded ice as the feeding glacier of the Wordie Ice Shlef on the Western Antarctic Peninsula.

I am going to do sensitivity test about adding the ice shelf to the grounded ice by using the same basal drag from above running. Is it possible to transfer the basal drag coefficients from one mesh to another new one? Could we 'turn off' the ice shelf bottom part and just applying the basal drag on the grounded ice bottom?

If yes, how to do it?

Many thanks in advance!

Best regards,
Chen
Attachments
Distribution of basal drag coefficient
Distribution of basal drag coefficient
Screen%20Shot%202016-09-26%20at%2012.20.39%20pm.png (249.36 KiB) Viewed 10690 times
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by rgladstone »

To clarify: we want to run a pair of transient simulations, one with an ice shelf and one without, both with the same grounded region. We can apply the inverse method on one of these setups prior to the transient simulations in order to obtain basal drag coefficient distribution. Ideally we would take this same drag distribution and use it in both transient simulations (because this aims to be a pure sensitivity experiment, and interpolation would slightly degrade the data). But normally the meshes would be different, because one mesh must include the ice shelf (we're using yams for refinement). Is there a way to ensure that the grounded part has the same mesh? If so is there a way to directly transfer the drag coefficient from one mesh to another? Or would we need to ensure the entire mesh is the same if we want to transfer data directly without interpolating? If there entire mesh is the same for both simulations, is there a way to turn off the ice shelf part in one of them?

Failing that, an interpolation of basal drag from one mesh to another would be the way to go. Does Elmer support this or do we need to write some new code for it? In fact, in general the facility to restart from a different mesh (such as when changing resolution) would be a useful feature for Elmer to have.

Thanks!
Rupert
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Transfer basal drag from one mesh to another mesh

Post by raback »

Hi Rupert

Basically I think there is the interpolation routine available. You could test it:

1) Have some solver and mesh that produces the "basal drag"
2) For an interpolation solver specify a different mesh in the solver section keyword "Mesh"
3) In the interpolation solver just ask Var => VariableGet( Mesh % Variables,'basal drag') and the machinery should produce the field in this mesh as well.

Now since you need the results from the 2D surface only the projection should be done for the 2D surface only. I think something like this has been done but didn't find it in the code. There must have been something like this in the calving toy model...

-Peter
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by rgladstone »

Hi Peter, let me clarify: are you saying that there is an interpolation solver (I couldn't find one in the models manual), or that the VariableGet routine will do the interpolation? If the latter, then we need to write a new short solver defined on our target mesh in which we call VariableGet on a variable defined on our source mesh?

I haven't yet carried out any simulations using more than one mesh. Is there documentation for this, or examples somewhere? I've found only a brief mention of the "mesh" solver keyword for telling Elmer to run a solver on a different mesh.

If we run a first simulation on one mesh, lets call it the source mesh, can we then do a second simulation in which we restart from the .result file from the first simulation, with meshDB set to the source mesh (same as the first simulation), but in which an additional mesh, lets call it the target mesh, is specified in one of the solvers? Or is this not possible because the restarted simulation would have more meshes than the first simulation? If this is possible then we can have a separate sif and Elmer simulation just for the interpolation of basal drag onto the new mesh.

If I carry out a simulation on 4 processes using 2 different meshes, should each mesh have 4 partitions or 2 partitions? Do the default .result files include both meshes? Or can we specify that we want the results files to apply to a particular mesh? If we want .vtu outputs on a particular mesh, can we also use the mesh keyword in the result output solver section?

Thanks!
Rupert
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by rgladstone »

P.S. Does the mesh extrusion caused by the keyword in the simulation section apply to all meshes or only the mesh defined by meshDB?
fgillet
Posts: 46
Joined: 30 Sep 2010, 16:58

Re: Transfer basal drag from one mesh to another mesh

Post by fgillet »

Hey,

to do this I often save my results in an ascii file (x,y,value) and use the Scattered2DDataInterpolator ( http://elmerice.elmerfem.org/wiki/doku. ... :scattered) to interpolate in the new mesh. This solver use external librairies that implement Natural neighbours and cubic spline interpolation methods.

I also this that there is a ResultToResult.F90 file under fem/src.
You can read in the header of the file:
!> Stand-alone program for Elmer results file to Elmer results processing
!> file conversion. The meshes may be different for the two result files.

seems interesting but haven't tried yet.

But it always may be problematic when we are only interesting by interpolating plane view 2D fields only on boundaries.

fab
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by rgladstone »

Thanks Fab. Is there a standard way to write results in that x, y, value ascii format direct from Elmer (using save data or result output solver)? Or do you reformat a .ep or .result file?

Cheers,
Rupert
fgillet
Posts: 46
Joined: 30 Sep 2010, 16:58

Re: Transfer basal drag from one mesh to another mesh

Post by fgillet »

Yes best with "savedata" "saveline" to save values on a boundary;
But it is always possible to save csv files with paraview if you only have vtus results.

then "awk" to produce "x,y,value"

fab
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by rgladstone »

Great, thanks!
hanbinglele
Posts: 4
Joined: 23 Mar 2016, 08:32
Antispam: Yes

Re: Transfer basal drag from one mesh to another mesh

Post by hanbinglele »

Hi, Fab

Many thanks for your suggestions.

I saved the basal drag coefficeint from inversion in a parallel running using 'saveLine'. So the beta.dat file was saved into 8 separate files (see attached screenshot).

Then I tried to interpolate beta in another parallel running (see attached sif file).

After loading the restart file, there is an error saying (see attached error file):
ERROR:: Scattered2DDataInterpolator: Unable to open file beta.dat

May I ask whether this solver could work well in a parallel running?

Thanks,
Chen
Attachments
o237515.txt
error file
(10.87 KiB) Downloaded 480 times
steady.sif
sif file
(6.94 KiB) Downloaded 531 times
beta.dat
beta.dat
Screen Shot 2016-11-10 at 10.54.44 am.png (13.22 KiB) Viewed 10600 times
Post Reply