Page 1 of 1

cs_user_boundary_conditions.c in case of rough surface and Spalart-Allmaras

Posted: Fri Jun 07, 2019 6:32 pm
by konst
Bonjour,

I am trying to run Spalart-Allmaras model with rough surface and prescribe BC by user-function in this way:

Code: Select all

    f = CS_F_(nusa);//get turbulence energy field
    int ivar_nu = cs_field_get_key_int(f, keyvar) - 1;  //ivar for k


    cs_selector_get_b_face_list("inlet or outlet", &nelts, lstelt);
    for (cs_lnum_t ilelt = 0; ilelt < nelts; ilelt++) {
      cs_lnum_t face_id = lstelt[ilelt];
      bc_type[face_id] = CS_INLET;
      cell_id = b_face_cells[face_id]; // associated boundary cell

      y_curr = cell_cen[cell_id][1]; // define height
      temp = interpolate_sa(profile, y_curr);

      //define Ux
      icodcl[(ivar_nu) * n_b_faces + face_id] = 1; //Dirihlet value
      rcodcl[(ivar_nu) * n_b_faces + face_id] = temp.u; //Value 
      ....
   }
     
And this approach does work perfectly in case of smooth surfaces. But in case rough surface and SA model it does not work, and this function generate some unrealistic values for boundary condition (all values is about 10e+33).

Probably in case of rough surfaces for SA model I need to prescribe BC in some particular way or this is kind of a bug?

Thank you for reply.
Best regards, Konstantin

Re: cs_user_boundary_conditions.c in case of rough surface and Spalart-Allmaras

Posted: Tue Jun 11, 2019 6:12 pm
by konst
I figured it out, maybe it will help to someone. The code is correct, but the problem was coming from the absence of convergence in model. So I found that it is better to use pseudo-coupled velocity-pressure solver and do not mix smooth and rough boundaries while using Spalart-Allmaras model.

Best regards,
Konstantin