Problem with HTLES Hybrid Model

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
finzeo
Posts: 74
Joined: Fri Sep 09, 2022 4:23 pm

Problem with HTLES Hybrid Model

Post by finzeo »

Good morning,

I have been trying to test the HTLES hybrid model using version v8.0.1. In the user routines cs_user_parameters.c and cs_user_initialization.c, I use the following instructions:

Code: Select all

...
cs_turb_model_t *turb_model = cs_get_glob_turb_model();
turb_model->iturb = CS_TURB_K_OMEGA;
turb_model->type = CS_TURB_HYBRID;
turb_model->hybrid_turb = CS_HYBRID_HTLES;
...
However, I am encountering the following errors:

Code: Select all

SIGABRT signal (abort) intercepted.
Call stack:
   1: 0x7f6de099eacf <gsignal+0x10f>                  (libc.so.6)
   2: 0x7f6de0971ea5 <abort+0x127>                    (libc.so.6)
   3: 0x7f6de09dfcd7 <+0x8fcd7>                       (libc.so.6)
   4: 0x7f6de09e6fdc <+0x96fdc>                       (libc.so.6)
   5: 0x7f6de09e73fc <+0x973fc>                       (libc.so.6)
   6: 0x7f6de2c4def0 <bft_mem_free+0x260>             (libsaturne-8.0.so)
   7: 0x7f6de2a4705a <cs_htles_initialization+0xeca>  (libsaturne-8.0.so)
   8: 0x7f6de23f6024 <caltri_+0x1455>                 (libsaturne-8.0.so)
   9: 0x7f6de38b9360 <main+0x760>                     (libcs_solver-8.0.so)
  10: 0x7f6de098ad85 <__libc_start_main+0xe5>         (libc.so.6)
  11: 0x40624e     <_start+0x2e>                    (cs_solver)
End of stack
At the end of the listing, I see this error:

Code: Select all

** VARIABLES INITIALIZATION
    ------------------------

 -----------------------------------------
 Property           Min. value  Max. value
 -----------------------------------------
  density           0.1206E+01  0.1206E+01
  molecular_viscos  0.1758E-04  0.1758E-04
  turbulent_viscos  0.2193E-07    Infinity
 -----------------------------------------

HTLES: Error counter: 24 
HTLES: Error counter: 24 
HTLES: Error counter: 24 
HTLES: Error counter: 24 
HTLES: Error counter: 24 
HTLES: Error counter: 24 
HTLES: Error counter: 24 
...
Tracing the source code, I found this in cs_turbulence_htles.c:

Code: Select all

...
/* Verification
 * TODO correct it in parallel
 * */
for (cs_lnum_t c_id = 0; c_id < n_cells; c_id++) {
  if (cpt_edg_per_cells[c_id] != 36) {
    bft_printf("HTLES: Error counter: %d \n", cpt_edg_per_cells[c_id]);
  }
}
...
My question is:
Is the HTLES code designed to work only with purely hexahedral meshes?
Yvan Fournier
Posts: 4206
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem with HTLES Hybrid Model

Post by Yvan Fournier »

Hello,

I just talked with the colleague who implemented the model, and the short answer is "yes". Apparently, tha model needs both an estimation of the cell span (which can be approximated using a cubic root of the volume), and a stricter test of the longest span, for near wall cells with higher aspect ratio.

So this quantity could probably be estimated in a better manner, not restricted to hexahedra, but you would need to change the test. I would not expect the model to work well on a purely tetrahedral mesh, but changing or removing this test might be interesting with a hex-dominant (or perhaps polyhedral ?) mesh with only a few non hexahedral cells.

Best regards,

Yvan
finzeo
Posts: 74
Joined: Fri Sep 09, 2022 4:23 pm

Re: Problem with HTLES Hybrid Model

Post by finzeo »

Hi Yvan,

Thank you for your response.

If I understand correctly, the restriction exists solely to enable the straightforward calculation of the dlt_max array in cs_turbulence_htles.c?. If your answer is yes, I was thinking of implementing a loop over the cells, accessing the neighboring cell centers for each cell, and thus computing any minimum or maximum distance between cell centers.

In fact, I have already done something similar in the DDES model to compute the xdelta variable by modifying the source files. I presented this to Jean-François, as it yielded better results in agreement with some published papers.

Do you think this would be sufficient to remove the restriction and make it work for any mesh without generating errors?
Yvan Fournier
Posts: 4206
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem with HTLES Hybrid Model

Post by Yvan Fournier »

Hello,

I'll try to remember to check with Jean-François to confirm, but yes, I think you cluld try the same sort of approach here.

Best regards,

Yvan
Post Reply