ibeta

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
s marco
Posts: 11
Joined: Fri Feb 14, 2020 3:59 pm

ibeta

Post by s marco »

Hi everyone,

I am using AFM for temperature in code saturne v6 and in divrit.f90 I have ibeta (thermal expansion coefficient) which is called in this way:

Code: Select all

if (ibeta.gt.0) then
call field_get_val_s(iprpfl(ipproc(ibeta)), cpro_beta)
endif
and later in the same subroutine it is used in AFM formulation:

Code: Select all

! AFM and EB-AFM models
! "-C_theta*k/eps*( xi* uT'.Grad u + eta*beta*g_i*T'^2)"
if (ityturt(iscal).eq.2.and.ibeta.gt.0) then
if (itt.gt.0) then
temp(ii) = temp(ii) - ctheta(iscal)*xtt* &
etaafm*cpro_beta(iel)*grav(ii)*cvara_tt(iel)
How can I change this value of ibeta for my fluid?
Moreover how can I check which value is the default one?


Best regards,
Marco Santucci
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: ibeta

Post by Luciano Garelli »

Hello,

ibeta it is a (integer) pointer for thermal expansion coefficient. To access to the thermal expansion coeff you can use this example used inphyvar.f90, I think.

Code: Select all

double precision, dimension(:), pointer :: cpro_beta
....
....
if (ibeta.ge.0) then
      iok1 = 0
      call field_get_val_s(ibeta, cpro_beta)
      do iel = 1, ncel
        if (cpro_beta(iel).lt.0.d0) iok1 = 1
      enddo
      if (iok1.eq.1) write(nfecra,9013)
    endif
Regards,
Luciano
C.FLAG.
Posts: 32
Joined: Fri Apr 08, 2016 2:19 pm

Re: ibeta

Post by C.FLAG. »

Hello,

It looks like the parameter ibeta is automatically defined in base/varpos.f90 when idilat=0 or irovar=1.

When idilat=0, the user should provide the thermal expansion coefficient in a user subroutine, such as usphyv (cs_user_physical_properties.f90). Check cs_user_parameters-base.c if you want to set idilat=0.

When irovar=1, the field containing the thermal expansion coefficient is defined automatically. However, the way the code estimate the thermal expansion coefficient from the variable density is absolutely not clear to me. I suspect the thermal expansion coefficient should also be defined by the user inside a user subroutine such as usphyv.

Regards,
Cédric
Post Reply