CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   conjugateHeatFoam (http://www.cfd-online.com/Forums/openfoam/75978-conjugateheatfoam.html)

antonessiu May 11, 2010 05:04

conjugateHeatFoam
 
hi,

I use openfoam for my thesis. i wish to use conjugateHeatFoam but in the forum no information are present.
Can anyone post or direct me on a "how to" use this code? I have been looking arround, hoping to find my way out from the tutorials.

Thank you.

benk May 13, 2010 14:43

Have you seen this post:
http://www.cfd-online.com/Forums/ope...-openfoam.html

There's lots of information there.

antonessiu May 15, 2010 04:17

Thanks for the replay Benk
the information in the forum are incomplete! The construction of a case is very difficult for me...

benk May 15, 2010 12:24

Ok, the first thing you have to do is make sure that you can run the test case "conjugateHeatFoam" and that it works properly (ie. you don't get any error messages when you compile and run it).

The basics of this solver:
1) This solver is for multiple regions where, for example, you have multiple regions in contact with one another and you have a species (like heat) transferred through each of those regions. Each region is associated with a mesh. You'll have 1 main mesh and other regions are the submeshes (in the test case the main mesh is in the conjugateCavity directory and the submesh is the solid directory which is a link to the heatedBlock directory). You have to make sure you understand the directory structure of meshes and submeshes first.

2) Another important point about the mesh is that in the constant/polyMesh/boundary file, you'll have to manually add the regionCouple information (every time you run the blockMesh command), like:

Code:

right
{
    type regionCouple;
    nFaces 10;
    startFace 200;

    shadowRegion    solid;
    shadowPatch    left;
    attached        on;
}

where shadowRegion is the region in contact with the current region and shadowPatch is the name of the patch in contact with the current patch. Forgetting to edit this file after running a blockmesh command is a common mistake (at least for me) and will result in an error at runtime (not at compile).

3) To implement the equations, you use the special coupledFvScalarMatrix object which is written so that each equation is in an array. For the syntax, see solveEnergy.H file in the test case.

4) When creating coupled fields (for example in the createFields.H file), you have to include "attachPatches.H" before creating any fields that are to be coupled and include "detachPatches.H" before creating any fields that are not coupled. The [de|at]tachPatches.H essentially turns on or off the regionCoupling information in your boundaries file since regular solvers don't know what to do with this special boundary.

5) In the time = 0 directory, you must also indicate the coupling on boundaries for each coupled field. For example, if you look at the T (and DT) file for the conjugateHeatFoam case, you'll see:

Code:

    right
    {
        type            regionCoupling;
        value          uniform 273;

        remoteField    T;
    }

for every boundary that is to be treated as an "internal boundary" or a coupled boundary.

6) In your system/fvSolution, you need to indicate which fields are coupled, using:
Code:

    T+T BiCG
    {
        preconditioner
        {
            type                Cholesky;
        }

        minIter      0;
        maxIter      1000;
        tolerance    1e-6;
        relTol      0.0;
    };

if you had 3 regions instead of 2, then instead of T+T you'd have T+T+T (and of course if your field isn't called T then you change T to whatever your field is called).

7) I've found that it's also a good idea to use harmonic averaging in the system/fvSchemes file but not necessary to run a case.

For another example case, see http://www.cfd-online.com/Forums/ope...tml#post251473 and all posts within.

benk May 15, 2010 12:26

PS. If anybody has run this solver in parallel, I'd like instructions on how to do that!

maddalena June 20, 2011 04:39

Quote:

Originally Posted by benk (Post 258928)
This solver is for multiple regions where, for example, you have multiple regions in contact with one another and you have a species (like heat) transferred through each of those regions. Each region is associated with a mesh. You'll have 1 main mesh and other regions are the submeshes (in the test case the main mesh is in the conjugateCavity directory and the submesh is the solid directory which is a link to the heatedBlock directory). You have to make sure you understand the directory structure of meshes and submeshes first.

Hi benk,
some questions for you:
  1. if I understood it right, conjugateHeatFoam has a different file structure than chtMultiRegionFoam, i.e.there is not a constant/regionProperties file defining which regions are solids and which are fluids. Thus I simply need to add the solid1 solid2 solid3 folders (or link) inside the main directory folder. Is it correct?
  2. Is the main directory the fluid or can I take it as the solid?
  3. And what about if I have multiple solid and multiple fluid? Am I allowed to use them? Where to declare which are what?
Thank you for your time,

mad

benk June 20, 2011 21:39

Quote:

Originally Posted by maddalena (Post 312688)
if I understood it right, conjugateHeatFoam has a different file structure than chtMultiRegionFoam, i.e.there is not a constant/regionProperties file defining which regions are solids and which are fluids. Thus I simply need to add the solid1 solid2 solid3 folders (or link) inside the main directory folder. Is it correct?

Yes. When you say "main directory folder", this is the directory of the main mesh which in the conjugateHeatFoam lingo, is referred to as "region0". All other regions become submeshes of the main mesh.

Quote:

Originally Posted by maddalena (Post 312688)
Is the main directory the fluid or can I take it as the solid?

It can be whatever you want. Just make sure your equations fit your problem.

Quote:

Originally Posted by maddalena (Post 312688)
And what about if I have multiple solid and multiple fluid? Am I allowed to use them? Where to declare which are what?

You can have any number of regions. For each region, just add the submesh under the main mesh directory (ie. constant/regionName). I'm pretty sure you'll also have to edit the attachPatches.H file for more than 2 regions. Also, remember to edit your boundaries file correctly for each mesh.

The solver will just apply the following conditions at the interface between 2 regions (ie. internal boundaries):
1. phi(region 1) = phi(region 2)
2. flux(region 1) = -flux(region 2)


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