CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

How to define a field on a patch

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

LinkBack Thread Tools Display Modes
Old   July 5, 2012, 12:42
Default How to define a field on a patch
Aleksey Rukhlenko
Join Date: Nov 2009
Location: Moscow
Posts: 55
Rep Power: 10
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, 11:23
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 281
Blog Entries: 5
Rep Power: 13
tomislav_maric is on a distinguished road
Hi Aleksey,

try this to get an access to a boundary field:

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_maric is offline   Reply With Quote


field, interpolation, patch

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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
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 12:24
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12

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