CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Map fields from patch to cell centers

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

Like Tree1Likes
  • 1 Post By martinK.

LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2018, 09:25
Default Map fields from patch to cell centers
New Member
Martin Kerz
Join Date: Dec 2017
Posts: 3
Rep Power: 8
martinK. is on a distinguished road
Dear Foamers,

I'm facing a problem right now while working with the Finite-Area-method in foam-extend.

First of all quickly my case:
I have a simple finite-volume polyMesh. The bottom-patch is working as faMesh for the finite-area calculations as well.
I modified the polyMesh such that on the outside boundaries (inlet, outlet, right, left) all cells get "connected" in vertical dimension and one ends up with a pillar-like mesh at these boundaries.

The function mapToVolume() of a volSurfaceMapping-object gives me the possibility to map the fields from the finite-area faMesh to the according patch (bottom) of the finite-volume polyMesh.
What I want to do now is map the fields further to the above lying cell centers. For me it is sufficient to do this only on the boundary faces of the bottom-patch (so to say from the frame of the bottom-patch to the pillar-cell centers).
I hope you can get my point

What I have right now and what's not really working is the following:
forAll( aMesh.boundary(), ipatch )  //loop over boundary-patches of the faMesh
    const UList<label> &bfaceCells = mesh.boundaryMesh()[ipatch].faceCells();
    //corresponding cell-IDs of the polyMesh (pillars)

    forAll( bfaceCells, iface )   //loop over cells of the current patch
        label curCell = bfaceCells[iface];
        forAll( aMesh.faceLabels(), jface ) //loop over faces of the faMesh
            if( iface == jface )
                HFv[curCell] = H[jface]; //HFv: volumeScalarfield 
                                        // H: corresponding areaScalarField

This gets called in every timestep from my solver. It is compiling but the results are wrong.
Does anybody have a hint or an idea on how to do this right and/or more efficient?

As I'm new to OpenFoam and not very used to the syntax and possibilities yet I would really appreciate any remark, even if you just want to say that all these loops are completly rubbish

Thank you all!

Best regards,
Bob-zhao likes this.
martinK. is offline   Reply With Quote


cell center, fam, fvm, map fields, 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
[mesh manipulation] How to write cellSet for different regions in constant/polyMesh/sets Struggle_Achieve OpenFOAM Meshing & Mesh Conversion 3 June 17, 2019 09:29
[] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38
[mesh manipulation] Using createPatch in place of couplePatches sripplinger OpenFOAM Meshing & Mesh Conversion 8 November 13, 2009 07:14
Warning 097- AB Siemens 6 November 15, 2004 04:41

All times are GMT -4. The time now is 05:50.