### Cannot use TVD schemes

Posted:

**Sat May 11, 2024 10:10 pm**Hello everyone.

I'm trying to use TVD (Total Variation Diminishing) schemes as advective schemes by setting them in cs_user_parameters.c. However, I always encounter this error message as soon as the run starts.

Is there any way to avoid this error when attempting to use these schemes?

This is a part of the cs_user_parameters.c code:

Thank you in advance.

I'm trying to use TVD (Total Variation Diminishing) schemes as advective schemes by setting them in cs_user_parameters.c. However, I always encounter this error message as soon as the run starts.

Upon investigating the source code within /src/alge/cs_convection_diffusion.c, I don't see a way to use ischcv=4 (TVD scheme) without it throwing an error (this seems to be incompatible with any value of isstpc; I have already tried all values in the range [0;2] for isstpc). I'm using version 8.0.../../../code_saturne/src/alge/cs_convection_diffusion.c:4786: Fatal error.

invalid value of ischcv

Call stack:

1: 0x7fd1a053e8ed <cs_convection_diffusion_vector+0x1d1d> (libsaturne-8.0.so)

2: 0x7fd1a04f565a <cs_balance_vector+0x2aa> (libsaturne-8.0.so)

3: 0x7fd1a0190401 <cs_equation_iterative_solve_vector+0x501> (libsaturne-8.0.so)

4: 0x7fd1a02c7fb2 <predvv_+0x7ee8> (libsaturne-8.0.so)

5: 0x7fd1a02b2208 <navstv_+0x1235> (libsaturne-8.0.so)

6: 0x7fd1a02d1f1f <tridim_+0x30d8> (libsaturne-8.0.so)

7: 0x7fd1a010b391 <caltri_+0x17c2> (libsaturne-8.0.so)

8: 0x7fd1a15ce360 <main+0x760> (libcs_solver-8.0.so)

9: 0x7fd19e69fd85 <__libc_start_main+0xe5> (libc.so.6)

10: 0x4039be <_start+0x2e> (cs_solver)

End of stack

Is there any way to avoid this error when attempting to use these schemes?

This is a part of the cs_user_parameters.c code:

Code: Select all

```
...
cs_field_t *vel_conv = cs_field_by_name("velocity");
cs_equation_param_t *eqp_vel = cs_field_get_equation_param(vel_conv);
eqp_vel->ischcv = 4;
eqp_vel->isstpc = 1;
int key_lim_id = cs_field_key_id("limiter_choice");
cs_field_set_key_int(vel_conv, key_lim_id, CS_NVD_SMART);
...
```