# conjugateHeatFoam with arbitrary number of region

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 20, 2011, 05:25 conjugateHeatFoam with arbitrary number of region #1 Senior Member     maddalena Join Date: Mar 2009 Posts: 436 Rep Power: 15 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

 June 20, 2011, 08:53 #2 New Member   babak kamkari Join Date: Dec 2010 Posts: 26 Rep Power: 8 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: http://www.cfd-online.com/Forums/ope...6-ext.htmlBest Best Regards

June 20, 2011, 09:06
#3
Senior Member

Join Date: Mar 2009
Posts: 436
Rep Power: 15
Quote:
 Originally Posted by kamkari 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...

 June 20, 2011, 21:46 #4 Senior Member   Ben K Join Date: Feb 2010 Location: Ottawa, Canada Posts: 140 Rep Power: 12 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(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh1.surfaceInterpolation::movePoints(); const polyPatchList& patches1 = mesh2.boundaryMesh(); forAll (patches1, patchI) { if (isType(patches1[patchI])) { const regionCouplePolyPatch& rcp = refCast(patches1[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights mesh2.surfaceInterpolation::movePoints(); const polyPatchList& patches2 = mesh3.boundaryMesh(); forAll (patches2, patchI) { if (isType(patches2[patchI])) { const regionCouplePolyPatch& rcp = refCast(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.

August 29, 2011, 11:11
some more questions
#5
Senior Member

Join Date: Mar 2009
Posts: 436
Rep Power: 15
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 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

 December 1, 2011, 14:46 #6 New Member   Helmut Roth Join Date: Mar 2009 Posts: 23 Rep Power: 10 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(patches[patchI])) { const regionCouplePolyPatch& rcp = refCast(patches[patchI]); // Attach it here rcp.attach(); } } // Force recalculation of weights //mesh.surfaceInterpolation::movePoints(); solidRegions[i].surfaceInterpolation::movePoints(); } Similarly for the fluid side

 Tags conjugateheatfoam, multiple regions

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01 hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36 seasoul FLUENT 1 March 24, 2008 11:56 Boris Vaisman Main CFD Forum 1 March 9, 2006 05:43 adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19

All times are GMT -4. The time now is 12:23.

 Contact Us - CFD Online - Privacy Statement - Top