CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   parallel run for conjugateHeatFoam (https://www.cfd-online.com/Forums/openfoam/84327-parallel-run-conjugateheatfoam.html)

elisabet January 26, 2011 09:21

parallel run for conjugateHeatFoam
 
Dear all,

I wish to run a parallel case with conjugateHeatFoam (OF-1.5-dev), but neither 'decomposePar' nor a manually decomposition works.

Does anyone have some experience or suggestions on it?

I would really appreciate some help....

Elisabet

nakul January 26, 2011 12:02

Hi,

Please elaborate exactly what problems are you facing? Have you made the file decomposeparDict? What error message do you get on running decomposePar?

elisabet January 26, 2011 18:07

Ok, I've taken a very simple case of a square channel aligned with x axis and two solid walls (at y+ and y- locations). Fluid domain is defined at the main folder and corresponds to region0, while solid domain is linked and located at '0', 'constant' and 'system' folders under the name 'solid', as defined in the tutorial example.

The case runs perfectly without parallelisation.

In order to run the case in parallel, I first tried with the definition of the decomposeParDict at the main 'system' folder and run 'decomposePar', following the classical procedure in other solvers. However, an error was found. The output is rewritten here:

Code:

Create time

Time = 0
Create mesh for region region0

Calculating distribution of cells
Selecting decompositionMethod simple

Finished decomposition in 0.02 s

Calculating original mesh data

Distributing cells to processors

Distributing faces to processors

Calculating processor boundary addressing

Distributing points to processors

Constructing processor meshes

Processor 0
    Number of cells = 10080
    Number of faces shared with processor 1 = 672
    Number of processor patches = 1
    Number of processor faces = 672
    Number of boundary faces = 2232

Processor 1
    Number of cells = 10080
    Number of faces shared with processor 0 = 672
    Number of processor patches = 1
    Number of processor faces = 672
    Number of boundary faces = 2232

Number of processor faces = 672
Max number of processor patches = 1
Max number of faces between processors = 672

Processor 0: field transfer



    request for polyMesh solid from objectRegistry conjugateHeat_parallel failed
    available objects of type polyMesh are

1
(
region0
)


    From function objectRegistry::lookupObject<Type>(const word&) const
    in file lnInclude/objectRegistryTemplates.C at line 142.

FOAM aborting

Aborted

Hope it helps to understand the problem....

elisabet

elisabet January 26, 2011 18:13

Oh, by the way, I decompose the domain in 2 subdomains along x axis.

nakul January 27, 2011 01:28

Hi

By reading this message

"request for polyMesh solid from objectRegistry conjugateHeat_parallel failed
available objects of type polyMesh are"

it seems to me that decomposePar is unable to split your solid region over two processors. As it can work only with mesh your solid region is coming in way.

I have never tried parallelisation of regions with solid boundary before and this is what I have understood based upon my understanding of decompoPar. Try searching this forum for ways to split meshes with solid regions or try splitting your mesh in such a way that solid region doesn't get split.

elisabet January 27, 2011 04:53

I've tried both things, without success.... that's why I decided to start a new threat.

When I split the domain avoiding to interact with the solid subdomain, 'decomposePar' provides the same error as before.

Any idea?

elisabet

jens_klostermann January 27, 2011 15:54

it is possible but a lot of handish work
 
Hi,

According to this thread http://hi.baidu.com/awacsljt/blog/it...4e6113aaf.html it is possible. And I just tried it myself and it works.

Make also sure to use the harmonic scheme for the laplacian on the fluid side as mentioned in this thread: http://www.cfd-online.com/Forums/ope...penfoam-8.html

Otherwise there also exist explicit coupling through the boundary chtXXXXMultiRegionFoam.

Jens

elisabet January 28, 2011 09:32

Hi Jens,

First of all thank you for the hints.

I finally sorted out how to deal with parallel runs: it was so obvious.... but I didn't thought on it.... one just need to use the -region option with decomposePar !!!!

So, the required steps are (within the structure of the conjugateHeatFoam tutorial case):
  1. First change the boundary file in order to avoid the 'regionCouple' type (just write 'patch' instead of 'regionCouple', for example). This step has to be done in the main 'polyMesh' folder and the solid one.
  2. Modify the initial map accordingly for both main region (region0) and others (solid). For example, modifying 'regionCoupling' by 'fixedValue'.
  3. Define 'decomposeParDict' for the main 'system' folder and the solid one.
  4. Run 'decomposePar' and 'decomposePar -region solid'
  5. Correct 'boundary' files and initial maps for all processors, including main domain and solid domain.
  6. Run in parallel as usual: 'mpirun -np # conjugateHeatFoam -parallel > log &' (where # are the number of processors)
  7. In order to reconstruct the meshes run 'reconstructPar' and 'reconstructPar -region solid'
  8. In order to visualize: 'foamToVTK' and 'foamToVTK -region solid' and, execute 'paraview'. Load both cases and click on 'group Datasets' in 'filter' menu.
Hope it helps!!!!


By the way:
Quote:

Make also sure to use the harmonic scheme for the laplacian on the fluid side
It is still not clear to me in which Laplacian should I use 'harmonic' scheme (among the ones for the fluid region). In the ones that include a couple patch or just the opposite ones?

Thanks!


Elisabet

jens_klostermann January 31, 2011 01:47

Quote:

Originally Posted by elisabet (Post 292669)

By the way:
It is still not clear to me in which Laplacian should I use 'harmonic' scheme (among the ones for the fluid region). In the ones that include a couple patch or just the opposite ones?

Elisabet

Hi Elisabet,

i don't get you question, but maybe this makes it clear:

according to http://www.cfd-online.com/Forums/ope...penfoam-8.html
you need to set the laplacian scheme in fvSchemes for the energy equation. Otherwise the temperature gradient at the coupled boundary will be wrong.

laplacianSchemes
{
laplacian(DT,T) Gauss harmonic corrected;
}

Jens

elisabet January 31, 2011 06:46

Hi Jens,

Thanks for the answer. It's everything clear now.

Sorry if I was not very explicit in my question. I call uncoupled variables those that need to be solved in a single domain (velocity and pressure) and coupled ones those that have to be solved with coupled domains (temperature for conjugateHeatFoam).

Thank you very much!!

elisabet

jens_klostermann February 4, 2011 16:02

Hi Elisabet,

Did you have luck with you parallel setup?

The reason I am asking:
-fluid (region0) decomposed and solid UNdecomposed runs fine with some speedup,
-fluid (region0) decomposed and solid decomposed gives me an error as soon as the energy equation (T+T) gets solved.

So I think it is because of the region coupling (e.g. attach detach)? But I don't know - maybe Hrv knows?

Jens

elisabet February 7, 2011 09:00

Hi Jens,

I definitely had luck with my parallel simulation. At least, until now....

Quote:

Originally Posted by jens_klostermann (Post 293729)
-fluid (region0) decomposed and solid UNdecomposed runs fine with some speedup,

From my experience, this first option is not right enough, at least for my case: I have a square fluid channel with the top and bottom walls. I don't really remember now which was the problem, but the obtained temperature field looked non-physical.


Quote:

Originally Posted by jens_klostermann (Post 293729)
-fluid (region0) decomposed and solid decomposed gives me an error as soon as the energy equation (T+T) gets solved.

So I think it is because of the region coupling (e.g. attach detach)? But I don't know - maybe Hrv knows?

I'm sure Hrv can provide much more information than me, but try to attach/detach the solid domain in the same manner as the fluid domain (see attach/detachPatches.H in the source folder), as suggested in: http://www.cfd-online.com/Forums/openfoam-solving/57892-integrated-conjugate-heat-transfer-solver-openfoam-3.html#post179753

I guess this is the unique (relevant) code modification I've done.

Hope it helps!

elisabet

jens_klostermann February 10, 2011 09:54

Since I use the OF-1.6.ext version the "bug" (which is http://www.cfd-online.com/Forums/ope...tml#post179753) was already gone. However I know where the code breaks right here:

Code:

// Add fluid equation
        TEqns.set
        (
            0,
            new fvScalarMatrix
            (
                fvm::ddt(T)
              + fvm::div(phi, T)
              - fvm::laplacian(DT, T)
            )
        );

in solveEnergy.H

So I guess I need to digg further, maybe Hrv can push me further?

Jens

albem February 27, 2012 21:09

Hi

I am trying to decompose the domain 2 rectangular domains, the first one is fluid an the second one is a rectangular solid domain immersed in the fluid, centered, this solid domain occupies 1/2 of the fluid domain in both directions, I decomposed the domain in the same number of processors, but unfortunately the boundaries do not match in the same the regionCoupling for solid and liquid do not match for some of the processors,

Should I decompose both domains in different numbers of processors, in such a way that boundaries match?

Any help is welcome,

Thank you

Alberto

elisabet February 28, 2012 05:42

decomposePar in parallel
 
Hi Alberto,

Since now, when I need to decompose a case with more than one domain, I must move to version 1.7.x to correctly decompose the case (with -region option, of course). Afterwards, I can return to my version (based on 1.6-ext) and run the case. I have experienced no problems with reconstruct tool.

The error obtained when I decomposed the main case with OF-1.6-ext was something about a missing region, as far as I remember.

I would appreciate to know other alternatives, if someone has experience on it!!!

regards,

elisabet

albem May 22, 2012 19:01

1 Attachment(s)
Hello Foamers

I am trying to use decomposePar for the geometry sketched below, fluid domain with a solid domain which length is a third of the liquid length, until now I can only run conjugateHeatFoam solver using 2 processor for the liquid and 2 for the solid (x-direction), is there a way to use at least 6 for the liquid and 2 for the solid, I have found the instruction



globalFaceZones ( nameofzone1 nameofzone2 );

but I do not know how it works or if it is useful for my problem,

Please let me know your opinion about this problem

Any help is welcome.

Thanks in advance.

Alberto

liuke870915 November 27, 2014 22:37

the step 7 is wrong!
 
Quote:

Originally Posted by elisabet (Post 292669)
Hi Jens,

First of all thank you for the hints.

I finally sorted out how to deal with parallel runs: it was so obvious.... but I didn't thought on it.... one just need to use the -region option with decomposePar !!!!

So, the required steps are (within the structure of the conjugateHeatFoam tutorial case):
  1. First change the boundary file in order to avoid the 'regionCouple' type (just write 'patch' instead of 'regionCouple', for example). This step has to be done in the main 'polyMesh' folder and the solid one.
  2. Modify the initial map accordingly for both main region (region0) and others (solid). For example, modifying 'regionCoupling' by 'fixedValue'.
  3. Define 'decomposeParDict' for the main 'system' folder and the solid one.
  4. Run 'decomposePar' and 'decomposePar -region solid'
  5. Correct 'boundary' files and initial maps for all processors, including main domain and solid domain.
  6. Run in parallel as usual: 'mpirun -np # conjugateHeatFoam -parallel > log &' (where # are the number of processors)
  7. In order to reconstruct the meshes run 'reconstructPar' and 'reconstructPar -region solid'
  8. In order to visualize: 'foamToVTK' and 'foamToVTK -region solid' and, execute 'paraview'. Load both cases and click on 'group Datasets' in 'filter' menu.
Hope it helps!!!!


By the way:
It is still not clear to me in which Laplacian should I use 'harmonic' scheme (among the ones for the fluid region). In the ones that include a couple patch or just the opposite ones?

Thanks!


Elisabet

when I run reconstructPar, there is a same error as decomposePar,like "Attempt to cast type wall to type lduInterface"


All times are GMT -4. The time now is 20:39.