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

conjugateHeatFoam for 4 different regions

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By benk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2012, 22:04
Default conjugateHeatFoam for 4 different regions
  #1
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15
lg88 is on a distinguished road
Hello everybody,
I am going to use conjugateHeatFoam to simulate a conduction problem in a multi region case, thus including solid regions and fluid regions. I am using OF 1.6-ext.
There are 4 different regions, corresponding to different materials: A and C are solids, B and D is fluid (laminar). All the mesh is hexa,
Can solver conjugateHeatFoam realize my need?Do I need to modify the solver code?
thank you very much!

regards!

lg88
Attached Images
File Type: png 11111111.png (2.0 KB, 32 views)
lg88 is offline   Reply With Quote

Old   July 9, 2012, 18:29
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings lg88,

In response to the private message you sent me:
I'm not familiar with conjugateHeatFoam. But I think that chtMultiRegionFoam should be able to solve this issue, but again, I'm not very familiar with either one of these solvers.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 9, 2012, 22:20
Default
  #3
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15
lg88 is on a distinguished road
Thank you for your suggestion.But I am familiar with conjugateHeatFoam and my new solver is based on it.I hope use the solver to solve my problem.I found some information about the same problem I meet at [url]http://www.cfd-online.com/Forums/openfoam/89684-conjugateheatfoam-arbitrary-number-region.html.But there is not detailed construction.
Can anyone give me some idea?

Thank you very much!

lg88

Last edited by lg88; July 9, 2012 at 23:46.
lg88 is offline   Reply With Quote

Old   July 9, 2012, 22:34
Default
  #4
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by lg88 View Post
Hello everybody,
I am going to use conjugateHeatFoam to simulate a conduction problem in a multi region case, thus including solid regions and fluid regions. I am using OF 1.6-ext.
There are 4 different regions, corresponding to different materials: A and C are solids, B and D is fluid (laminar). All the mesh is hexa,
Can solver conjugateHeatFoam realize my need?Do I need to modify the solver code?
thank you very much!

regards!

lg88
conjugateHeatFoam can only deal with two different regions, three or more regions are not allowed. Use chtMultiRegionFoam instead please.

Regards, Junwei
su_junwei is offline   Reply With Quote

Old   July 11, 2012, 01:25
Default
  #5
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15
lg88 is on a distinguished road
hello
Thank you for your suggestion .I have checked in the forum and found that some people had applied conjugateHeatFoam to multi-regions successfully.And my new foam is developed based on the conjugateHeatFoam.

regards!

lg88
lg88 is offline   Reply With Quote

Old   July 13, 2012, 18:43
Default
  #6
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19
benk is on a distinguished road
You need to edit the files attachPatches.H and detachPateches.H. You then have a main region and all other regions are treated as submeshes of the main region.

I've only done this for 3 regions, but 4 or more is definitely possible.

attachPatches.H (for 3 regions):

