Page 2 of 2

Re: Total dynamic head measurement

Posted: Fri May 25, 2018 9:56 am
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

Re: Total dynamic head measurement

Posted: Fri May 25, 2018 11:46 am
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