Hello,
I was wondering if it is possible to make code_Saturne calculate the time average of a user defined profile or probe.
In the GUI, when I add a time average, I do not understand how to set the x,y,z position where I want the average to be calculated. Maybe I misunderstand the use of time averages...?
I had a look but could find no such example in the SRC subroutines.
Thank you very much.
Best regards,
Daniele
time average of profiles
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4070
- Joined: Mon Feb 20, 2012 3:25 pm
Re: time average of profiles
Hello,
This is not possible directly, but you can output profile or probe values of time-average variables.
This is slightly less efficient, but will lead to the same results.
Regards,
Yvan
This is not possible directly, but you can output profile or probe values of time-average variables.
This is slightly less efficient, but will lead to the same results.
Regards,
Yvan
Re: time average of profiles
Hello Yvan,
Thank you for your help.
What I understand is that "Time averages" in the GUI calculates the average of the selected variables for all cells, is that right?
Then, I can define a profile calling that average?
Have I understood exactly? Is there an example in any user routine?
Thank you very much.
Best regards,
Daniele
Thank you for your help.
What I understand is that "Time averages" in the GUI calculates the average of the selected variables for all cells, is that right?
Then, I can define a profile calling that average?
Have I understood exactly? Is there an example in any user routine?
Thank you very much.
Best regards,
Daniele
-
- Posts: 4070
- Joined: Mon Feb 20, 2012 3:25 pm
Re: time average of profiles
Hello,
Yes, this is correct. I am not sure there is a specific example, but:
- you can do it directly in the GUI (if the time average is also declared in the GUI, it is available for probes and profiles)
- in user subroutines, you simply use the name of the time average as a "regular" field name for profiles and probes.
Best regards,
Yvan
Yes, this is correct. I am not sure there is a specific example, but:
- you can do it directly in the GUI (if the time average is also declared in the GUI, it is available for probes and profiles)
- in user subroutines, you simply use the name of the time average as a "regular" field name for profiles and probes.
Best regards,
Yvan
Re: time average of profiles
Hello,
When postprocessing profiles, I sometimes get the error:
And the simulation crashes.
It looks like a memory problem. Have you ever faced this error?
Thank you very much in advance.
Best regards,
Daniele
When postprocessing profiles, I sometimes get the error:
Code: Select all
System error: File too large
../../../src/fvm/fvm_to_plot.c:203: Fatal error.
Error opening file: "profiles/profile5_120170.dat"
It looks like a memory problem. Have you ever faced this error?
Thank you very much in advance.
Best regards,
Daniele
-
- Posts: 4070
- Joined: Mon Feb 20, 2012 3:25 pm
Re: time average of profiles
Hello,
Yes, unless your files really are huge (which is not the intended use of profiles), this seems typical of a memory error.
If proofreading your user defined functions does not rapidly allow you to find a suspect part, the most efficient debugging technique for this type of issue is using Valgrind on a debug build of code_saturne, or using a Adress-Sanitizer-based debug build (Valgrind usually allows us to find 99% of such bugs, and if that does not work, AdressSanitize (debug build adding CFLAGS=-fsanitize=address and FCFLAGS=-fsanitize=addess using the gcc or clang debugger),
Otherwise, bisection is always the "last resort" debug tool, but is painful.
If you observe this without any user-defined sources, then we may have a bug, or abuild issue, so in this case we need the usual recommended info as per the forum guidelines.
Best regards,
Yvan
Yes, unless your files really are huge (which is not the intended use of profiles), this seems typical of a memory error.
If proofreading your user defined functions does not rapidly allow you to find a suspect part, the most efficient debugging technique for this type of issue is using Valgrind on a debug build of code_saturne, or using a Adress-Sanitizer-based debug build (Valgrind usually allows us to find 99% of such bugs, and if that does not work, AdressSanitize (debug build adding CFLAGS=-fsanitize=address and FCFLAGS=-fsanitize=addess using the gcc or clang debugger),
Otherwise, bisection is always the "last resort" debug tool, but is painful.
If you observe this without any user-defined sources, then we may have a bug, or abuild issue, so in this case we need the usual recommended info as per the forum guidelines.
Best regards,
Yvan
Re: time average of profiles
Sorry if it's wrong to continue with this thread, but I think it would help to ask how the time averaging option works:
if I set it to start averaging a certain variable at a time t=a, the value that is saved at a time t=a+x comes from averaging the values of that variable in the interval [a,a+x] ? or another interval it is used?
if I set it to start averaging a certain variable at a time t=a, the value that is saved at a time t=a+x comes from averaging the values of that variable in the interval [a,a+x] ? or another interval it is used?
-
- Posts: 4070
- Joined: Mon Feb 20, 2012 3:25 pm
Re: time average of profiles
Hello,
Your interpretation is correct.
Averaging is done on the interval [a,a+x].
It uses recurrence formulas, so is kept up to date at each time step.
Regards,
Yvan
Your interpretation is correct.
Averaging is done on the interval [a,a+x].
It uses recurrence formulas, so is kept up to date at each time step.
Regards,
Yvan