Total dynamic head measurement

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
valentin.derrien
Posts: 12
Joined: Fri Feb 23, 2018 2:28 pm

Re: Total dynamic head measurement

Post by valentin.derrien »

Hello,

Thanks for your reply Yvan, it was really helpful.
I achieved to print what I wanted for each iteration with :

Code: Select all

fprintf(chargecsv, 
		%e %s %e\n",
		charge_bas,";",charge_haut);


I would like to know how to print also the associated time step using the double variable t_cur.

I tried to code :

Code: Select all

        fprintf(chargecsv, 
		"%e %s %e %s %e\n",
		t_cur,";",charge_bas,";",charge_haut);


But an error is appearing.
Do you have any suggestion ?

Please find attached the SRC file.

Best,
Valentin
Attachments
cs_user_extra_operations_csv.c
(5.68 KiB) Downloaded 224 times
Yvan Fournier
Posts: 4209
Joined: Mon Feb 20, 2012 3:25 pm

Re: Total dynamic head measurement

Post by Yvan Fournier »

Hello,

You need to use cs_glob_time_step->t_cur instead of "t_cur", which you do not seem to have defined.

If you use the value in many places, you may do this first:

Code: Select all

cs_real_t t_cur = cs_glob_time_step->t_cur;
But this is not ueful for a simple print.

You can also simplify your print statement, putting the ";" in the format directly:

Code: Select all

fprintf(chargecsv, 
	"%e %e\n",
	charge_bas, ,charge_haut);
Regards,

Yvan
Post Reply