CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

How to add 3rd region to chtMultiRegionFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 29, 2010, 12:19
Default How to add 3rd region to chtMultiRegionFoam
  #1
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
Has anybody tried to extend chtMultiRegionFoam to 3 regions? For example, in the current chtMultiRegionFoam example, there are 2 regions: a fluidRegion and a solidRegion. I'm trying to make a third region (let's just call it fluidRegion2).

I don't know how to modify the coupleManager files though. Specifically this part in chtMultiRegionFoam/coupleManager/coupleManager.C:


Code:
bool Foam::coupleManager::regionOwner() const
{
    const fvMesh& nbrRegion = neighbourRegion();

    const regionProperties& props =
        localRegion_.objectRegistry::parent().lookupObject<regionProperties>
        (
            "regionProperties"
        );

    label myIndex = findIndex(props.fluidRegionNames(), localRegion_.name());
    if (myIndex == -1)
    {
        label i = findIndex(props.solidRegionNames(), localRegion_.name());

        if (i == -1)
        {
            FatalErrorIn("coupleManager::regionOwner() const")
                << "Cannot find region " << localRegion_.name()
                << " neither in fluids " << props.fluidRegionNames()
                << " nor in solids " << props.solidRegionNames()
                << exit(FatalError);
        }
        myIndex = props.fluidRegionNames().size() + i;
    }
    label nbrIndex = findIndex(props.fluidRegionNames(), nbrRegion.name());
    if (nbrIndex == -1)
    {
        label i = findIndex(props.solidRegionNames(), nbrRegion.name());

        if (i == -1)
        {
            FatalErrorIn("coupleManager::regionOwner() const")
                << "Cannot find region " << nbrRegion.name()
                << " neither in fluids " << props.fluidRegionNames()
                << " nor in solids " << props.solidRegionNames()
                << exit(FatalError);
        }
        nbrIndex = props.fluidRegionNames().size() + i;
    }

    return myIndex < nbrIndex;
}
At the moment my C++/OpenFOAM knowledge isn't good enough to figure out what's going on here, but I'm sure that this has to be modified if a third region is to be implemented. Has anybody done this or help me out?
benk is offline   Reply With Quote

Old   April 3, 2010, 17:22
Default
  #2
New Member
 
Eugen
Join Date: May 2009
Location: Russia, Obninsk
Posts: 10
Rep Power: 8
jonya is on a distinguished road
For create a new region you don't need to modify coupleManager. Just create in your case new folder with 3rd region mesh like in tutorial. In regionPriperties you should put type of your region.
jonya is offline   Reply With Quote

Reply

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
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
Importing regions from 3rd party meshing programms suitup OpenFOAM Mesh Utilities 1 November 10, 2009 10:40
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19


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