CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   how do you set a faceZone with flip map flags? (http://www.cfd-online.com/Forums/openfoam-meshing/123177-how-do-you-set-facezone-flip-map-flags.html)

donQi September 6, 2013 03:11

how do you set a faceZone with flip map flags?
 
Hello,

does anyone know how to set in SnappyHexMesh a faceZone with flip map flags?

till now I just created a normal faceZone but here
http://foam.sourceforge.net/docs/cpp/a00512.html
the note says:
faceZone is the faces at the inlet of the cellzone, it needs to be created with flip map flags. It is used to integrate the net mass flow rate into the heat exchanger

donQi September 6, 2013 06:59

I did not found any command to automatically change the flipMap List.
So I did it manually:
once launched snappyHexMesh
enter in constant/polyMesh/
open the file faceZones -> search for "flipMap List"
you will see the list with
flipMap List<bool>

4961
(
1
1
0
1
0
0
0
1
1

....

so I just opened Calc LibreOffice, created a vector column of 4961 ones, and past it into the flipMap List of faceZones file instead of those 0 and 1. In this way once the analysis is launched the mass flow rate is computed correctly and the temperature of the heat exchanger goes up as expected.

donQi September 8, 2013 20:58

instead of changing the flipMap list by copy and paste, another alternative could be to use a script like the following :

#!/bin/bash
# please copy this file in the directory of the OpenFOAM_case
# for its correct execution the constant directory has to be present
sed -i 's/^0$/1/' constant/polyMesh/faceZones
# where:
# ^ = Start of a line
# $ = End of a line
# in this way it substitutes only the zeros that are alone in a line

vkrastev October 21, 2013 04:57

Hi,
did you manage to get the effectivenessHeatExchangerSource work properly? I have created a face zone at the heat exchanger inlet, changing the flipMap settings as you posted above, then edited the fvOptions file and added an effTable file in my case folder (see below).

faceZones
Code:

radiatore_inlet
{
    type faceZone;
faceLabels      List<label>
25309
(
70389
70401
...
...
2160521
2160527
)
;
flipMap        List<bool>
25309
(
1
1
1
...
...
1
1
1
)
;
}
)

fvOptions
Code:

thermal_radiatore_he
{
    type effectivenessHeatExchangerSource;
    active          true;
    selectionMode  cellZone;
    cellZone        radiatore;

    effectivenessHeatExchangerSourceCoeffs
    {
        secondaryMassFlowRate 0.694;
        secondaryInletT      368; //95C
        primaryInletT        293;
        UName                U;
        TName                T;
        phiName              phi;
        faceZone              radiatore_inlet;
        outOfBounds          clamp;
        fileName              "effTableRadiatore_334";
    }
}

effTableRadiatore_334
Code:

(
            (0.285 \\primary-MRF
            (
                (0.694    0.911) \\(secondary-MRF  effectiveness)
                (1.389    0.947)
                (2.083    0.954)
                (2.778    0.960)
                (4.169    0.962)
            ))
           
            (0.571
            (
                (0.694    0.833)
                (1.389    0.900)
                (2.083    0.928)
                (2.778    0.932)
                (4.169    0.939)
            ))
           
            (0.856
            (
                (0.694    0.744)
                (1.389    0.836)
                (2.083    0.887)
                (2.778    0.888)
                (4.169    0.903)
            ))

            (1.142
            (
                (0.694    0.667)
                (1.389    0.771)
                (2.083    0.841)
                (2.778    0.848)
                (4.169    0.870)
            ))

            (1.427
            (
                (0.694    0.603)
                (1.389    0.713)
                (2.083    0.798)
                (2.778    0.813)
                (4.169    0.844)
            ))

            (1.713
            (
                (0.694    0.549)
                (1.389    0.660)
                (2.083    0.758)
                (2.778    0.781)
                (4.169    0.814)
            ))

            (1.998
            (
                (0.694    0.500)
                (1.389    0.612)
                (2.083    0.717)
                (2.778    0.746)
                (4.169    0.786)
            ))

            (2.283
            (
                (0.694    0.460)
                (1.389    0.566)
                (2.083    0.679)
                (2.778    0.711)
                (4.169    0.755)
            ))

            (2.569
            (
                (0.694    0.451)
                (1.389    0.526)
                (2.083    0.639)
                (2.778    0.676)
                (4.169    0.722)
            ))
);

But when the solver starts (chtMultiRegionSimpleFoam), I got the following error:
Code:

Time = 1


Solving for fluid region fluid
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 0.006681191, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 0.009447526, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 0.0003616165, No Iterations 2
#0  Foam::error::printStack(Foam::Ostream&) in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::fv::effectivenessHeatExchangerSource::addSup(Foam::fvMatrix<double>&, int) in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/lib/libfvOptions.so"
#4 
 in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/bin/chtMultiRegionSimpleFoam"
#5 
 in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/bin/chtMultiRegionSimpleFoam"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 
 in "/home/vesselin/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64Gcc46DPOpt/bin/chtMultiRegionSimpleFoam"
Floating point exception (core dumped)

Any hints on what's going wrong?

Thanks in advance

V.

jcn2013 November 5, 2013 11:14

Hi vkrastev,

You have probably figured this out by now, but OpenFOAM does not like your effectiveness table format. If you simply remove all of your additional secondary flow rates, and only consider the secondary flow rate for which you are analyzing (.694), then this should run just fine.

Regards,

Josh

vkrastev November 5, 2013 11:30

Quote:

Originally Posted by jcn2013 (Post 460661)
Hi vkrastev,

You have probably figured this out by now, but OpenFOAM does not like your effectiveness table format. If you simply remove all of your additional secondary flow rates, and only consider the secondary flow rate for which you are analyzing (.694), then this should run just fine.

Regards,

Josh

Hi Josh,

and thanks a lot for the response. Actually I haven't tried this yet, if it so is sounds me almost like a bug (why I should change the table each time I change the secondary flow rate, instead of using a single table with all the range of secondary flows I need?) but if it works it will be great anyway.

I'll keep you posted,
thanks once again

Vesselin

vkrastev November 5, 2013 12:14

Hi Josh,

adding ONLY the correction you suggested to the above table structure did not change anything: the run blows up exactly at the same point with the same error message. Could it be related to something else, maybe the flipMap issue about the primary inlet faceZone (see previous posts)? If you were able to run a case with the source on, could you please post some additional details on the necessary steps to get it work?

Thanks once again

V.

PS-If you like, we can move this discussion here http://www.cfd-online.com/Forums/ope...tml#post458860, since it is probably more approriate

jcn2013 November 11, 2013 12:19

Hi Vesselin,

Outside of looking at the rest of your constant files, I see only one difference in your tables from mine:



//Yours:

( (0.285 \\primary-MRF ( (0.694 0.911) \\(secondary-MRF effectiveness) ))
//...
)


//Mine:

10 //total number of primary Mass Flow Rate values
( (0.285 \\primary-MRF
1 //number of secondary flow rates (and eff) at this primary flow rate
(
(0.694 0.911) \\(secondary-MRF effectiveness) ))
//...
)

The fact that your equations are being solved tell me that your constant/BC files are probably correct. It is blowing up for you when it calls your effTable. Hope this helps.

Regards,

Josh

vkrastev November 14, 2013 12:15

Hi Josh,

thanks again for your interest about my issues. Unfortunately your last suggestion didn't work: same error at the same point. Actually, as I wrote here http://www.cfd-online.com/Forums/ope...tml#post458860, I suspect that the problem could be related to something else than the effTable format, since It should be read before the equations start to be solved. Maybe it could be the way I have specified the inlet faceZone and the related flipMap options, but I'm not sure.

Best

V.

donQi June 12, 2014 02:08

Ciao Vesselin,

sorry for the late reply,

here is my effectiveness Table

Code:

4
(
    // 1 
    (
        0            // primaryMassFlowRate [Kg/sec]
        1
        (
            (1      0.9986329)  // is not exactly 1 because Toutlet limited to 81.9C
        )
    )
    // 2 
    (
        0.0647  // primaryMassFlowRate [Kg/sec]
        1
        (
            (1      0.9295797)        // (secondaryMassFlowRate        effectiveness)
        )
    )
    // 3 
    (
        0.0862  // primaryMassFlowRate [Kg/sec]
        1
        (
            (1      0.8722570)
        )
    )
    // 4
    (
        0.1078  // primaryMassFlowRate [Kg/sec]
        1
        (
            (1      0.8308619)
        )
    )
);

in fvOptions :

Code:

effectivenessHeatExchangerSource
    {
        type            effectivenessHeatExchangerSource;
        active          true;
        selectionMode  cellZone;
        cellZone        H-CORE;

        effectivenessHeatExchangerSourceCoeffs
        {
            fieldNames              (h);
            secondaryMassFlowRate  1.0;
            secondaryInletT        360;
            primaryInletT          273.15; 
            faceZone                inletH-CORE_Oriented; // produced by topoSet
            outOfBounds            clamp;
            fileName                "$FOAM_CASE/effTable";
        }
    }


In the end I solved the flip map problem by creating the faceZone not with snappyHexMesh but using topoSet in the following way:

Code:

    {
        // Name of set to operate on
        name    extractedFaces;  // to create the faceZone required by the effectiveness module in fvOptions
        type    faceSet;
        // One of clear/new/invert/add/delete|subset/list
        action  new;
        source  boxToFace;
        sourceInfo
        { 
            // positioned in the inlet zone
            box (0.369663972004741 -0.1015 0.141877) (0.370265538114736 0.1015 0.307878);
           
        }
    }
   
   
    // creation of the faceZone of the H-CORE (from the above faceSet)
    {
                name    inletH-CORE_Oriented;
                type    faceZoneSet;
                action  new;
                source  setAndNormalToFaceZone;
                sourceInfo
                {
                        faceSet extractedFaces;
                        normal (1    0    0);
                }
    }

I set the coordinates of the box by checking the mesh in paraview, the box has to be thin enough to extract only one plane of faces.


All times are GMT -4. The time now is 02:48.