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

conjugateHeatFoam with arbitrary number of region

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 20, 2011, 05:25
Default conjugateHeatFoam with arbitrary number of region
  #1
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 12
maddalena is on a distinguished road
Hello all,
is there anyone which has a conjugateHeatFoam version modified in such a way that an arbitrary number of solid and fluid regions are allowed? I need something like chtMultiRegionFoam which includes features of conjugateHeatFoam...

Thank you!


mad
maddalena is offline   Reply With Quote

Old   June 20, 2011, 08:53
Default
  #2
New Member
 
babak kamkari
Join Date: Dec 2010
Posts: 26
Rep Power: 6
kamkari is on a distinguished road
Hi mad
I am currently working with conjugateHeatFoam but with two regions, solid and fluid. You could have two solid parts simply by selecting velocity equal to zero. I have to add that if you want to calculate the gradient of a variable on the interface (coupled boundry) you will face with problem. For more information about this defect have look to the following link:
conjugateHeatFoam error in new commits of 1.6-ext

Best Regards
kamkari is offline   Reply With Quote

Old   June 20, 2011, 09:06
Default
  #3
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 12
maddalena is on a distinguished road
Quote:
Originally Posted by kamkari View Post
conjugateHeatFoam but with two regions, solid and fluid. You could have two solid parts simply by selecting velocity equal to zero.
well... that seems to be not enough for me: I need n solids and 2 fluids at least ! It does not seem to difficult to modify the solver though. Before try by myself, I would like to know if someone else has a piece of code which can be shared...

mad
maddalena is offline   Reply With Quote

Old   June 20, 2011, 21:46
Default
  #4
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
The hardest part when adding more than 2 regions is just editing attachPatches.H. Here's an example for 3 regions:


Code:
{
    const polyPatchList& patches = mesh1.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
    mesh1.surfaceInterpolation::movePoints(); 
    
    const polyPatchList& patches1 = mesh2.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
    mesh2.surfaceInterpolation::movePoints();
    
    const polyPatchList& patches2 = mesh3.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
    mesh3.surfaceInterpolation::movePoints();
}
And then you do something similar for detatchPatches.H
After this, all you have to do is make sure you have the right directory structure.
benk is offline   Reply With Quote

Old   August 29, 2011, 11:11
Question some more questions
  #5
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 12
maddalena is on a distinguished road
Hello,
I am still planning how to make conjugateHeatFoam adjustable for an arbitrary number of regions. unfortunately I cannot work on the subject in a continuous way ...
According to what Henrik said on 2009 here:
Quote:
Originally Posted by henrik View Post
you can solve on three regions, but you need to duplicate the flow physics which is not natural unless the physics is actually different, e.g. turbulent on one side and visco-elastic on the other. [...] Then [...] coupledFvScalarMatrix TEqns(2)
Questions:
  1. Is the information given above a little bit outdated or the modification suggested by Benk (Hi!) is not the only one I need to implement?
  2. If Henrik's information is correct, then I need to duplicate the physics of the problem for n times, where n are the number of regions with different properties I have. Let us say I implement the solver to handle 20 regions. What if my case has only 5 regions?
  3. May be possible to implement a "for loop" for regions working in the same way the "for loop" works for patches on attachPatches and detachPatches? Does this make any sense?
Any opinion / suggestion you can give me may be useful... thank you

mad
maddalena is offline   Reply With Quote

Old   December 1, 2011, 14:46
Default
  #6
New Member
 
Helmut Roth
Join Date: Mar 2009
Posts: 23
Rep Power: 8
helmut is on a distinguished road
Hi Mad,

Have your questions been answered?
I borrowed some ideas from chtMultiRegionFoam and created pointerLists to my regions.
In my master case constant directory I have a regionProperties file listing my fluid and solid region names. See for example $FOAM_TUTORIALS//heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties

My createSolidMeshes.H looks like this:
forAll(rp.solidRegionNames(), i)
{
Info<< "Create solid mesh for region " << rp.solidRegionNames()[i]
<< " for time = " << runTime.timeName() << nl << endl;
solidRegions.set
(
i,
new fvMesh
(
IOobject
(
rp.solidRegionNames()[i],
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
}
Similarly for the fluid meshes.

In attachPatches.H I have for the solid side:
// solid regions
forAll(solidRegions, i)
{
//Info<< "attaching patches for solid region i =" << i << endl;
const polyPatchList& patches = solidRegions[i].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();
solidRegions[i].surfaceInterpolation::movePoints();
}
Similarly for the fluid side
helmut is offline   Reply With Quote

Reply

Tags
conjugateheatfoam, multiple regions

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
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
BlockMeshmergePatchPairs hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36
Smooth Grid Error! Help seasoul FLUENT 1 March 24, 2008 11:56
Stanton Number and Arbitrary Surface Temperature Boris Vaisman Main CFD Forum 1 March 9, 2006 05:43
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 01:22.