convert .re2 to rea for MHD simulations

249 views
Skip to first unread message

Declan Keogh

unread,
Jul 31, 2023, 4:04:08 AM7/31/23
to Nek5000
Hi,

I have been trying to run simulations using the incompMHD equations in nek5000. When I use the .re2 and .par files I get an error saying that reading is not yet supported for the problem type. When I look at the source code it seems that the .par reader has not been set up for MHD problems yet.

 Number of MPI ranks :           1

 Reading /home/dkbrillz/Nek5000/run/mhd2/gpf.par
 value: INCOMPMHD
 not yet supported for problemType:equation!

an error occured: dying ...


real    0m0.149s
user    0m0.000s
sys     0m0.078s


Is there then a way to convert my .re2 file to a .rea file? I have tried using re2torea but I receive an error as follows:

 Input .rea & .re2 name:
gpf
 Input .rea output name:
gpfv3
At line 70 of file re2torea.f
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f56c7c3b32a
#1  0x7f56c7c3bed5
#2  0x7f56c7c3c69d
#3  0x7f56c7db2ca3
#4  0x7f56c7dabc44
#5  0x7f56c7dad379
#6  0x7f56c8401ce6
#7  0x7f56c8400fde
#8  0x7f56c7841b96
#9  0x7f56c8401009
#10  0xffffffffffffffff


Any help would be really appreciated.

Kind regards,

Declan

YuHsiang Lan

unread,
Aug 13, 2023, 11:05:08 PM8/13/23
to Nek5000
Hi Declan,

Which version of Nek5000 were you using?
par reader should support that syntax since a very long time

Also, how did you set it in your par file? It should be put under the session "problemtype".
  [PROBLEMTYPE]
  equation = "incompMHD"

About the re2torea error, which version were you using?
Can you post the git commit number? or check what's the line 70 in
    Nek5000/tools/reatore2/re2torea.f

Hope this helps,
Yu-Hsiang
--

Obabko, Aleksandr

unread,
Aug 14, 2023, 11:48:32 AM8/14/23
to YuHsiang Lan, Nek5000
Hi Decan (and Yu-Hsiang),

The MHD Nek5000 cases has to be run with the legacy input file .rea instead of .par so use gpf.rea.

Same goes for reatore2/re2torea tool that work with .rea and .re2 without .par

Aleks



From: nek...@googlegroups.com <nek...@googlegroups.com> on behalf of YuHsiang Lan <seanl...@gmail.com>
Sent: Sunday, August 13, 2023 10:05 PM
To: Nek5000 <nek...@googlegroups.com>
Subject: [nek5000] Re: convert .re2 to rea for MHD simulations
 
--
You received this message because you are subscribed to the Google Groups "Nek5000" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nek5000/5de8280d-898e-4998-853f-5b56b3ea7fe7n%40googlegroups.com.

Declan Keogh

unread,
Aug 14, 2023, 10:06:36 PM8/14/23
to Nek5000
Hi Yu-Hsiang and Aleks,

The reader_par.f file that you linked still has the following lines:
else if (index(c_out,'COMPNS') .eq. 1) then
write(6,*) 'value: ',trim(c_out)
write(6,*) 'not supported for problemType:equation!'
goto 999
else if (index(c_out,'INCOMPMHD') .eq. 1) then
write(6,*) 'value: ',trim(c_out)
write(6,*) 'not yet supported for problemType:equation!'
goto 999

In terms of the re2torea file I didn't realise that it required a template .rea file to write the new .rea file. I have since been able to get it to produce a .rea file but when I try to run the simulation using that .rea file an error is thrown which seems to be common to a number of threads on this forum.

My issue is that I am trying to model a cylindrical domain otherwise I would just use genbox to produce my file. So that I can get moving on the simulations I have manually edited the vortex examples mesh and edited it in prenek.

I am still working on the simulation setup though.

Declan

YuHsiang Lan

unread,
Aug 14, 2023, 10:37:25 PM8/14/23
to Nek5000
Hi Declan,

Sorry, I didn't find the "unsupport" line in par reader.
Please follow what Aleks said and use the re2+rea pair instead of re2+par.  

You can copy the rea from other example, do reatore2 to get the pure parameter rea file
This is a mhd example:

1. re2 + par puts mesh and boundary conditions into re2 and the control parameters into par.
2. The legacy re2+rea pair put the parameters into rea instead of par.
3. There is also a full ascii rea that contains mesh, BC and parameters.
The tools reatore2 and re2torea convert format between 2 and 3.
Also note that, for both tools, the input filename and output filename cannot be the same.
We should put a check...

Thanks,
Yu-Hsiang
--

Declan Keogh

unread,
Aug 15, 2023, 3:22:13 AM8/15/23
to Nek5000
Hi Yu-Hsiang,.

Are there any resources on the structure of the .rea file when using a pairing of .rea with .re2? This is my preference for running the simulations as gmsh is much more efficient than prenek for generating meshes.

Thanks for all of your help so far,

Declan

Yuan, Haomin

unread,
Aug 20, 2023, 9:58:27 AM8/20/23
to Nek5000, Declan Keogh

the explanation of parameters in rea can be found here.



Some examples contain the old format of  single rea file, (parameters+mesh).


You can use the tool reatore2 to convert it to rea+re2 files.

then you can see an example of rea file without mesh information.



From: 'Declan Keogh' via Nek5000 <nek...@googlegroups.com>
Sent: Tuesday, August 15, 2023 2:22 AM
To: Nek5000 <nek...@googlegroups.com>
Subject: Re: [nek5000] Re: convert .re2 to rea for MHD simulations
 
Reply all
Reply to author
Forward
0 new messages