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

Why does meshToMesh want "cuttingPatches" from the source mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2019, 04:09
Default Why does meshToMesh want "cuttingPatches" from the source mesh
  #1
Member
 
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 9
frobaux is on a distinguished road
I everyone,

I already read pretty much all tread about meshToMesh (If I missed some, let me know =) ) but there is something I don't understand. I want to map a field which is defined on mesh externalPhiRegions[0] on a mesh completely included, fluidRegions[i].
I use the meshToMesh toolbox.
Code:
meshToMesh mapper(
                externalPhiRegions[0], 
                fluidRegions[i], 
                meshToMesh::imCellVolumeWeight,
                patchMap,        // patchMap,
                cuttingPatches,  // cuttingPatches
                true 
            );
If I got it right, cuttingPatches are all the patches which needs to be interpolated and are completely inside the external region. So they should be defined in fluidRegions[i], right?
The problem is I got a Fatal error as the cuttingPatch is not inside the externalPhiRegions[0] mesh (which name is of_GlobMesh).

Code:
--> FOAM FATAL ERROR: 
Unable to find patch 'inlet' in mesh 'of_GlobMesh'.  Available patches include:
6
(
front
back
LeftWall
BottomWall
RightWall
athmosphere
 )
 From function void Foam::meshToMesh::constructFromCuttingPatches(const Foam::word&, const Foam::word&, const Foam::HashTable<Foam::word>&, const wordList&, bool)
    in file meshToMesh/meshToMesh.C at line 789.
Why does the code need the cutting patches to be in the source mesh??

Last edited by frobaux; June 4, 2019 at 06:21.
frobaux is offline   Reply With Quote

Old   June 5, 2019, 10:49
Default
  #2
Member
 
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 9
frobaux is on a distinguished road
I tried to do it manually, using the mapFieldsPar utility

(which uses the meshToMesh library, where mapFields uses the meshToMesh0)
I obtain the same output (this time of_boxMesh3 is the source mesh)
Code:
mapFieldsPar -sourceRegion of_boxMesh3 -targetRegion Hsl35 -fields '(Phi_interp)'  ./
output:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Source: "." ""
Source region: of_boxMesh3
Target: "/home/robaux/These/HPC/IBMfs/CylinderVenugopal/TestConversionOF/nx60CFL200" "mergedboxMesh3"
Target region: Hsl35

Create databases as time
I/O    : uncollated
Case   : /home/robaux/These/HPC/IBMfs/CylinderVenugopal/TestConversionOF/nx60CFL200/mergedboxMesh3
nProcs : 1
Overriding DebugSwitches according to controlDict
    meshToMesh      1;

Overriding DebugSwitches according to controlDict
    meshToMesh      1;


Source time: 6.7
Target time: 6.7

Create meshes

Source mesh size: 1800    Target mesh size: 1341


Creating and mapping fields for time 6.7



--> FOAM FATAL ERROR: 
Unable to find patch 'inlet' in mesh 'of_boxMesh3'.  Available patches include:
7
(
front
back
extInterpLeft
extInterpBottom
extInterpRight
extInterpTop
wallbox
)


    From function void Foam::meshToMesh::constructFromCuttingPatches(const Foam::word&, const Foam::word&, const Foam::HashTable<Foam::word>&, const wordList&, bool)
    in file meshToMesh/meshToMesh.C at line 789.

FOAM exiting
I don't understand why the cuttingPatches should be in the sourceMesh. Is there a bug here?
frobaux is offline   Reply With Quote

Old   June 6, 2019, 05:24
Default
  #3
Member
 
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 9
frobaux is on a distinguished road
Well, I think I may have find the answer: A problem in the code of my OF version 1712, as well as in 1812:
lines are in src/sampling/meshToMesh/meshToMesh.C

Code:
 cuttingPatches_.setSize(cuttingPatches.size());

     forAll(cuttingPatches_, i)

     {

         const word& patchName = cuttingPatches[i];

         label cuttingPatchi = srcBm.findPatchID(patchName);



         if (cuttingPatchi == -1)

         {

             FatalErrorInFunction

                 << "Unable to find patch '" << patchName

                 << "' in mesh '" << srcRegion_.name() << "'. "

                 << " Available patches include:" << srcBm.names()

                 << exit(FatalError);

         }



         cuttingPatches_[i] = cuttingPatchi;

     }

I tried to replace the "src" by "tgt" and it seems to work like a charm.
In OpenFoam v6, corresponding line takes the mesh target, as well as in foam-extend 3.2.


Should I do something about it? Post that somewhere or inform someone?

Thanks a lot







frobaux is offline   Reply With Quote

Reply

Tags
cuttingpatches, interpolation, meshtomesh


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
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 13:14.