Feature Request: time-average of sampled surfaces
Greetings,
As far as I know, it's not possible to perform time-averaging on the sampled surfaces, similar to what the fieldAverage
function does. In certain situations, a workaround is to use fieldAverage
to calculate the time-averaged fields, followed by applying surfaces
sampling to sample those fields (e.g, UMean
, pMean
, etc.).
However, in large 3D cases, it appears inefficient to compute the time-average fields solely to be used later for surface sampling, as it consumes a significant amount of computing resources. It would be more practical to have a direct method for computing the time-average of the sampled surfaces without the need to use fieldAverage as an intermediate step.
Best regards
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Djilou Mioub changed the description
changed the description
- Maintainer
Are you using surface sampling with the
store
option and fieldAverage with the correspondingsubRegion
specified? Not sure if/where a bug has slipped in, but it should be possible. - Author
Yes, I have used that but it didn't work. After testing again, I think I found the issue. It was not working because
interpolate
is set totrue
in the surfaces sampling function object.The fieldAverage now write files of type
polySurfaceVectorField
:FoamFile { version 2.0; format ascii; arch "LSB;label=32;scalar=64"; class polySurfaceVectorField; location "0.1/functionObjectObjects/sampled.xyslice"; object UMean; }
Is it possible to save it in the ensight or vtk format instead?
- Maintainer
- If you have interpolate=true, this generates point fields. Is this really what you want?
Assuming you want surface values (interpolate = false), I'm getting confused now about what is going wrong. This is what I assume you are trying:
- sample surface function object without interpolate, and with store.
- fieldAverage function object to define some mean fields
- surfaceField value to get some statistics and probably write out surfaces (if that is what you like). Or do we wish to resample again onto the same surface (as in step 1), which sounds like a chicken and egg situation.
I guess you mean you want to suppress the auto-write for the fields?? (ie, no restart).
Edited by Mark OLESEN - Author
Thanks for your reply.
I am interested in time-averages only (so I do not need to use
surfaceFieldValue
which AFAIK is for spatial average). What I am trying to do is:1 - Use
surfaces
function object to sample velocity field (withstore yes;
andsampleOnExecute yes;
).2 - Use
fieldAverage
to average the sampled surface over time (viasubRegion sampled.xyslice;
).3 - (This is the important step): I need to write the averaged fields on the sampled surface in ensight format or vtk, but
fieldAverage
writes them under<time>/functionObjects/sampled.xyslice/UMean
. TheUMean
file is written in a formatpolySurfaceVectorField
that I have no idea how to use (i.e. no idea how to open that file to visualize it in Paraview).Update:
attached is an example of
UMean
file written byfieldAverage
FO:Edited by Djilou Mioub - Maintainer
It sounds like what we'd need is a means of re-sampling from stored surfaces.
- sample on surface (store etc)
- fieldAverage to get time averages
- yet another sample on surface, but using the previously stored surface (from step 1) and fields
The only problem being that step 3 [sample on functionObjectSurface - from step 1] is not (yet) supported. Thus the workaround idea was to use surfaceFieldValue to access the functionObjectSurface. Specify the fields and surfaceFormat that you want and use operation "none" - this should get the output writing without doing anything else particularly useful.
- Author
Many thanks! That works, indeed.
- Please register or sign in to reply
- Mark OLESEN assigned to @mark
assigned to @mark
- Maintainer
- solved (or solvable) using surfaceFieldValue to write the regular and time-averaged fields.
- the idea of adding functionality to re-sample on stored surfaces doesn't make much sense since the geometric connection (if any) back to the mesh is missing
- Author
In my case, I am using
meshedSurface
to sample a fixed.obj
surface.- Your solution works as expected. The only missing thing is that
surfaceFieldValue
does not write to collated times. I have tried to add:
formatOptions { ensight { collateTimes true; } }
But it does not seem to have any effect.
- Another tedious workaround I used yesterday is to manually convert the
polySurfaceVectorField
files written under<time>/functionObjects/sampled.xyslice/UMean
to Ensight format.
- Your solution works as expected. The only missing thing is that
- Maintainer
My suspicion is that collateTimes itself probably cannot have any effect since the surfaceFieldValue will essentially behave as stateless.
In surface sampling itself we can keep track of the sampled geometry. Assuming a non-moving geometry, sampling from a plane, meshed surface, patch etc will all result in the same geometric information, which can be cached (or expired) within the surface sampler. The same state information is available to backend writers, which allows the ensight writer to collate times. For the surfaceFieldValue, the surfaces "appear" to be fresh each time, since they are held outside of that function object and the attached surface writer essentially becomes a "single-shot" (stateless).
Not immediate obvious how to change this.
- Mark OLESEN closed
closed
- Kutalmış Berçin added community label
added community label