CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Imposing PIV (2D) experimental data at turbulentDFSEMInlet for LES

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2020, 03:43
Default Imposing PIV (2D) experimental data at turbulentDFSEMInlet for LES
  #1
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 197
Rep Power: 12
t.teschner is on a distinguished road
I have 2D planar PIV data available from experiments (velocity field, Reynolds stresses and length scale information) and want to impose those at the inlet of the domain for the turbulentDFSEMInlet boundary condition.

Naturally, the PIV data - recorded at coordinates y and z (for the sake of argument here) - does not coincide with the coordinates y and z of the mesh at the inlet. Is there some functionality that can take the experimental data and y and z coordinates, interpolate the values onto the mesh and then write the required boundaryData file as an output within the constant/boundaryData/U/0/ directory?
t.teschner is offline   Reply With Quote

Old   December 17, 2020, 04:20
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 346
Blog Entries: 1
Rep Power: 10
dlahaye is on a distinguished road
mapFields utility
see https://www.openfoam.com/documentati...mapFields.html including tutorials and
Section A.2 of https://openfoam.com/documentation/u...-utilities.php for broader scope
dlahaye is offline   Reply With Quote

Old   December 17, 2020, 06:30
Default
  #3
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 197
Rep Power: 12
t.teschner is on a distinguished road
yes, I am aware of mapFields and how to use it to map solutions information from one simulation onto another, but I have experimental data in a non Openfoam format available (i.e. x, y and corresponding experimental value). The questing would then, probably, rather be, how do I get my experimental data into a form mapFields can understand?
t.teschner is offline   Reply With Quote

Old   December 17, 2020, 07:32
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 346
Blog Entries: 1
Rep Power: 10
dlahaye is on a distinguished road
Aha.

Your measured data is a scalar field on 2D planar grid, correct?

Does is suffice to write measurement locations as a (quadrilateral?) mesh and the measured data as a scalar field on there mesh?
dlahaye is offline   Reply With Quote

Old   December 17, 2020, 07:48
Default
  #5
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 197
Rep Power: 12
t.teschner is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Your measured data is a scalar field on 2D planar grid, correct?
Yes, essentially 2D PIV data with x and y coordinates plus the measured quantity

Quote:
Originally Posted by dlahaye View Post
Does is suffice to write measurement locations as a (quadrilateral?) mesh and the measured data as a scalar field on there mesh?
Yes, that would work. My question is how I should format the data in a way mapFields, or a similar utility, can understand my essentially 2D structured dataset. In particular, the turbulentDFSEMInlet boundary condition is able to read boundary data (and also do some automatic mapping, it seems), but that data is just a single array of values and as far as I can see there is no grid location information attached to the datasets, so I wonder how I could resolve this mismatch in locations (and dimensions as well).
t.teschner is offline   Reply With Quote

Old   December 17, 2020, 09:53
Default
  #6
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 346
Blog Entries: 1
Rep Power: 10
dlahaye is on a distinguished road
Not sure. Should study tutorials myself.
dlahaye is offline   Reply With Quote

Old   January 21, 2021, 05:33
Default
  #7
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 197
Rep Power: 12
t.teschner is on a distinguished road
turned out to be actually not that difficult, i did some more digging and came up with the following (in case someone finds this in the future):

We need to provide a 1D list / array of data for the velocity U, reynolds stresses R and an integral length scale L. Then, we create 4 files in these locations (assuming we are currently in the root directry of the case, i.e. where we have the 0, constant and system directory):

constant/boundaryData/points
constant/boundaryData/<inlet-patch-name>/0/U
constant/boundaryData/<inlet-patch-name>/0/R
constant/boundaryData/<inlet-patch-name>/0/L

where we need to insert the name of the inlet patch name here for <inlet-patch-name>. For example, if our inlet is called "velocityInlet", then the U file would be located at constant/boundaryData/velocityInlet/0/U.

All files follow the same syntax and only the data entries are different for scalars, vectors and tensors:

Code:
// scalar data
(
scalar_0
scalar_1
scalar_2
...
scalar_N
)
Code:
// vector data
(
(vector.x_0 vector.y_0 vector.z_0)
(vector.x_1 vector.y_1 vector.z_1)
(vector.x_2 vector.y_2 vector.z_2)
...
(vector.x_N vector.y_N vector.z_N)
)
Code:
// tensor data
(
(tensor.xx_0 tensor.xy_0 tensor.xw_0 tensor.vv_0 tensor.vw_0 tensor.zz_0)
(tensor.xx_1 tensor.xy_1 tensor.xw_1 tensor.vv_1 tensor.vw_1 tensor.zz_1)
(tensor.xx_2 tensor.xy_2 tensor.xw_2 tensor.vv_2 tensor.vw_2 tensor.zz_2)
...
(tensor.xx_N tensor.xy_N tensor.xw_N tensor.vv_N tensor.vw_N tensor.zz_N)
)
Note that OpenFOAM expects Reynolds stresses R_uu to be greater than zero, so just impose a small value here if that happens to be 0 in your case, something like 1e-10 should work fine.

As an example, the points file could look like this (assuming data is only available at the inlet along a 1D line in the y direction):
Code:
(
(0 0 0)
(0 0.1 0)
(0 0.2 0)
(0 0.3 0)
(0 0.5 0)
(0 0.98 0)
(0 1 0)
)
Those coordinates do not have to coincide with your mesh. If you have 2D data available from PIV / experiments, as is the case for me, you can just write the data here following the format above. Then, for the boundary conditions in the 0/U file, the following can be used:

Code:
velocityInlet
{
    type            turbulentDFSEMInlet;
    delta           0.0127; // height of your inlet
    mapMethod       nearestCell;
    value           uniform (10 0 0); // place holder, ignored as far as I can see ...
}
With mapMethod nearestCell, OpenFOAM will automatically interpolate / extrapolate our provided data to the cells. It seems to be working nicely as well if you just provide a 1D line, OpenFOAM will still map that profile to the 2D inlet plane and use a constant extrapolation in the direction which is not specified.

By providing the data in the constant/boundaryData folder for the physical quantities, it also seems that the simulation does stall (as described here), though there still seems to be an issue with the velocity magnitude, but I did not have time as of now to investigate that further.

Last edited by t.teschner; January 21, 2021 at 05:33. Reason: code snippet formatting changed
t.teschner is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] How to get the coordinates of velocity data at all cells and at all times vidyadhar ParaView 9 May 20, 2020 21:06
Computed Pressure Drop is lower than experimental data Ash Kot FLUENT 2 May 17, 2017 10:41
UDF for Mapping 3D Experimental Data (Heat Generation) to Mesh jbo214 Fluent UDF and Scheme Programming 1 May 15, 2017 16:47
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 15:06
studying a valve case mina.basta OpenFOAM 33 August 30, 2013 05:46


All times are GMT -4. The time now is 18:09.