Configuration is:
==========
Hardware setup: Local server (Dell R620, 24 cores, local MPI)
OS: CentOS 7.5 KDE + vault repo
Kernel: 3.10.0-1160.66.1.el7.x86_64
System gcc: 4.8.5
MPI: OpenMPI-1.8.4 (I consider newer versions problematic)
My old Saturne 7.0.2 version worked good with this configuration. Trying to compile 8.2.0 version I found that it requires full C11 support so I installed devtoolset-7 to obtain newer gcc-7.3.1 (system gcc was not touched, there is a special shell [environment variables] created with "source /opt/rh/devtoolset-7/enable" command). Full C11 support started from gcc-4.9.
With new gcc Saturne compiles without errors, bit I face problems running my user code. It's a small library for relaxation and limitations for stability, heat exchanger model and hand-made gas combustion model.
I started with current feature version 8.2.0. First thing I encountered was user code compilation test error. Digging a bit I found that it originates from including "cs_headers.h". Error is:
Code: Select all
In file included from /Programs/Code_Saturne-8.0.4-MPI-1.8.4/install-std/include/code_saturne/cs_base_headers.h:55:0,
from /Programs/Code_Saturne-8.0.4-MPI-1.8.4/install-std/include/code_saturne/cs_headers.h:41,
from /run/media/antech/WD-Data-500/Storage/Media/Work/PK-176/Saturne/RESU/20241219-1319/src/CmnParSet.c:22:
/Programs/Code_Saturne-8.0.4-MPI-1.8.4/install-std/include/code_saturne/cs_field_pointer.h:51:41: error: ‘CS_FIELD_POINTER_r11’ undeclared (first use in this function); did you mean ‘CS_FIELD_POINTER_f1m’?
Code: Select all
typedef enum {
...
CS_ENUMF_(r11), /*!< Reynolds stress component \f$ R_{xx} \f$ */
CS_ENUMF_(r22), /*!< Reynolds stress component \f$ R_{yy} \f$ */
CS_ENUMF_(r33), /*!< Reynolds stress component \f$ R_{zz} \f$ */
CS_ENUMF_(r12), /*!< Reynolds stress component \f$ R_{xy} \f$ */
CS_ENUMF_(r23), /*!< Reynolds stress component \f$ R_{yz} \f$ */
CS_ENUMF_(r13), /*!< Reynolds stress component \f$ R_{xz} \f$ */
CS_ENUMF_(rij), /*!< Reynolds stress tensor \f$ R_{ij} \f$ */
...
}
Code: Select all
typedef enum {
...
CS_ENUMF_(rij), /*!< Reynolds stress tensor \f$ R_{ij} \f$ */
...
}
Then, when I started calculation, another compile error appeared:
Code: Select all
/run/media/antech/WD-Data-500/Storage/Media/Work/PK-176/Saturne/RESU/20241219-1307/src/cs_meg_source_terms.cxx:52:13: error: ‘temperature’ does not name a type; did you mean ‘temperature_vals’?
const temperature = temperature_vals[c_id];
^~~~~~~~~~~
I compared "cs_meg_source_terms.cxx" for 8.0.4 and 8.2.0 versions and have not found differences in temperature declaration. This line is the same, although functions are some different. For conveniency, here are cs_meg_source_terms functions for different versions.
Saturne 8.0.4:
Code: Select all
cs_real_t *
cs_meg_source_terms(const char *zone_name,
const cs_lnum_t n_elts,
const cs_lnum_t *elt_ids,
const cs_real_t xyz[][3],
const char *name,
const char *source_type)
{
cs_real_t *new_vals = NULL;
/* User defined source term for temperature over zone DUCT
-------------------------------------------------------- */
if (strcmp(zone_name, "DUCT") == 0 &&
strcmp(name, "temperature") == 0 &&
strcmp(source_type, "thermal_source_term") == 0) {
const cs_lnum_t vals_size = n_elts * 2;
BFT_MALLOC(new_vals, vals_size, cs_real_t);
const cs_real_t *temperature_vals = cs_field_by_name("temperature")->val;
for (cs_lnum_t e_id = 0; e_id < n_elts; e_id++) {
cs_lnum_t c_id = elt_ids[e_id];
const temperature = temperature_vals[c_id];
new_vals[2 * e_id + 0] = - 0 * 1.07E3 * (temperature - 118);
new_vals[2 * e_id + 1] = 0;
}
}
return new_vals;
}
Code: Select all
void
cs_meg_source_terms(const char *zone_name,
const cs_lnum_t n_elts,
const cs_lnum_t *elt_ids,
const cs_real_t xyz[][3],
const char *name,
const char *source_type,
cs_real_t *retvals)
{
/* User defined source term for temperature over zone DUCT
-------------------------------------------------------- */
if (strcmp(zone_name, "DUCT") == 0 &&
strcmp(name, "temperature") == 0 &&
strcmp(source_type, "thermal_source_term") == 0) {
const cs_real_t *temperature_vals = cs_field_by_name("temperature")->val;
for (cs_lnum_t e_id = 0; e_id < n_elts; e_id++) {
cs_lnum_t c_id = elt_ids[e_id];
const temperature = temperature_vals[c_id];
retvals[2 * e_id + 0] = - 0 * 1.07E3 * (temperature - 118);
retvals[2 * e_id + 1] = 0;
}
}
}
Third error is connected with enthalpy pointer. I have relaxation/limiting "cs_user_parameters.c" file, among others, there are lines:
Code: Select all
field=CS_F_(h); /* Field structure */
if (field!=NULL) /* Field present */
{
eqnPar=cs_field_get_equation_param(field); /* Field options structure */
eqnPar->relaxv=entRlxCoef; /* Relaxation factor */
};
Thanks for your attention.