how to setup periodic temperature for an LES of a cuboid

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

Re: how to setup periodic temperature for an LES of a cuboid

Post by mkendrick »

Using valgrind was alot easier than anticipated!

The ivar values are as follows:

Code: Select all

 ivar for ustsnv
           2
 ivar for ustssc
           5
valgrind output file attached
Attachments
valgrind_output.tar.gz
(150 KiB) Downloaded 228 times
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: how to setup periodic temperature for an LES of a cuboid

Post by Yvan Fournier »

Hello,

To use Valgrind with Code_Saturne, you need to tell the code to use valgring using the xml file (in the GUI, go to advanced parameters for the code execution options), or the user Python script.

In your run, Valgrind ran on the Python iterpreter used by the main script, not on the cs_solver executable itself...

Regards,

Yvan
mkendrick

Re: how to setup periodic temperature for an LES of a cuboid

Post by mkendrick »

Ah, yes this ouput looks more like it.

Attached.
Attachments
valgring_output.tar.gz
(30 KiB) Downloaded 222 times
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: how to setup periodic temperature for an LES of a cuboid

Post by Yvan Fournier »

Hello,

You have a memory overwrite in cs_user_boundary_conditions.f90. Checking your code, iscal is not initialized, so that is probably the cause of the error.

This may cause errors downstream, so you should fix this first, and check your run again (using Valgrind will help check everything is fixed, and if not, tell you where to look).

Regards,

Yvan
mkendrick

Re: how to setup periodic temperature for an LES of a cuboid

Post by mkendrick »

I think I've traced the problem to

Code: Select all

kimasf
This value is used in the function below

Code: Select all

field_get_key_int(ivarfl(iu),kimasf,iflmas)
If I write the output of kimasf I get

Code: Select all

kimasf = 0
which I'm assuming is incorrect.

How do I initialize the 'kimasf'? or for my version (3.0.5) is there an easier way to find the mass flux?

Cheers,
Martyn

P.S. the two write errors were solved by replacing

Code: Select all

ivar=isca(iscal)
with

Code: Select all

ivar=isca(1)
in cs_user_boundary_conditions.f90

and the other which was in subroutine ustsnv was solved by copying the arguments and initializations from cs_user_source_terms.f90 found in the REFERENCE folder.
Post Reply