question about density variable

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
hi.will
Posts: 5
Joined: Tue Apr 14, 2020 3:58 am

question about density variable

Post by hi.will »

hello,
Under windows10, code_saturne V5.0;
I'm try to learning a hearted squar cavity case following tutorial HeatedSquareCavity.pdf. I have set Density variable and put the cs_user_physical_properties.f90 under SRC.But the density in density box which next 'Density variable' in GUI will be density=-1, and it cause compile error like
'solver script exited with status 1.

Error running the calculation.

Check Code_Saturne log (listing) and error* files for details.

Error in calculation stage. '
If I set density= +constant(such as 1.0) in density box,the compute process is ok ,but all the density in listing file equal to +constant.
As if the cs_user_physical_properties.f90 doesn't work?Where am I wrong please?
Yvan Fournier
Posts: 4222
Joined: Mon Feb 20, 2012 3:25 pm

Re: question about density variable

Post by Yvan Fournier »

Hello,

Without the information as in the forum recommendations, i is very difficult to guess what is going wrong.

Regards,

Yvan
hi.will
Posts: 5
Joined: Tue Apr 14, 2020 3:58 am

Re: question about density variable

Post by hi.will »

thanks Yvan,here are files when density=-1, compile.log,preprocessor.log, and setup.log.The listing file can't be transfered by forum.
Attachments
compile.log
(1.38 KiB) Downloaded 176 times
setup.log
(23.13 KiB) Downloaded 185 times
preprocessor.log
(4.91 KiB) Downloaded 171 times
hi.will
Posts: 5
Joined: Tue Apr 14, 2020 3:58 am

Re: question about density variable

Post by hi.will »

hi Yvan.Here also listing file.I changed the file name.
thanks.
Attachments
listing.log
(17.06 KiB) Downloaded 186 times
Yvan Fournier
Posts: 4222
Joined: Mon Feb 20, 2012 3:25 pm

Re: question about density variable

Post by Yvan Fournier »

Hello,

I see the error message, but am unable to guess at what you have in your xml file and user subroutines.

Best regards,

Yvan
hi.will
Posts: 5
Joined: Tue Apr 14, 2020 3:58 am

Re: question about density variable

Post by hi.will »

Hello,
here are files of setup.xml and cs_user_physical_properties.f90
thanks.
Attachments
cs_user_physical_properties.f90
(17.9 KiB) Downloaded 177 times
setup.xml
(8.21 KiB) Downloaded 195 times
Yvan Fournier
Posts: 4222
Joined: Mon Feb 20, 2012 3:25 pm

Re: question about density variable

Post by Yvan Fournier »

Hello,

Could you try (in either order):

a) setting the density to another value in the GUI (for example 1); if the GUI does not let you do this (i.e. if the editot pop-up does not appear, you could change it directly in the xml file at least for testing (search for "Density")

b) in your user subroutine, start with a simple, constant value to check if the issue is due to formula values becoming negative for some temperature values.

Best regards,

Yvan
hi.will
Posts: 5
Joined: Tue Apr 14, 2020 3:58 am

Re: question about density variable

Post by hi.will »

Hello,
the cs_user_physical_properties.f90 was copied from code-saturne V3.3.4, i have just made some changes to compile OK(didn't change any formulas in subroutine).

i have tried,
a)setting the density=1.0 in the GUI popup window. Then the result of all the densties in listing file items 'Computed fields on cells' equal to 1 .please see listinga.log file.

b)keeping the density=1.1 in the cs_user_physical_properties.f90,but the GUI popup window unchanged(density=1.0).Then all the densties in listing file items 'Computed fields on cells' equal to 1 .please see listingb.log file.

thanks
Attachments
listingb.log
(2.16 MiB) Downloaded 187 times
listinga.log
(2.16 MiB) Downloaded 191 times
Yvan Fournier
Posts: 4222
Joined: Mon Feb 20, 2012 3:25 pm

Re: question about density variable

Post by Yvan Fournier »

Hello,

I do not know if this explains your error, but you should never just copy a user subroutine from another x.y.z version when x or y are different from the current version.

In your case, usphyv does not even have the same number of arguments.

So you should first align your user subroutine with the reference for the version you are using.

If this still fails, if the popup in the GUI works correctly, you can use a formula there instead of the user subroutine.

Regards,

Yvan
Post Reply