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

How to define a field on a patch

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2012, 13:42
Default How to define a field on a patch
  #1
Member
 
Aleksey Rukhlenko
Join Date: Nov 2009
Location: Moscow
Posts: 55
Rep Power: 17
Aleksey_R is on a distinguished road
Send a message via ICQ to Aleksey_R
Greetings, dear colleagues!

I have a case with 2 meshes (say, "a" and "b"). And I need to implement a boundary condition (for the field u) like:

grad (u_a) = const*(u_a - u_b)

i.e. boundary gradient for the field u on the "a"-mesh side is proportional to the difference between the values of the u field on the "a"-"b" interface.

Now the question: is it possible to define a field on the patch?

When I do patch to patch interpolation I obtain a scalar field which groovyBC doesn't recognize (because it is not associated with specific patch). So I think I have to define a field on a specific patch. But how to do it? Or is there any other ideas how to implement desired BC?

Thanks in advance.

Best regards, Aleksey.
Aleksey_R is offline   Reply With Quote

Old   July 9, 2012, 12:23
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Hi Aleksey,

try this to get an access to a boundary field:

Code:
fvPatchField<Type>& someFieldBuondaryField = someField.boundaryField()[patchI];
just rename someField to the name that you use. This will give you write access to the patch field. Is this what you need?

Be careful to use scalar, vector or tensor instead of Type, depending on the GeometricField<Type, ...> that you are dealing with. There are also some typedefs for the boundary patch fields like fvPatchScalarField I think....

Tomislav
tomislav_maric is offline   Reply With Quote

Reply

Tags
field, interpolation, patch

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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 15:20.