LES: SGS Viscosity at previous timestep

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
philippks
Posts: 9
Joined: Sat Jun 20, 2015 6:08 pm

LES: SGS Viscosity at previous timestep

Post by philippks »

Hi,

I would like to retrieve the SGS viscosity from the previous timestep in LES mode. The variable ivista doesn't seem to be calculated in LES, and field_get_val_prev_s is also not working for ivisct. Do you have any hint how to solve my problem?

Many thanks in advance.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: LES: SGS Viscosity at previous timestep

Post by Yvan Fournier »

Hello,

Could you provide the recommened usage info (i.e. at least the version you're using) ?

Yes, in src/base/varpos.f90 (in the code sources), you'll find:

Code: Select all

if (iviext.gt.0) then
  nproce = nproce + 1
  ivisla = nproce
  call field_set_n_previous(iprpfl(iviscl), 1)
  nproce = nproce + 1
  ivista = nproce
  call field_set_n_previous(iprpfl(ivisct), 1)
endif
Removing the test on iviext should do the trick.

For user code, the cleanest solution would be to add:

Code: Select all

nproce = nproce + 1
ivisla = nproce
call field_set_n_previous(iprpfl(iviscl), 1)
nproce = nproce + 1
ivista = nproce
call field_set_n_previous(iprpfl(ivisct), 1)
In you user subroutines, in a case's SRC/cs_user_parameters.f90 in the usipsu subroutine. If this fails, modifying varpos.f90 should work.

Regards,

Yvan
philippks
Posts: 9
Joined: Sat Jun 20, 2015 6:08 pm

Re: LES: SGS Viscosity at previous timestep

Post by philippks »

Hi Yvan,

Many thanks for your fast reply! My CS version is 4.0.4. Both methods work, however, it seems that in LES mode, ivisla and ivista are not created somewhere else in the source code. (I grepped for ivista and only found it for RANS turbulence models.) Thus, I only used the parts

Code: Select all

call field_set_n_previous(iprpfl(iviscl), 1)
call field_set_n_previous(iprpfl(ivisct), 1) 
Thanks again,
Philipp
Post Reply