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

Custom boundary by face

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2016, 13:04
Smile Custom boundary by face
  #1
New Member
 
---
Join Date: Jan 2013
Posts: 17
Rep Power: 13
gironidegirona is on a distinguished road
Hi you all,

I'm trying to use openfoam as an interconnect for different processes and I'm interested on defining a boundary by face. I mean, I have the list of faces of a boundary but I would like to specify the value of the outlet flow of this boundary by face (I have mapped one model to the other so I know what it belongs to what).

Is it possible?

Thanks in advance!
gironidegirona is offline   Reply With Quote

Old   December 29, 2016, 09:05
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
If you are talking about boundary faces, you can use codedFixedValue.

Sent from my HTC One mini using CFD Online Forum mobile app
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 15, 2017, 09:18
Default
  #3
New Member
 
---
Join Date: Jan 2013
Posts: 17
Rep Power: 13
gironidegirona is on a distinguished road
Quote:
Originally Posted by Tobi View Post
If you are talking about boundary faces, you can use codedFixedValue.

Sent from my HTC One mini using CFD Online Forum mobile app
Thank you Tobi, I maked that work for flow following this example: http://www.sourceflux.de/blog/the-co...ary-condition/

thanks! The thing is imagine I have a patch which is inlet and I want to have an alpha phase plus non-alpha phase on this face. I would like to create a region which is taking the same inlet speed of the whole patch but to be alpha inlet, and the rest non-alpha inlet. Is like the example provided before but with alpha and non-alpha inlet on the same boundary face, is it possible?

Thanks again!
gironidegirona is offline   Reply With Quote

Old   January 15, 2017, 10:01
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Of course it is possible. There for you just have to get the face values of alpha and code (based on alpha) you inlet profile. Finally you can do whatever you would like to do.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 15, 2017, 13:19
Default
  #5
New Member
 
---
Join Date: Jan 2013
Posts: 17
Rep Power: 13
gironidegirona is on a distinguished road
Hey Tobi, thanks! I found out how to it, I was taking the code literally without thinking very much, what I did is on alpha.water (in my case).

redirectType basically is the name of the class I'm creating in my case "alphainRectangle" and as per proof of concept I'm taking the same strategy to set new values on a rectangle (in my case in a y-region inside the patch) and then modify the boundary according to what i need.

inlet
{
type codedFixedValue;
value uniform 0;
redirectType alphainRectangle;

code
#{


const fvPatch& boundaryPatch = patch();
const vectorField& Cf = boundaryPatch.Cf();

scalarField& field = *this;
scalar min = 0.00065;
scalar max = 0.0008;

forAll(Cf, faceI)
{
if (
(Cf[faceI].x() > min) &&
(Cf[faceI].x() < max)
)
{
field[faceI] = 1;
}
}
#};
}


Thanks again tobi!

I hope it'll help someone!
gironidegirona is offline   Reply With Quote

Reply

Tags
boundary, custom, face, mapping


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
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Radiation interface hinca CFX 15 January 26, 2014 18:11
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36


All times are GMT -4. The time now is 17:27.