Interpolate results onto a different mesh

Questions and remarks about Code_Saturne usage
Forum rules
Please read the forum usage recommendations before posting.
kchinembiri
Posts: 18
Joined: Sun Feb 19, 2017 6:44 pm

Interpolate results onto a different mesh

Post by kchinembiri » Wed Jan 09, 2019 11:17 am

Hi all,

I am currently using Code_Saturne(5.2.0) for LES simulations in a sealed rod bundle. I have noticed a region of the mesh which could do with some additional refinement(I would be making some fairly slight adjustments, essentially shifting the cells and/or adding a few additional cells in the concerned region). Essentially, I need to restart the case using a different mesh. I wanted to ask, firstly is interpolating using code_saturne to code_saturne coupling still the preferred method ? and secondly what would be the basic steps to achieve this ?

Thank you for any assistance you can provide.

Regards,

Kenneth

Yvan Fournier
Posts: 2611
Joined: Mon Feb 20, 2012 3:25 pm

Re: Interpolate results onto a different mesh

Post by Yvan Fournier » Thu Jan 10, 2019 1:28 am

Hello,

Interpolating from one restart file to another is possible since december 10 2018 (very recent, so not yet in a 5.3 branch, but available in the master branch and imminent 6.0 beta).

Using versions 5.2 or 5.3, you could also use MEDCoupling for interpolation (requiring to configure the code for this at installation and programing a relatively straightforward user function).

Best regards,

Yvan

kchinembiri
Posts: 18
Joined: Sun Feb 19, 2017 6:44 pm

Re: Interpolate results onto a different mesh

Post by kchinembiri » Thu Jan 10, 2019 9:24 pm

Thank you for the suggestion Yvan. I will try and use the MEDCoupling approach first.

Yvan Fournier
Posts: 2611
Joined: Mon Feb 20, 2012 3:25 pm

Re: Interpolate results onto a different mesh

Post by Yvan Fournier » Fri Jan 11, 2019 1:40 am

Hello,

I forgot to mention this does not appear in a Doxygen example yet, but a MEDCoupling example (for surface interpolation) is available in src/user_examples/cs_user_boundary_conditions-medcoupling_remapper_2d.c.Adapting it to 3D usage in cs_user_initialization.c should be straightforward.c

Best regards,

Yvan

kchinembiri
Posts: 18
Joined: Sun Feb 19, 2017 6:44 pm

Re: Interpolate results onto a different mesh

Post by kchinembiri » Mon Jan 14, 2019 3:39 pm

Hi Yvan,

I have installed Code-Saturne 5.3.1 with MEDCoupling support enabled, but i have errors relating to MEDCoupling when i try to compile cs_user_initialize.c .

For example, initially I got an error when compiling stating code-saturne could not find cs_medcoupling_remapper.hxx

I then specified the absolute path to the header file and then got undeclared references to the following;
cs_medcoupling_remapper_by_id, cs_medcoupling_remapper_by_name_try, etc

I have attached the config.log hopefully you can spot what i have missed. Additionally, I should mention I am using the Salome libraries for hdf5, MEDCoupling & med.

I am not sure if I should start a new thread as this is now an installation issue.


Thank you & Regards,
Kenneth
Attachments
config.log
(226.41 KiB) Downloaded 18 times

Yvan Fournier
Posts: 2611
Joined: Mon Feb 20, 2012 3:25 pm

Re: Interpolate results onto a different mesh

Post by Yvan Fournier » Mon Jan 14, 2019 6:31 pm

Hello,

As MEDCoupling uses a plugin mechanism for linking by default, you might avoid the linking/library loading issues using a simpler build by adding "--disable-medcoupling-as-plugin" to the configure line, so I suggest to test this first.

Did you add

Code: Select all

#include "cs_medcoupling_remapper.hxx"
to the includes section of cs_user_initialize.c ?
That also is necessary.

Best regards,

Yvan

kchinembiri
Posts: 18
Joined: Sun Feb 19, 2017 6:44 pm

Re: Interpolate results onto a different mesh

Post by kchinembiri » Mon Jan 14, 2019 10:53 pm

Hi,

Thank you for the quick reply. To confirm, I have #include "cs_medcoupling_remapper.hxx" at the top of cs_user_initialize.c.

I have used the option --disable-medcoupling-as-plugin but I still have the same problem.

At compile i get fatal error: cs_medcoupling_remapper.hxx: No such file or directory. Specifying the absolute path to cs_medcoupling_remapper.hxx in src i get the undeclared reference errors().

Regards,

Yvan Fournier
Posts: 2611
Joined: Mon Feb 20, 2012 3:25 pm

Re: Interpolate results onto a different mesh

Post by Yvan Fournier » Tue Jan 15, 2019 3:47 pm

Hello,

Are you sure Code_Saturne was installed with MEDCoupling support ? (the option I suggested probably does not check that MEDCoupling detection is requested).

Best regards,

Yvan

kchinembiri
Posts: 18
Joined: Sun Feb 19, 2017 6:44 pm

Re: Interpolate results onto a different mesh

Post by kchinembiri » Tue Jan 15, 2019 4:27 pm

Hi Yvan,

Yes i believe so. During configuration i used with-medcoupling=<path to med_coupling library>. When I check the config-log I have cs_have_medcoupling='yes'. I have attached the config-log. Is there another check you think I can make ?

Additionally, I tried compiling the example "cs_user_boundary_conditions-medcoupling_remapper_2d.c" in case there was some mistake in the subroutine i had written. But i still had the same error.


Thank you & regards,

Kenneth
Attachments
config.log
(216.53 KiB) Downloaded 19 times

Yvan Fournier
Posts: 2611
Joined: Mon Feb 20, 2012 3:25 pm

Re: Interpolate results onto a different mesh

Post by Yvan Fournier » Wed Jan 16, 2019 1:22 pm

Hello,

Yes, this is strange. Do you have a copy of a failing case's "compile.log" (and user sources if posible) to see which paths are searched for (in case some headers are missing or not in the correct place) ?

Best regards,

Yvan

Post Reply