CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

get edge points for inlet boundary condition

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

Like Tree1Likes
  • 1 Post By niklas

Reply
 
LinkBack Thread Tools Display Modes
Old   May 6, 2013, 03:55
Question get edge points for inlet boundary condition
  #1
New Member
 
pastilha's Avatar
 
Pedro Pastilha
Join Date: Mar 2013
Location: Madrid
Posts: 3
Rep Power: 4
pastilha is on a distinguished road
Hi,

I am trying to implement an inlet boundary condition in which the velocity changes accordingly to the distance to the wall. Ideally I would like to have it change differentely with each of the edges of my inlet condition (assuming a square inlet face).

The approach I had in mind was to collect all the points corresponding to the edge of my boundary condition, and then loop through each internal point of the face, finding its distance to the edges by intersecting a normal vector with the edge point list.

And this is where I have hit a wall, I cannot seem to get the edge point list for my boundary condition, I thought it would be something along the lines of:

Code:
    const vectorField& c = patch().Cf(); // boundary face's cell centers
    const vectorField& e1 = patch().edges(); // Idea 1 for the boundary edge points
    const vectorField& e2 = patch().Sf(); // Idea 2 - saw somewhere that this would give cell centers and edge points...but to no avail.
Perhaps I am not considering the right approach, any help on the matter would be very welcome.

Thanks in advance,

Pedro
pastilha is offline   Reply With Quote

Old   May 6, 2013, 04:15
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
Code:
    const polyBoundaryMesh& patches = mesh.boundaryMesh();
    label id = mesh.boundaryMesh().findPatchID(name);

    const labelList& addr = patches[id].meshPoints();
    const vectorField& bSf = patches[id].faceNormals();
    const edgeList& edges = patches[id].edges();
    const labelListList& ef = patches[id].edgeFaces();
hua1015 likes this.
niklas is offline   Reply With Quote

Old   May 7, 2013, 03:05
Default
  #3
New Member
 
pastilha's Avatar
 
Pedro Pastilha
Join Date: Mar 2013
Location: Madrid
Posts: 3
Rep Power: 4
pastilha is on a distinguished road
Thanks Niklas,

I ended up implementing a slight variation of what you suggested, I found my boundary mesh through my BC's fvPatch patch() as I did not have the mesh explicitly defined in my boundary condition. It does seem to work ok for what I need.

Code:
    label id = patch().boundaryMesh().findPatchID("terrain_patch0");
    const polyPatch& b = patch().boundaryMesh()[id].patch(); 
    const vectorField& bc = b.faceCentres();
Thanks once again for the help.

Cheers,

Pedro
pastilha 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
Radiation interface hinca CFX 15 January 26, 2014 18:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
[DesignModeler] DM's JScript: FPoint()'s GetPoint(i) function picks points backwards? ANT ANSYS Meshing & Geometry 2 July 23, 2012 15:25
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 06:18
Boundary condition ambiguous at edge vertices Matthias Stripf Main CFD Forum 6 January 13, 2001 03:07


All times are GMT -4. The time now is 10:13.