subroutine problem

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
red_armyy
Posts: 5
Joined: Fri Feb 15, 2019 9:27 pm

subroutine problem

Post by red_armyy »

Hello

i have a problem in the the boundary conditions subroutine cs_user_boundary_conditions.f90, when i set the temperature change by time in the code as :
call getfbr('16',nlelt,lstelt)
if (ttcabs.lt.3.8d0) then
do ilelt = 16, nlelt
ifac = lstelt(ilelt)
rcodcl(ifac,isca(iscalt),16) = 20.d0 + 100.d0*ttcabs
enddo
else
do ilelt = 16 , nlelt
ifac = lstelt(ilelt)
rcodcl(ifac,isca(iscalt),16) = 400.d0
enddo
endif

call getfbr('18',nlelt,lstelt)
if (ttcabs.lt.3.8d0) then
do ilelt = 18, nlelt
ifac = lstelt(ilelt)
rcodcl(ifac,isca(iscalt),18) = 20.d0 + 100.d0*ttcabs
enddo
else
do ilelt = 18 , nlelt
ifac = lstelt(ilelt)
rcodcl(ifac,isca(iscalt),18) = 400.d0
enddo
endif
in two inlets, which are above the cylinder , i notice in paraview that they have same variation (in red )as the other two inlets which are in the side of cylinder) , as shown in the picture attached
cylinder.jpg
does that means the temperature variation by time are not working properly ?

Thank you
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: subroutine problem

Post by Yvan Fournier »

Hello,

Did you check the values prescribed at different time steps ?

Imposing a time-varying value through user subroutines should always work.

Regards,

Yvan
red_armyy
Posts: 5
Joined: Fri Feb 15, 2019 9:27 pm

Re: subroutine problem

Post by red_armyy »

the problem is that the temperature result , is not showing the maximum temperature as prescribed in the subrouting where i impose in these two inlets , when t >= 3.8 sec , Temp = 400, as shown in the picture , time is more than 3.8 sec (5sec)
temperatur_case.jpg
where we have the max Temp is only 75°,

PS : i put in the other 4 inlets in the side of cylinder , a constant temperature of 15°
temperature case _2.jpg
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: subroutine problem

Post by Yvan Fournier »

Hello,

There may be something wrong in your setup. Following the forum usage recommendations will help provide the needed info.

Regards,

Yvan
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: subroutine problem

Post by Luciano Garelli »

Hello,

Did you check the documentation for coding of non-standard boundary conditions in the user guide?

In your setup you start from the position #16 of the face list. Why ?

do ilelt = 16, nlelt

and when you set the temperature at the face you set the #16 also...

rcodcl(ifac,isca(iscalt),16) = 20.d0 + 100.d0*ttcabs


For a dirichlet BC you should use

Code: Select all

If icodcl(ifac,ivar)=1: Dirichlet condition at the face ifac for the variable ivar.
→ rcodcl(ifac,ivar,1) is the value of the variable ivar at the face ifac.
Regards,

Luciano
Post Reply