Code:
{
    const polyPatchList& patches = mesh.boundaryMesh();

    forAll (patches, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    mesh.surfaceInterpolation::movePoints(); 
    
    const polyPatchList& patches1 = separatorMesh.boundaryMesh();

    forAll (patches1, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches1[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches1[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    separatorMesh.surfaceInterpolation::movePoints();
    
    const polyPatchList& patches2 = positiveMesh.boundaryMesh();

    forAll (patches2, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches2[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches2[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    positiveMesh.surfaceInterpolation::movePoints();
}
detachPatches.H (for 3 regions):

Code:
{
    const polyPatchList& patches = mesh.boundaryMesh();

    forAll (patches, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    mesh.surfaceInterpolation::movePoints();

    const polyPatchList& patches1 = separatorMesh.boundaryMesh();

    forAll (patches1, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches1[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches1[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    separatorMesh.surfaceInterpolation::movePoints();
    
    const polyPatchList& patches2 = positiveMesh.boundaryMesh();

    forAll (patches2, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches2[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches2[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    positiveMesh.surfaceInterpolation::movePoints();
}
In the above, my submeshes are called "separatorMesh" and "positiveMesh".

Then in case/constant you have:
polyMesh/... (for the main mesh)
positive/polyMesh/... (for one submesh)
separator/polyMesh/... (for the other submesh)

In case/0 you have:
{fields for main mesh}
positive/{fields for positive mesh}
separator/{fields for separator mesh}
benk is offline   Reply With Quote

Old   July 14, 2012, 11:53
Default
  #7
New Member
 
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 15
bryant_k is on a distinguished road
Thank you for your detailed construction.I am also looking for the multi-region function of conjugateHeatFoam.

Regards!

kob
bryant_k is offline   Reply With Quote

Old   July 14, 2012, 12:01
Default
  #8
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15
lg88 is on a distinguished road
@benk
Thank you very much.I have modified my code as you said. Now it can work fluently and I am waiting for the results.Hoping it will work.

Regards!

lg88
lg88 is offline   Reply With Quote

Old   August 25, 2012, 16:17
Default
  #9
New Member
 
reza
Join Date: May 2012
Posts: 3
Rep Power: 14
ramon is on a distinguished road
can anyone send me a simple tutorial of conjugateHeatFoam for multiregion (2fluid & 1solid) ?
Can anyone give me some idea?
thanks
ramon is offline   Reply With Quote

Old   October 19, 2013, 23:35
Default
  #10
New Member
 
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 14
mscheng is on a distinguished road
Quote:
Originally Posted by lg88 View Post
@benk
Thank you very much.I have modified my code as you said. Now it can work fluently and I am waiting for the results.Hoping it will work.

Regards!

lg88
Hi lg88,

In your case, can the boudaryField fully show in the solution file (such as T) using conjugateHeatFoam?

Thanks!
CHENG
mscheng is offline   Reply With Quote

Old   July 30, 2020, 22:35
Default
  #11
New Member
 
Hailong
Join Date: Sep 2019
Posts: 8
Rep Power: 7
nilvxingren is on a distinguished road
Hi, benk
I modified my code like these
attachPatches.H (for 4 regions):
Code:
{
    const polyPatchList& patches = mesh.boundaryMesh();

    forAll (patches, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    mesh.surfaceInterpolation::movePoints();

    //solidone
    const polyPatchList& patches1 = solidMesh1.boundaryMesh();

    forAll (patches1, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches1[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches1[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    solidMesh1.surfaceInterpolation::movePoints();


    //solidtwo
    const polyPatchList& patches2 = solidMesh2.boundaryMesh();

    forAll (patches2, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches2[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches2[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    solidMesh2.surfaceInterpolation::movePoints();

    //solidthree
    const polyPatchList& patches3 = solidMesh3.boundaryMesh();

    forAll (patches3, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches3[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches3[patchI]);

            // Attach it here
            rcp.attach();
        }
    }

    // Force recalculation of weights
    solidMesh3.surfaceInterpolation::movePoints();
}
detachPatches.H (for 4 regions):

Code:
{
    const polyPatchList& patches = mesh.boundaryMesh();

    forAll (patches, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    mesh.surfaceInterpolation::movePoints();

    //solidone
    const polyPatchList& patches1 = solidMesh1.boundaryMesh();

    forAll (patches1, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches1[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches1[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    solidMesh1.surfaceInterpolation::movePoints();


    //solidtwo
    const polyPatchList& patches2 = solidtMesh2.boundaryMesh();

    forAll (patches2, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches2[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches2[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    solidMesh2.surfaceInterpolation::movePoints();

    //solidthree
    const polyPatchList& patches3 = solidMesh3.boundaryMesh();

    forAll (patches3, patchI)
    {
        if (isType<regionCouplePolyPatch>(patches3[patchI]))
        {
            const regionCouplePolyPatch& rcp =
                refCast<const regionCouplePolyPatch>(patches3[patchI]);

            // Detach it here
            rcp.detach();
        }
    }

    // Force recalculation of weights
    solidMesh3.surfaceInterpolation::movePoints();
}
but, when I wmake, compile error has occurred:

Code:
In file included from createFields.H(80),
                 from conjugateHeatThreesSimpleFoam.C(51):
attachPatches.H(20): error: identifier "solidMesh1" is undefined
      const polyPatchList& patches1 = solidMesh1.boundaryMesh();
                                      ^

In file included from createFields.H(80),
                 from conjugateHeatThreesSimpleFoam.C(51):
attachPatches.H(39): error: identifier "solidMesh2" is undefined
      const polyPatchList& patches2 = solidMesh2.boundaryMesh();
                                      ^

In file included from createFields.H(80),
                 from conjugateHeatThreesSimpleFoam.C(51):
attachPatches.H(57): error: identifier "solidMesh3" is undefined
      const polyPatchList& patches3 = solidMesh3.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(67):
detachPatches.H(20): error: identifier "solidMesh1" is undefined
      const polyPatchList& patches1 = solidMesh1.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(67):
detachPatches.H(39): error: identifier "solidtMesh2" is undefined
      const polyPatchList& patches2 = solidtMesh2.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(67):
detachPatches.H(54): error: identifier "solidMesh2" is undefined
      solidMesh2.surfaceInterpolation::movePoints();
      ^

In file included from conjugateHeatThreesSimpleFoam.C(67):
detachPatches.H(58): error: identifier "solidMesh3" is undefined
      const polyPatchList& patches3 = solidMesh3.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(87):
attachPatches.H(20): error: identifier "solidMesh1" is undefined
      const polyPatchList& patches1 = solidMesh1.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(87):
attachPatches.H(39): error: identifier "solidMesh2" is undefined
      const polyPatchList& patches2 = solidMesh2.boundaryMesh();
                                      ^

In file included from conjugateHeatThreesSimpleFoam.C(87):
attachPatches.H(57): error: identifier "solidMesh3" is undefined
      const polyPatchList& patches3 = solidMesh3.boundaryMesh();
                                      ^

compilation aborted for conjugateHeatThreesSimpleFoam.C (code 2)
Am I missing something?
Thank you very much
nilvxingren is offline   Reply With Quote

Reply

Tags
conjugateheatfoam


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
how the interface between 2 solid regions is treater in chtMultiRegionFoam ? Cyp OpenFOAM 2 March 15, 2023 06:35
[CAD formats] beginners how to convert binarySTL to asciiSTL with regions (good for SHM tutorial) soonic OpenFOAM Meshing & Mesh Conversion 11 July 28, 2017 16:46
isolated fluid regions were found alfin CFX 14 October 8, 2015 02:36
Splitting regions king_steve STAR-CCM+ 1 September 27, 2010 13:48
conjugateHeatFoam: Problems adding 3rd region benk OpenFOAM 5 April 21, 2010 13:46


All times are GMT -4. The time now is 16:42.