Lagrangian simulations - Additional variables

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Pablo
Posts: 49
Joined: Thu Sep 04, 2014 11:31 am

Re: Lagrangian simulations - Additional variables

Post by Pablo »

Hello Yvan:

Thanks to the use of the CS_LAGR_USER attribute, now it works so that the personal lagrangian property is being calculated and post-processed.
I have used CS_LAGR_USER+0 as a pointer for the first property extraction, I will test several properties calculation simultaneously to check if its working as it seems it is being done.

PLEASE do not worry about that "suggestion mistake", your kind patience with the user's doubts is far enough to forgive any slight mistake you may commit. ;)
...and, in my knowledge status, any learning with this program (no matter where it comes from) will be "embraced with open arms". I seriously think it's far more useful to learn from one's mistakes.

Attached is the last simulation update which seems to work, in order to be checked if there is any "hidden" mistake which may be corrected for later simulations.


Once again, thanks for your attention, I wil keep you updated.


----------------------| UPDATE |------------------------

If I would like to generate and calculate several personal variables (let's say 3), considering the last experience, the logical steps to be followed would be:

- Increase nvls in uslag1.f90 so that nvls=3
- Define and operate these additional variables in cs_user_extra_operations.f90 so that at the end results are stores with commands like:
ettp(npt,jvls(1))=usp1
ettp(npt,jvls(2))=usp2
ettp(npt,jvls(3))=usp3

- Add additional cs_post_write_particle_values commands in cs_post_default.c based on CS_LAGR_USER attribute, but....

Is the CS_LAGR_USER attribute the maximun user lagrangian attributes or the minimun user lagrangian attributes?

This question comes from the fact that the user variables store indicating CS_LAGR_USER+0 works, but CS_LAGR_USER+1, CS_LAGR_USER+2 doesn't.... and CS_LAGR_USER-1, CS_LAGR_USER-2 works (with no errors in the simulation) but at the postprocess stage there is not information stored.

So, if I define in cs_post_default.c the user lagrangian variables so that I consider CS_LAGR_USER as the minimum pre-defined limit for the user lagrangian variables:

cs_post_write_particle_values(mesh_id,CS_LAGR_USER+0,"Pers_property_1",0,ts);
cs_post_write_particle_values(mesh_id,CS_LAGR_USER+1,"Pers_property_2",0,ts);
cs_post_write_particle_values(mesh_id,CS_LAGR_USER+2,"Pers_property_3",0,ts);


...simulation fails, but if I consider CS_LAGR_USER as the maximun pre-defined limit for the user lagrangian variables:

cs_post_write_particle_values(mesh_id,CS_LAGR_USER+0,"Pers_property_1",0,ts);
cs_post_write_particle_values(mesh_id,CS_LAGR_USER-1,"Pers_property_2",0,ts);
cs_post_write_particle_values(mesh_id,CS_LAGR_USER-2,"Pers_property_3",0,ts);


...the simulation does not fails, but it also does not stores any other result rather than the firstly defined "Pers_property_1".

Where do you think my mistakes on this simultaneously calculation of several user lagrangian variables are?


Kind regards and, as always, thanks in advance.
Attachments
LAG01.tar.gz
(4.92 MiB) Downloaded 184 times
Post Reply