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

Using sample to Inlet velocity field

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

Like Tree2Likes
  • 1 Post By amanbearpig
  • 1 Post By amanbearpig

Reply
 
LinkBack Thread Tools Display Modes
Old   December 8, 2014, 12:38
Default Using sample to Inlet velocity field
  #1
Member
 
Join Date: Apr 2011
Posts: 36
Rep Power: 6
amanbearpig is on a distinguished road
Hello, I'm trying to use the sample utility to get a velocity field to use as the inlet field for a subsequent simulation.

I run sample, and get my U file from a constant plane (setting the point and normal direction), which appears to have twice the amount of values I was expecting. I looked at the file, and there are duplicates of all the values (I'm not entirely sure why this is, perhaps how I am sampling the plane?). So, I go through and delete every other line in the U vector field to eliminate the duplicates - getting a vector field which matches what I need for the inlet.

However when I take this field and set it as a nonuniform List<vector> at the inlet (as an initial condition) the result is nothing like what it should be! I'm attaching a picture of the sampled field, and then the result when I try and place this sampled field as the inlet initial condition.

Where am I going wrong in this process? My guess is something to do with the sampling/removing duplicate values, but I'm not sure what precisely I'm doing incorrectly. Thank you for your help!
Attached Images
File Type: jpg SampledU_Velocity_Field.jpg (13.3 KB, 11 views)
File Type: jpg Inlet_VelocityField_Messedup.jpg (13.2 KB, 8 views)
amanbearpig is offline   Reply With Quote

Old   March 26, 2015, 14:32
Default
  #2
Member
 
Join Date: Apr 2011
Posts: 36
Rep Power: 6
amanbearpig is on a distinguished road
Hello,

I am still having an issue mapping a custom plane to the Inlet of a domain. I have circled back to this problem as work has brought it back into focus, and am still having problems.

My process: I run the 'sample' utility, mapping a defined plane - say the Outlet of a domain. I check the postProcessing folder and find the surface/surface_sampled/vectorField folder which contains the sampled U values. There is one value for each cell on the outlet.

If I take these values and paste them as a custom Inlet nonuniform List<vector> (in a new 0/U file), my inlet profile is all messed up. I'm attaching a picture below of a mapped annular flow inlet where I followed the above steps.

How can I sample a plane, either the Outlet or a custom plane, and set those values as a nonuniform List<vector> for a velocity inlet? Thank you!!
Attached Images
File Type: jpg Inlet_not_mapped_right.jpg (15.6 KB, 7 views)
rajibroy likes this.
amanbearpig is offline   Reply With Quote

Old   April 2, 2015, 19:07
Default
  #3
New Member
 
Rajib Roy
Join Date: Jun 2014
Location: Laramie, Wyoming
Posts: 7
Rep Power: 3
rajibroy is on a distinguished road
Hi,
I am also trying to resolve exactly the same issue; What I've found is that the sampling triangulates the sample plane if it is quadratic X-section; so it appears to be twice as much as faces.

Were you able to solve the problem? Your advise is highly appreciated.

Best,
Rajib
rajibroy is offline   Reply With Quote

Old   April 3, 2015, 09:47
Default
  #4
Member
 
Join Date: Apr 2011
Posts: 36
Rep Power: 6
amanbearpig is on a distinguished road
Hi Rajib,

Unfortunately I have not yet resolved the issue myself. I am no longer getting the doubling faces issue, I now get 1 U vector for each cell, but my attempts to map these to the Inlet is still not working correctly (see the most post above, obviously the velocity vectors are not mapping right!).

It is confusing to me, they have the exact same number of faces, the mesh was created by a 2D face extruded lengthwise, so they should match 1-to-1, but maybe the face ordering is all messed up? Are you getting the same odd looking Inlet profile like me?

This seems like it should be a very simple problem, and I have no explanation as to why I cannot seem to figure it out.
rajibroy likes this.
amanbearpig is offline   Reply With Quote

Old   April 3, 2015, 11:33
Default
  #5
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 106
Rep Power: 8
vatavuk is on a distinguished road
Hi,
You could try using the mapFields application like described in this thread: How to Map Fields in openFOAM using the utility (see post #6)
Best Regards,
Paulo
vatavuk is offline   Reply With Quote

Old   April 6, 2015, 10:14
Default
  #6
Member
 
Join Date: Apr 2011
Posts: 36
Rep Power: 6
amanbearpig is on a distinguished road
Hi Paulo,

I have tried using mapFields, but it seems to only map the volume, not the boundaries? After running mapFields, my U file has a long nonuniform List for the domain with the velocity for all the interior cells, but at the Inlet/Outlet it still has my original velocity condition (at the Inlet I had initially uniform (1 0 0), and I want to take the Outlet velocity profile and impose it in the U file within the time directory, as the Inlet velocity).

Am I not using mapFields correctly? How can I go about getting a correct nonuniform List<vector> for the Inlet - mapped from the Outlet or some other defined plane within the domain?

Thank you very much for your help!
amanbearpig is offline   Reply With Quote

Old   April 6, 2015, 11:46
Default
  #7
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 106
Rep Power: 8
vatavuk is on a distinguished road
Hi Amanbearpig,
Additional instructions are provided in the user guide:
http://www.openfoam.org/docs/user/mapFields.php
Best Regards,
Paulo
vatavuk is offline   Reply With Quote

Old   April 6, 2015, 18:31
Default
  #8
New Member
 
Rajib Roy
Join Date: Jun 2014
Location: Laramie, Wyoming
Posts: 7
Rep Power: 3
rajibroy is on a distinguished road
Hi All,
I've tried the mapFields Utility and it does not correctly map the neither the internal field nor the patches (I've looked at the post as you advised).

Now I have came up with an idea which is as follows:
1. Using toposet and subset utilities to trim the source mesh to match the target mesh. Now the cutting plane is a patch which needs to map.

2. Declare the new patch as mapped BC and, write out the fields after 1 iteration. The internal fields will be mapped to fields as a non-uniform list.

*** On going work ***
The mapped BC is dependent on a prescribed initial value which affects the mapping results. Working on to create a new BC that maps from internal field to a patch.

Could you suggest any idea regarding this matter.
Thanks for the advise and support.

Best,
Rajib
rajibroy is offline   Reply With Quote

Old   April 7, 2015, 10:44
Default
  #9
Member
 
Join Date: Apr 2011
Posts: 36
Rep Power: 6
amanbearpig is on a distinguished road
Hi Paulo,

I've been trying to use mapFields for some time (I had tried it before you had mentioned it, and I went back and re-tried it to make sure I did not miss something ) and perhaps I am not implementing it correctly but I am still not getting what I want from it.

What I am trying to get is, for a geometry that does not change, map the Outlet or some arbitrary plane to the Inlet for a new simulation. I don't want a cyclic case, I want a mapped Inlet with a defined nonuniform List as the Inlet boundary condition, using the mapped values from the Outlet of the previous case.

When I run mapFields, using the mappedFieldsDict which specifies:
Code:
patchMap
( Outlet Inlet);
for the source and target patches, respectively, I still am not getting a changed Inlet boundary condition in the U file. The interior is mapped, but the Inlet boundary condition still contains the initial boundary condition (in this case it was fixedValue uniform (1 0 0);.

I will look at what you have posted Rajib and see if it can help me, I just wanted to reply to Paulo. I am not discounting the fact I could be doing something wrong, I just have not met with success yet using mapFields.

Thank you!
amanbearpig is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 22:18
Inlet velocity mismatch in low microchannel alligngr8 FLUENT 0 December 10, 2011 02:43
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
velocity of massless particles and velocity of flow field in same coordinate payam_IUST FLUENT 0 October 18, 2009 23:24
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 02:13


All times are GMT -4. The time now is 11:16.