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

How to add 3rd region to chtMultiRegionFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2010, 13: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: 15
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, 18:22
Default
  #2
New Member
 
Eugen
Join Date: May 2009
Location: Russia, Obninsk
Posts: 10
Rep Power: 13
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 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
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
[Other] Importing regions from 3rd party meshing programms suitup OpenFOAM Meshing & Mesh Conversion 1 November 10, 2009 10:40
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 00:06.