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

Coupling velocity between two mesh regions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2013, 01:52
Default Coupling velocity between two mesh regions
  #1
Senior Member
 
Join Date: Jul 2011
Posts: 120
Rep Power: 14
haze_1986 is on a distinguished road
Hi all, I am getting stuck with 2 way couple between two different solvers on different meshes and one of the face from each mesh I am require to match their velocities at the boundaries at the start of every timestep. I am not adept in programming so would appreciate if anyone could point me in the right direction to read up and carry on from here.

Thanks in advanced.
haze_1986 is offline   Reply With Quote

Old   July 21, 2013, 23:38
Default
  #2
Senior Member
 
Join Date: Jul 2011
Posts: 120
Rep Power: 14
haze_1986 is on a distinguished road
I have confirmed that
Code:
vectorField nFPatchVelocity =
        interpolatorFN.faceInterpolate
        (
            U.boundaryField()[fFPatchID]
        );
produces something that varies with time and at one timestep, I have this
20
(
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0.0885345 -6.79536e-08 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
(0 0 0)
)

I am required to put these dynamic values as boundary condtions to the second part of the solver. I am not sure what I should include for my 0/U file
inlet
{
type ?
value ?
}

Would groovyBC fix this or I need some other methods? Please advise, thanks.
haze_1986 is offline   Reply With Quote

Old   July 22, 2013, 06:48
Default
  #3
Member
 
Artem Shaklein
Join Date: Feb 2010
Location: Russia, Izhevsk
Posts: 43
Rep Power: 16
ARTem is on a distinguished road
Hi, haze_1986.
Yes, groovyBC will do the trick.
I don't know all of opportunities of groovy, I just tell you the way I would do it.

So, we need 3 fields:
U_source (mesh1), U_dependent(mesh2), U_helper(mesh2).
U_source will be as you like it to be.

U_dependent will use groovyBC type at boundary:
Code:
        type                   groovyBC;
        valueExpression        "U_helper";
U_helper goes with calculated type with some value:
Code:
        type          calculated;
        value	uniform (0 0 0);
Next, go to code. After computing U_source we should put it boundary values to U_helper.
Actually, I don't know will or will not numeration of patch faces be the same, so I will use robust method.

Code:
label transBC1 = 0; // number of transition boundary in mesh1
label transBC2 = 1; // number of transition boundary in mesh2; number is taken for example
forAll(mesh1.boundary()[transBC1]; facei1)
{
  forAll(mesh1.boundary()[transBC2]; facei2)
  {
    // If we are talking about same point in space
    if( mag(mesh1.C().boundaryField()[transBC1][facei1] - 
               mesh2.C().boundaryField()[transBC2][facei2]) < SMALL)
     {
          U_helper.boundaryField()[transBC2][facei2] = U_source.boundaryField()[transBC1][facei1];
     }
  }
}
Of course, you can minimize cycles by creating labelList containing once computed indexes. If you want I will show you how to do that.
ARTem is offline   Reply With Quote

Reply


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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 07:34
How do I use initial velocity by dynamic mesh method? m_kanani Main CFD Forum 0 June 28, 2011 03:42
When the velocity is small, the dynamic mesh doesn't move li2150 FLUENT 0 January 3, 2011 10:27
Mesh motion independent mesh regions philippose OpenFOAM Running, Solving & CFD 12 August 5, 2008 16:16
Changing Mesh Velocity Anil CFX 0 October 29, 2007 09:47


All times are GMT -4. The time now is 12:42.