Page 1 of 1

Problems on the boundary setting for the heated pipe flow

Posted: Tue Jan 28, 2014 6:58 pm
by MartianDuan
Hello guys,

I am a new user of code_saturne 3.0.1. I tried to set a heated pipe flow case. The velocity and temperature of the inlet flow, as well as, the heat flux on the pipe wall are defined in the 'cs_user_boundary_conditions.f90'. But the simulation failed. The message shown in the 'listing' says that the inlet flow boundary condition was incomplete. But if I did not turn on energy equation and thermal boundary conditions the 'cs_user_boundary_conditions.f90' works fine on the same mesh.

Three documents related to the heated pipe flow simulation is attached. Can you please have a look and give me some suggestion. If you have some relevant examples, please let me know.

P.S. To upload 'listing', the extension '.log' had been added it.

Kindest regards,

Yu.

Re: Problems on the boundary setting for the heated pipe flo

Posted: Wed Jan 29, 2014 8:58 am
by Brian Angel
Hello Yu,

I'll have a look today and get back to you.

Regards,

Brian Angel.

Re: Problems on the boundary setting for the heated pipe flo

Posted: Wed Jan 29, 2014 11:14 am
by Brian Angel
Hello Yu,

I have modified your user routine and tested it on a rectangular duct using the same boundary condition definitions (INLET, OUTLET, WAL) and Code_Saturne V3.0. It works okay. The modified routine is attached. The problem was using the names 'itemp' and 'ivar'. The temperature and wall fluxes are treated as scalars via the variable isca(i). In the SRC/EXAMPLES directory please take a look at the file 'cs_users_boundary_conditions-base.f90' where there are examples for wall boundary conditions. Also, for the inlet boundary, the temperature should be defined as Dirichlet and not Neumann:

icodcl(ifac, isca(1))=1

Please try the attached routine and let me know if it works.

It is also possible to define all the boundary conditions that you are using in the Code_Saturne GUI (please see the attached xml file). It is advised to do this as there are a number of changes between V3.0 and more recent versions that will require the modification of the coding in this routine. Hence, to avoid unnecesary coding in the future, please try to use the GUI as much as possible.

Regards,

Brian Angel.

Re: Problems on the boundary setting for the heated pipe flo

Posted: Tue Feb 04, 2014 4:51 pm
by MartianDuan
Hi Brian,

Thanks for your reply. I will have a try.

I have another question. Where can I find the correspondence between variable in the subroutine and the variable in the theory. for example isca(1) would stand for temperature in 'cs_user_boundary_conditions.f90'.

Thanks again,

Yu.
Brian Angel wrote:Hello Yu,

I have modified your user routine and tested it on a rectangular duct using the same boundary condition definitions (INLET, OUTLET, WAL) and Code_Saturne V3.0. It works okay. The modified routine is attached. The problem was using the names 'itemp' and 'ivar'. The temperature and wall fluxes are treated as scalars via the variable isca(i). In the SRC/EXAMPLES directory please take a look at the file 'cs_users_boundary_conditions-base.f90' where there are examples for wall boundary conditions. Also, for the inlet boundary, the temperature should be defined as Dirichlet and not Neumann:

icodcl(ifac, isca(1))=1

Please try the attached routine and let me know if it works.

It is also possible to define all the boundary conditions that you are using in the Code_Saturne GUI (please see the attached xml file). It is advised to do this as there are a number of changes between V3.0 and more recent versions that will require the modification of the coding in this routine. Hence, to avoid unnecesary coding in the future, please try to use the GUI as much as possible.

Regards,

Brian Angel.

Re: Problems on the boundary setting for the heated pipe flo

Posted: Tue Feb 04, 2014 5:18 pm
by Brian Angel
Hello Yu,

If you have a look in the V3.0 CS user guide in:

§3.9.3.3 : Physical variables (page 34)
§6.4.1 : Basic Modelling Setup > Coding of Standard Boundary Conditions

you will find some info relating to isca.

In the routine I put on this forum, there is a coding error. For the heat flux you will need to change:

icodcl(ifac,isca(3)) = 3
rcodcl(ifac,isca(3),3) = 1000.0d0
to:
icodcl(ifac,isca(iscalt)) = 3
rcodcl(ifac,isca(iscalt),3) = 1000.0d0

Best regards,

Brian Angel.

Re: Problems on the boundary setting for the heated pipe flo

Posted: Wed Feb 05, 2014 3:42 pm
by MartianDuan
Hi Brian,

Thanks very much, The boundary conditions works now.

I found there two improper declarations in the subroutine.

The temperature of inlet flow should be defined as
icodcl(ifac, isca(iscalt)) = 1
rcodcl(ifac, isca(iscalt), 1) = 325.0d0
while, the heat flux on the wall should be defined as
icodcl(ifac, ivar) = 3
rcodcl(ifac, ivar, 3) = 1000.0d0.

But I am not sure this slightly difference is due to my version, which is 3.0.1 or the mistakes.

Thanks again,
Yu.
Brian Angel wrote:Hello Yu,

If you have a look in the V3.0 CS user guide in:

§3.9.3.3 : Physical variables (page 34)
§6.4.1 : Basic Modelling Setup > Coding of Standard Boundary Conditions

you will find some info relating to isca.

In the routine I put on this forum, there is a coding error. For the heat flux you will need to change:

icodcl(ifac,isca(3)) = 3
rcodcl(ifac,isca(3),3) = 1000.0d0
to:
icodcl(ifac,isca(iscalt)) = 3
rcodcl(ifac,isca(iscalt),3) = 1000.0d0

Best regards,

Brian Angel.