problem with initialization from 3D postprocessing

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

problem with initialization from 3D postprocessing

Post by fracenvi »

Hello everyone,

I'm currently trying to start a computation initializing the process with thermochemical fields already obtained in MED format. Searching through the users' guide book, i found an interesting example (https://www.code-saturne.org/documentat ... er_3d.html) on how to do that but it happens to not be good in my case since it keeps giving me the following error: *** buffer overflow detected ***: terminated.

Can anyone help me with that? I left attached my code.

Regards,
Francesco

EDIT: i modified the attached file relative to the initialization to better match the case reported in the example, and i've also added the med file i'm trying to import.
Attachments
cs_user_initialization-base.c
(6.39 KiB) Downloaded 429 times
restart_checkpoint_last_t.med
(5.82 MiB) Downloaded 426 times
Yvan Fournier
Posts: 4153
Joined: Mon Feb 20, 2012 3:25 pm

Re: problem with initialization from 3D postprocessing

Post by Yvan Fournier »

Hello,

In you case, be careful with checks on field ids. You are using field id 2 for velocity, while the id is usually 1, and testing relative to a field's name is usually safer. Also, an more importantly, you set n_remapper_fields = 4 but define only 2 field names to remap. This is probably what causes the issue.

If that does not solve the issue, try to run under a memory debugging tool such as Valgrind or use a build with AddressSanitizer (see the debugging section in the developer guide for details) to pinpoint the location of the crash.

Best regards,

Yvan
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: problem with initialization from 3D postprocessing

Post by fracenvi »

Hello Yvan,

thank you very much for the answer. I actually already tried to change the things you have mentioned but it still gives me the buffer overflow error. Also i've been trying to work with valgrind debugging but it is reporting no further info about the error when i run the code_saturne executable in the DATA folder, whereas when i try to run ./cs_solver it gives an additional error message (./cs_solver: error while loading shared libraries: libhdf5.so.200: cannot open shared object file: No such file or directory) which was not supposed to appear.

Is there any other way of solving this issue?

EDIT: Checking every line of the code with some checkpoint printf i noticed that the error is located in correspondence of:
int r_id = cs_medcoupling_remapper_initialize("init",
elts_dim,
"all[]",
file_name,
nremapper_fields,
field_names,
it0,
it1);
and still looking at the headers containing such function i can't manage to sort the issue.

EDIT2: Also i've been receiving always the same warning message as soon as the compilation of the SRC files ends (see attached files). I wonder whether that might be the real cause of the buffer overflow as i've attempted several different solutions in vain until now...

EDIT3: I managed to run the simulation with valgrind but it reports no errror at all now...
Attachments
warning message
warning message
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: problem with initialization from 3D postprocessing

Post by fracenvi »

Hello everyone,

I actually managed to solve the issue as it was related to the incompatibility of the libraries between MEDCoupling and HDF5 used at time of code_saturne compilation. Yet another problem arises as the thermo-chemical fields i'm working on, actually don't get initialized with the due values but simply with those introduced via the GUI. Any advice on how to manage this?

I attached also the files needed to reproduce the case i'm simulating plus the chemistry file on the bottom. (fyi: the mesh is the same that is in restart_fields.med)

Regards,
Francesco

9 Num current species
500 Num of tabulation point for enthalpy-temperature
298.0 TMAX
2700.0 TMIN

H2 O2 H2O N2 H O OH H2O2 HO2
0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 Abscoeff (radiation)
3 Num of elemental species / below: first column -> molar mass of elemental species; remaining -> elemental comp of species
0.001 2 0 2 0 1 1 1 2 1
0.016 0 2 1 0 0 1 1 2 2
0.018 0 0 0 2 0 0 0 0 0
2 Num of global species known (fuel,oxy,prod)
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Composition Fuel
0.0 1.0 0.0 3.76 0.0 0.0 0.0 0.0 0.0 Composition Oxydant
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Composition Products
Attachments
setup.xml
(11.99 KiB) Downloaded 435 times
restart_fields.med
(6.69 MiB) Downloaded 429 times
cs_user_initialization-base.c
(7.75 KiB) Downloaded 433 times
Post Reply