Thermal source terms

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
fomeh

Thermal source terms

Post by fomeh »

Hello,

I am pretty new to user subroutines. I want to use thermal volumetric source in specific areas of a domain. I am trying to use ustssc.f90 to do that. The compliation part is done but something is wrong cause the temprature remains always constant for all itterations. Can someone give me some ideas what might be wrong with that.

Thank you
Attachments
ustssc.f90
(10.73 KiB) Downloaded 242 times
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: Thermal source terms

Post by Jacques Fontaine »

Hello,

Wich version of Code_Saturne is used ?
Your program seems good. Are you sure about "X > 0" criteria (print nlelt to check that your volume selection is OK).

Regards,
fomeh

Re: Thermal source terms

Post by fomeh »

Merci Jacques
I'am using V3. Concerning X>0, i changed it several times in different direction just to make sure that the problem does not come from this condition but finally withoyt success, the temprature remains constant as the initial value. Do i have to change some other parameters from the GUI? i really don't have any idea about what to test
fomeh

Re: Thermal source terms

Post by fomeh »

Jacques Fontaine wrote:Hello,
(print nlelt to check that your volume selection is OK).

Regards,
I tried to print nlet, a half of the domain has been selected, there is no selection issue
Yvan Fournier
Posts: 4105
Joined: Mon Feb 20, 2012 3:25 pm

Re: Thermal source terms

Post by Yvan Fournier »

Hello,

Did you get your utssc.f90 file from a version 2.0 setup ? In Version 3.0, the subroutine is in cs_user_source_terms.f90. The name of the file is not important, but the number of arguments to the routine.is.

When going from one version to another, you may need minor adaptations to the code. Copy/past the bulk of the function body, test compilation, and adapt if you want, but never use a user (or non-user) subroutine from different versions x.y.z if x or y are different.

Best regards,

Yvan
fomeh

Re: Thermal source terms

Post by fomeh »

Thanks Yvan,

Yes i got this subroutine from V3 with the original name :cs_user_source_terms.f90, i changed the name my self. I attached my .xml file if you can take a look
Yvan Fournier wrote:Hello,

Did you get your utssc.f90 file from a version 2.0 setup ? In Version 3.0, the subroutine is in cs_user_source_terms.f90. The name of the file is not important, but the number of arguments to the routine.is.

When going from one version to another, you may need minor adaptations to the code. Copy/past the bulk of the function body, test compilation, and adapt if you want, but never use a user (or non-user) subroutine from different versions x.y.z if x or y are different.

Best regards,

Yvan
Attachments
xml.txt
(10.11 KiB) Downloaded 347 times
Yvan Fournier
Posts: 4105
Joined: Mon Feb 20, 2012 3:25 pm

Re: Thermal source terms

Post by Yvan Fournier »

Hello,

The version you use seems to date from before a revision on September 3, 2012 (removing coefa/coefb), which is before the version 3.0 branch was pulled, and before even 3.0-rc1.

Please upgrade to a real 3.0 version.

Regards,

Yvan
fomeh

Re: Thermal source terms

Post by fomeh »

Thank you very much Yvan, it seems to work as far as now but i have to continue with the real case.

I have another question concerning this subroutine. The french version 1 says:
C ATTENTION on suppose qu'on travaille en enthalpie,
465 C si on travaille en temperature, il ne faut pas oublier de
466 C diviser PWATT par Cp
And in english version for the same part:
! It is assumed here that the thermal scalar is an enthalpy.
! If the scalar is a temperature, PWatt does not need to be devided
! by Cp ...
So is there any modification in V3?
Brian Angel

Re: Thermal source terms

Post by Brian Angel »

Hello,

To reply to your question, there is a change between versions 2.2 and 2.3. In all versions from 2.3 onwards, there is no need to divide by Cp when specifying a volumetric power source term.

Regards,

Brian Angel.
Post Reply