CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] how do you set a faceZone with flip map flags?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By donQi
  • 1 Post By donQi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2013, 04:11
Default how do you set a faceZone with flip map flags?
  #1
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 14
donQi is on a distinguished road
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 is offline   Reply With Quote

Old   September 6, 2013, 07:59
Default
  #2
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 14
donQi is on a distinguished road
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.
Utkan likes this.
donQi is offline   Reply With Quote

Old   September 8, 2013, 21:58
Default
  #3
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 14
donQi is on a distinguished road
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
donQi is offline   Reply With Quote

Old   October 21, 2013, 05:57
Default
  #4
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
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; //95°C
        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.
vkrastev is offline   Reply With Quote

Old   November 5, 2013, 11:14
Default
  #5
New Member
 
anonymous
Join Date: Mar 2013
Posts: 5
Rep Power: 13
jcn2013 is on a distinguished road
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
jcn2013 is offline   Reply With Quote

Old   November 5, 2013, 11:30
Default
  #6
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by jcn2013 View Post
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 is offline   Reply With Quote

Old   November 5, 2013, 12:14
Default
  #7
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
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
vkrastev is offline   Reply With Quote

Old   November 11, 2013, 12:19
Default
  #8
New Member
 
anonymous
Join Date: Mar 2013
Posts: 5
Rep Power: 13
jcn2013 is on a distinguished road
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
jcn2013 is offline   Reply With Quote

Old   November 14, 2013, 12:15
Default
  #9
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
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.
vkrastev is offline   Reply With Quote

Old   June 12, 2014, 03:08
Default
  #10
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 14
donQi is on a distinguished road
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.
Utkan likes this.
donQi is offline   Reply With Quote

Old   May 11, 2016, 09:40
Default
  #11
Member
 
Join Date: Apr 2016
Posts: 91
Rep Power: 10
CellZone is on a distinguished road
Hi,

I'm working on the same issue and I'm wondering, how I can figure out the thickness of one plane of faces?
Depending on my size of my "boxToFace" I get values for the temperature varying between 300 and 800 K.

If I open paraview I can measure the disctance of one cell (or calculate it). Is this the face's thickness? If so, the values would be totally wrong (too huge).

Has someone experienced same problems?
CellZone is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
does Hyperthreading affect the application of UDF? SJSW Fluent UDF and Scheme Programming 11 October 10, 2018 23:28
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
set BC mass-flow-inlet via UDF and via GUI perform different result sawa25 FLUENT 1 February 25, 2015 01:51
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Help with GNUPlot Renato. Main CFD Forum 6 June 6, 2007 20:51


All times are GMT -4. The time now is 03:45.