CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] sampling a time-varying dummy field on a boundary from external files (https://www.cfd-online.com/Forums/openfoam-community-contributions/241573-sampling-time-varying-dummy-field-boundary-external-files.html)

hconel March 6, 2022 16:33

sampling a time-varying dummy field on a boundary from external files
 
Hello,
On a boundary, I need to calculate U and p as a function of a dummy variable (let's call it coef). I'm able to do that thanks to groovyBC, but I have the following questions:

1. I have to introduce coef as a field variable to the patch, so that I can use it in groovyBC type expressions. I guess this can be done using swakFunctionObjects, correct?
2. However, I have the 2D distribution of coef in data files (in x,y,val format) in time series.
3. This distribution should be mapped (sampled) to the boundary by interpolating both in time (as it is in timelines) and space. groovyBC somewhat seems to be capable of doing that, however, I checked the examples and couldn't find a similar case. There were mostly expressional definitions.

Is that possible? Fields can be manipulated using other fields in expressions in groovyBC, which is great. But can I define a dummy field on a patch, and then distribute it on the patch by interpolating over both time and space, which will ultimately allow me to use it in groovyBC expressions?

I have also checked funkySetBoundaryFields but no luck.

Any advice you could give would be much appreciated.
Best regards.

hconel March 7, 2022 03:36

The OpenFOAM native timeVaryingMappedFixedValue type seems to be the best solution for creating such a field. But as far as I can tell, this type can only map values from an offset surface within the domain; not from an external source. Moreover, there is no temporal interpolation. timeVarying, in that sense, means that the values are updated at each time step. So, it would not work.
I'll keep looking.


All times are GMT -4. The time now is 19:07.