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

Access neighbour cells across cyclic boundary

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 17, 2018, 13:24
Default Access neighbour cells across cyclic boundary
  #1
New Member
 
Jakob Hærvig
Join Date: Sep 2012
Location: Aalborg, Denmark
Posts: 27
Rep Power: 14
hrvig is on a distinguished road
Hello,


I'm making a post processing utility where I need to access information across cyclic boundaries. At some point in my code I have something like:



forAll (mesh.cellCells()[x], celli)
{
Info << mesh.cellCells()[x][celli] << endl;
}


This gives me ID's of neighbouring cells to cell x but not across cyclic boundaries. Does anyone know how to access this information?


Best regards,
Jakob
hrvig is offline   Reply With Quote

Old   September 18, 2018, 06:20
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
You can find an example of how to do this in here:


https://github.com/OpenFOAM/OpenFOAM...hScalarField.C


The relevant lines are:
Code:
     // Get the coupling information from the mappedPatchBase
     const mappedPatchBase& mpp =
         refCast<const mappedPatchBase>(patch().patch());
     const polyMesh& nbrMesh = mpp.sampleMesh();
     const label samplePatchi = mpp.samplePolyPatch().index();
     const fvPatch& nbrPatch =
         refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
 ...
      const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
         nbrField = refCast
              <const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
             (                 nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
             );
 ...
     // Swap to obtain full local values of neighbour internal field
     scalarField TcNbr(nbrField.patchInternalField());
     mpp.distribute(TcNbr);
jherb is offline   Reply With Quote

Old   September 18, 2018, 07:20
Default
  #3
New Member
 
Jakob Hærvig
Join Date: Sep 2012
Location: Aalborg, Denmark
Posts: 27
Rep Power: 14
hrvig is on a distinguished road
Thanks for getting back. However, with my limited experience I cannot apply it to my case.

Anyone else who can provide me with a simple working code? To be more specific I'm trying to access a volScalarField across the cyclic boundary
hrvig 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] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
Cyclic Boundary Condition Errors? nyflyer OpenFOAM Running, Solving & CFD 2 April 26, 2016 15:14
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23


All times are GMT -4. The time now is 03:45.