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
cannot access the added members to cs_fluid_properties_t
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 11
- Joined: Thu Mar 02, 2023 5:36 pm
cannot access the added members to cs_fluid_properties_t
- Attachments
-
- cs_physical_constants.h
- (6.95 KiB) Downloaded 626 times
-
- cs_physical_constants.c
- (27.34 KiB) Downloaded 623 times
-
- Posts: 4214
- Joined: Mon Feb 20, 2012 3:25 pm
Re: cannot access the added members to cs_fluid_properties_t
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
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