Page 1 of 1

cannot access the added members to cs_fluid_properties_t

Posted: Fri Oct 06, 2023 12:52 pm
by CandiceLIU
Dear Forum users,

I have added an additional member to cs_fluid_properties_t, tauhrp( heat release parameter) in the cs_physical_constants.h and finished the mian fluid properties structure and associated pointer and give the value of tauhrp=4.5 in the cs_physical_constants.c at the cs_get_glob_fluid_properties(). Meanwhile, I built up the binding for tauhrp to the Fortran code in cstphy.f90 and included the cs_c_bindings.f90 in the SRC folder. After I put these files into the SRC, I tried to use the tauhrp in the cs_user_parameters.c by fp->tauhrp=1.0. However, the code have the following error:

error: ‘cs_fluid_properties_t’ {aka ‘struct <anonymous>’} has no member named ‘tauhrp’
fp->tauhrp =1.0;

but the values of tauhrp=4.5 has been passed to the fortran code when I use it in the cs_user_modules.f90.


I have attached the cs_physical_constants.h and cs_physical_constants.c
Does anyone has the same issue as I have and any suggestions are appreciated.

Best regards,
Liyuan

Re: cannot access the added members to cs_fluid_properties_t

Posted: Fri Oct 06, 2023 9:30 pm
by Yvan Fournier
Hello,

Did you do those changes in the code_saturne sources and reinstall or do this only in your case's SRC ? If you change a .h file only in SRC, it usually won't work. And if you cannot explain to someone else under which conditions it is OK and under which conditions it will fail, dont' even try.

The clean way to do this is to modify and reinstall the whole code.

You might still have errors, as C/Fortran bindings can be subtly tricky, but those can be debugged.

Best regards,

Yvan