Closed kikuznetsov closed 6 years ago
The initialization of turbulence does not work in case of Rij-SSG model. I tried to initialize it by three ways and none of them is working: 1) Initialization by formula:
trii = (0.02*0.1)^2; cmu = 0.09; r11 = trii; r22 = trii; r33 = trii; r12 = 0.; r13 = 0.; r23 = 0.; k = 0.5*(r11+r22+r33); epsilon = k^1.5*cmu/0.13;
2) Initialization by reference value. 3) Initialization by cs_user_initialization.c:
void cs_user_initialization(void) { const int location_id = CS_MESH_LOCATION_CELLS; const cs_lnum_t n_elts = cs_mesh_location_get_n_elts(location_id)[0]; cs_real_3_t *vel = (cs_real_3_t *)(CS_F_(u)->val); // cs_real_33_t *rij = (cs_real_33_t *)(CS_F_(rij)->val); const cs_real_3_t *restrict cell_cen = (const cs_real_3_t *restrict)cs_glob_mesh_quantities->cell_cen; const cs_real_3_t* xyz = (cs_real_3_t *)cs_glob_mesh->vtx_coord; cs_real_t * r11_val = (cs_real_t *)CS_F_(r11)->val; cs_real_t * r22_val = (cs_real_t *)CS_F_(r22)->val; cs_real_t * r33_val = (cs_real_t *)CS_F_(r33)->val; cs_real_t * r12_val = (cs_real_t *)CS_F_(r12)->val; cs_real_t * r23_val = (cs_real_t *)CS_F_(r23)->val; cs_real_t * r13_val = (cs_real_t *)CS_F_(r13)->val; cs_real_t *eps = (cs_real_t *)CS_F_(eps)->val; // cs_real_t *k = (cs_real_t *)CS_F_(k)->val; for (cs_lnum_t i = 0; i < n_elts; i++) { vel[i][0]=10.0; vel[i][1]=10.0; vel[i][2]=10.0; // k[i] = 0.2; eps[i] = 0.5; // rij[i][0][0] = 0.1; // rij[i][0][1] = 0.0; // rij[i][0][2] = 0.0; // rij[i][1][0] = 0.0; // rij[i][1][1] = 0.1; // rij[i][1][2] = 0.0; // rij[i][2][0] = 0.0; // rij[i][2][1] = 0.0; // rij[i][2][2] = 0.1; r11_val[i]= 0.1; r22_val[i]= 0.1; r33_val[i]= 0.1; r12_val[i]= 0.; r13_val[i]= 0.; r23_val[i]= 0.; } }
In cases it gives error message:
cs_field.c:1075: Fatal error. Fortran pointer of rank 1 requested for values of field "rij", which have rank 2. Call stack: 1: 0x7f7924051c88 <cs_f_field_var_ptr_by_id+0x88> (libsaturne.so.5) 2: 0x7f7924611872 <__field_MOD_field_get_val_s+0x21> (libsaturne.so.5) 3: 0x401657 <cs_user_f_initialization_+0x12e> (cs_solver) 4: 0x7f79240fcc22 <inivar_+0x3f3> (libsaturne.so.5) 5: 0x7f7923fe35bc <caltri_+0x131d> (libsaturne.so.5) 6: 0x7f792560008f <cs_run+0x54f> (libcs_solver.so.5) 7: 0x7f79255ff9f3 <main+0x113> (libcs_solver.so.5) 8: 0x7f792365c830 <__libc_start_main+0xf0> (libc.so.6) 9: 0x4010c9 <_start+0x29> (cs_solver) End of stack
P.S. Need to note if I use the same approaches but with k-epsilon model, then everything works fine.
Sorry It was my mistake. I used cs_user_initialization.f90 at the same time. Now it works.
The initialization of turbulence does not work in case of Rij-SSG model. I tried to initialize it by three ways and none of them is working: 1) Initialization by formula:
2) Initialization by reference value. 3) Initialization by cs_user_initialization.c:
In cases it gives error message:
P.S. Need to note if I use the same approaches but with k-epsilon model, then everything works fine.