Question about the third tutorial Heated-square-cavity-flow

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
xingjian
Posts: 55
Joined: Thu Apr 06, 2017 12:34 pm

Question about the third tutorial Heated-square-cavity-flow

Post by xingjian »

Hello everyone,

In fact, I am a new user, and I don't have any ideas about Fortran, so when I followed the tutorial, I can't understand the sample file 'cs_user_physical_properties.f90' at all, so could you please give me a correct sample file 'cs_user_physical_properties.f90' about the second tutorial, and could you please tell me that where I can find the definition of all the properties, like pressure, density...

Can I amend the 'Example 1' with the equation ρ=ρc*(1-β*(T-Tc)) and β=k*μ*Ra/(ρ^2*Cp*g*(Th-Tc)*L^3) like this:

Code: Select all

 call field_get_val_s(iprpfl(ibeta), cpro_beta)
  do iel = 1, ncel
    xvart = cvar_scalt(iel)
    cpro_beta(iel)= (0.0258d0*0.0000183d0*1000000d0)/1.2039d0*1.2039d0*1004.84d0*9.81d0*10d0*1d0)
    cpro_rom(iel) = 1.2039d0 * (1.d0-cpro_beta(iel)*(xvart-293.15d0))
  enddo
And one more question please, I have also complied the equation in Mathematical expression editor:

Code: Select all

 conductivity=0.0259;
 viscosity=1.83e-05;
 Ra=10^6;
 Cp=1004.84;
 g=-9.81;
 Th=303.15;
 Tc=293.15;
 L=1;

beta=conductivity*viscosity*Ra/(rho0^2*Cp*g*(Th-Tc)*L^3);
density = 1.293*(1-beta*(temperature-Tc));
Does it have any difference with user coding?

Thank you for everything

Kind regards

XING Jian
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question about the third tutorial Heated-square-cavity-f

Post by Yvan Fournier »

Hello,

The "solution" XML and user subroutines for the tutorials are in the "examples" directory in the code sources.

Yes, using MEI should in theory be equivalent to coding in a user subroutine (it is more practical if you do not otherwise need user subroutines, though performance is slightly reduced).

Regards,

Yvan
xingjian
Posts: 55
Joined: Thu Apr 06, 2017 12:34 pm

Re: Question about the third tutorial Heated-square-cavity-f

Post by xingjian »

Yvan Fournier wrote:Hello,

The "solution" XML and user subroutines for the tutorials are in the "examples" directory in the code sources.

Yes, using MEI should in theory be equivalent to coding in a user subroutine (it is more practical if you do not otherwise need user subroutines, though performance is slightly reduced).

Regards,

Yvan
Dear Sir,

Thank you very much for your responding, do you mean that I need to follow the "examples" in the user subroutines of the sample file 'cs_user_physical_properties.f90'?
But the equation 'ρ=ρc*(1-β*(T-Tc)) and β=k*μ*Ra/(ρ^2*Cp*g*(Th-Tc)*L^3)' of the tutorial has much more variables than the examples, I don't know whether these new variables are declared in those double precision.

Code: Select all

integer          ivart, iel, ifac
integer          ith, iscal, ii, ifcvsl
double precision vara, varb, varc, varam, varbm, varcm, vardm
double precision                   varal, varbl, varcl, vardl
double precision                   varac, varbc
double precision xvart

double precision, dimension(:), pointer :: coefap, coefbp
double precision, dimension(:), pointer :: bfpro_rom, cpro_rom
double precision, dimension(:), pointer :: cpro_viscl, cpro_vscalt, cpro_cp, cpro_beta
double precision, dimension(:), pointer :: cvar_scalt
Actually, I don't understand the meaning of these coding, what variables do they represent?

Thank you very much

Kind regards

XING Jian
Post Reply