CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Two-sided Wall Heat Transfer BC - No Separate Solid Mesh and No Heat Transfer Coeff (http://www.cfd-online.com/Forums/openfoam-solving/80114-two-sided-wall-heat-transfer-bc-no-separate-solid-mesh-no-heat-transfer-coeff.html)

swahono September 15, 2010 21:36

Two-sided Wall Heat Transfer BC - No Separate Solid Mesh and No Heat Transfer Coeff
 
Dear Foamers and Experts,

I have been trying to perform a CFD for compressible internal flow (using rhoSimpleFoam). However, I have been having difficulty implementing the right BC for modelling heat transfer through a 'two-sided' thin wall.
The wall does not have thickness (only surface mesh). However, it needs to model heat transfer from one side to another side (this is similar to having a 'shadow wall' in Fluent), without having a separate solid mesh region.

Quote:

It is important that our mesh model does not need to incorporate a separate solid mesh region.

The heatflux through the wall must be computed based on local heat transfer coefficient calculated from local flow information.

The heat transfer coefficient must be calculated during runtime from local flow information.
In addition to the 'two-sided thin wall' BC, I would also like the ability for the heat conduction through the wall be specified in the BC dictionary, i.e. wall thickness, wall conductivity.

Additionally, the ability to compute 2D heat conduction in the thin shell is important.

All these will need to be achieved without the need to have a separate solid mesh region, and readily implementable with rhoSimpleFoam and rhoSonicFoam solver.

I believe no BC is readily available in OF that is able to do this without the need to have a separate solid mesh.

I have attempted to model the above requirements using wallHeatTransfer, groovyBC, and fixedGradient, all to no satisfactory result.

Could anyone please advice me if this is readily achievable in OpenFOAM without further development of a new BC?

Thank you very much in advanced for your response.

Best Regards,
Stefano Wahono

ata September 17, 2010 02:09

Hi Stefano
I think you are right. As I know there in no such a BC in OF.
Best regards
Good luck

Ata

majas November 29, 2010 04:42

thin wall conduction
 
hi
I have a problem with heat conduction through thin wall
i have square and in fluent in BC i put thickness and shell conduction for walls and i put heat generation in the square too
but after solving, in display contours of temperature i can't see contours of temp in the square and i can't see any thickness that i put for wall.why?
could any one help me

swahono November 30, 2010 20:00

Hi Majas,

I believe you are describing your problem with Fluent. But, unfortunately, this is an OpenFOAM forum.
I think you stand better chance to get help if you post in the Fluent forum within the cfd-online.com.

Cheers,
Stefano

newOFuser August 20, 2011 12:35

Hi Stefano,

Were you able to implement the Two-sided Wall Heat Transfer BC ?ak

swahono August 21, 2011 20:33

Hi ak,

Yes, OpenFOAM 2.0 comes with a two-sided wall BC. Several pre-processing steps are needed to set up this.
The following steps solve BOTH the normal heat transfer through the wall and the lateral heat transfer (or shell conduction).

Good luck trying. Let me know how you go.

Let's say the patch name of your two-sided wall is "wall_duct". Note the following steps work with mesh imported from Fluent format with a "shadow" wall already created in the mesh.

The pre-processing:

1. Create a setSet file with the following entries

Code:

faceSet fBaffle new patchToFace wall_duct
faceSet fBaffleShadow new patchToFace wall_duct-shadow
 
cellSet fBaffleCells new faceToCell fBaffle any
cellSet fBaffleShadowCells new faceToCell fBaffleShadow any
 
faceZoneSet fBaffle new setToFaceZone fBaffle
faceZoneSet fBaffleShadow new setToFaceZone fBaffleShadow
 
// You need to do above for each of you two-sided wall.

2. Then run:

Code:

$ setSet -batch setSet
3. make a new file system/extrudeToRegionMeshDict

Code:

region          baffleRegion;
faceZones      (fBaffle);
faceZonesShadow (fBaffleShadow);
oneD            false;
extrudeModel    linearNormal;
nLayers        10;  // Number of layers to solve the Conduction Eqn
expansionRatio  1;
adaptMesh      yes; // apply directMapped to both regions
linearNormalCoeffs
{
    thickness      0.005;  // virtual wall thickness in m
}

Run the following:

Code:

$ extrudeToRegionMesh -overwrite
3. Set the Boundary Condition files

in your 0/T file:
Code:


    wall_duct
    {
        type            compressible::thermoBaffle1DTemperature<constSolidThermoPhysics>;
        baffleActivated yes;
        thickness      uniform 0.005; // virtual baffle thickness
        Qs              uniform 0; // Heat flux [W/M2]
        transportProperties
        {
            K              202.4; // heat Conductance
        }
        radiativeProperties
        {
            sigmaS          0;
            kappa          0;
            emissivity      0;
        }
        thermoProperties
        {
            Hf              0;
            Cp              871;
        }
        densityProperties
        {
            rho            2719;
        }
        value          uniform 300;
    }
    wall_duct-shadow
    {
        $wall_duct
    }

You need to add the baffle patches in your BCs:

Add the following in 0/U
Code:

fBaffleShadow_top
{
    type    fixedValue;
    value  uniform (0 0 0);
}
"region0_.*"
{
 
    type    fixedValue;
    value  uniform (0 0 0);
}

Add the following in 0/p
Code:

fBaffleShadow_top
{
    type    zeroGradient;
}
"region0_.*"
{
 
    type    zeroGradient;
}

Add the following in 0/epsilon
Code:

fBaffleShadow_top
  {
        type            compressible::epsilonWallFunction;
    }
 
"region0_.*"
  {
        type            compressible::epsilonWallFunction;
    }

Add the following in 0/k
Code:

fBaffleShadow_top
  {
        type            compressible::kqRWallFunction;
    }
 
"region0_.*"
  {
        type            compressible::kqRWallFunction;
    }

Add the following in 0/alphat
Code:

fBaffleShadow_top
  {
        type            alphatWallFunction;
        value          uniform 0;
    }
 
"region0_.*"
  {
        type            alphatWallFunction;
        value          uniform 0;
    }

Make a new directory under the 0 directory:
Code:

$ mkdir 0/baffleRegion
Then, copy 0/T file into this new sub-directory.

Make a new directory under the system directory:
Code:

$ mkdir system/baffleRegion
Create a new file system/baffleRegion/changeDictionaryDict

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
    boundary
    {
        fBaffleShadow_top
        {
            type            directMappedWallVariableThickness;
            // This thickness is used if the baffle is 1D.
            thickness      uniform 0.005;
        }
        region0_to_baffleRegion_fBaffle
        {
            type            directMappedWallVariableThickness;
            // This thickness is used if the baffle is 1D.
            thickness      uniform 0.005;
        }
        symplanes
        {
            type        symmetryPlane; // (symmetryPlane:2D. wedge:1D)
        }
    }
    T
    {
        boundaryField
        {
            fBaffleShadow_top
            {
              type          compressible::turbulentTemperatureCoupledBaffleMixedNew;
                neighbourFieldName  T;
                K                  solidThermo;
                KName              none;
                //value              uniform 300; Don't want to spoil the old run
            }
            region0_to_baffleRegion_fBaffle
            {
                type        compressible::turbulentTemperatureCoupledBaffleMixedNew;
                neighbourFieldName  T;
                K                  solidThermo;
                KName              none;
                //value              uniform 300; Don't want to spoil the old run
            }
        }
    }
}

Create a new file system/changeDictionaryDict
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
    T
    {
        boundaryField
        {
            fBaffleShadow_top
            {
                type        compressible::turbulentTemperatureCoupledBaffleMixedNew;
                neighbourFieldName  T;
                K                  basicThermo;
                KName              none;
                //value              uniform 300; Don't want to spoil the old run
            }
            region0_to_baffleRegion_fBaffle
            {
                type        compressible::turbulentTemperatureCoupledBaffleMixedNew;
                neighbourFieldName  T;
                K                  basicThermo;
                KName              none;
                //value              uniform 300;
            }
        }
    }
}

Then run the following:
Code:

$ changeDictionary -literalRE
$ changeDictionary -region baffleRegion -literalRE

4. Add fvSchemes and fvSolution files in the system/baffleRegion

The system/baffleRegion/fvSchemes look like this:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system/baffleRegion";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
    default    steadyState;
}
divSchemes
{
    default        none;
}
gradSchemes
{
    default        Gauss linear;
}
laplacianSchemes
{
    default        none;
    laplacian(K,T)  Gauss linear corrected;
}

// ************************************************************************* //

The system/baffleRegion/fvSolution file looks like this:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system/baffleRegion";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
    T
    {
        /*
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance      1e-05;
            relTol          0;
            smoother        DICGaussSeidel;
            nPreSweeps      0;
            nPostSweeps    2;
            nFinestSweeps  2;
            cacheAgglomeration false;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels    1;
        }
        tolerance      1e-05;
        relTol          0;
        maxIter        100;
        */
        solver          PCG;
        preconditioner  DIC;//GaussSeidel;
        smoother        DILU;
        tolerance        1e-06;
        relTol          0;
    }
}
nNonOrthCorr    0;
relaxationFactors
{
    T      1;
}
// ************************************************************************* //

5. Add a dictionary for the baffle

Create a new file constant/thermoBaffleProperties
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      thermoBaffleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoBaffleModel  thermoBaffle2D;
active          yes;
regionName      baffleRegion;
thermoBaffle2DCoeffs
{
}
noThermoCoeffs
{
}
// ************************************************************************* //

Create a new directory "constant/baffleRegion"
Create a new file inside this new subdirectory
constant/baffleRegion/solidThermophysicalProperties
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.x                                |
|  \\  /    A nd          | Web:      http://www.OpenFOAM.com              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      solidThermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType constSolidThermo;

constSolidThermoCoeffs
{
    //- thermo properties
    rho rho [1 -3  0  0 0 0 0]              2719;
    Cp  Cp  [0  2 -2 -1 0 0 0]              871;
    K  K  [1  1 -3 -1 0 0 0]              202.4;
    //- radiative properties
    kappa kappa [0 -1 0 0 0 0 0]            0;
    sigmaS sigmaS [0 -1 0 0 0 0 0]          0;
    emissivity  emissivity  [0 0 0 0 0 0 0] 1;
    //- chemical properties
    Hf  Hf  [0  2 -2  0 0 0 0]              0;
}

// ************************************************************************* //

6. Modify your solver to solve for the baffle
In this example I use rhoSimpleFoam

Copy the entire directory of $FOAM_SOLVERS/compressible/rhoSimpleFoam into a new directory
$FOAM_SOLVERS/compressible/rhoSimpleBaffleFoam

Add the following line in your $FOAM_SOLVERS/compressible/rhoSimpleBaffleFoam/rhoSimpleBaffleFoam.C

Code:

#include "simpleControl.H"
#include "thermoBaffleModel.H"

Add the following line in your $FOAM_SOLVERS/compressible/rhoSimpleBaffleFoam/createFields.H

Code:

    autoPtr<regionModels::thermoBaffleModels::thermoBaffleModel> baffles
    (
        regionModels::thermoBaffleModels::thermoBaffleModel::New(mesh)
    );

Add the following line in your $FOAM_SOLVERS/compressible/rhoSimpleBaffleFoam/hEqn.H

Code:

    baffles->evolve();

    thermo.correct();

7. Recompile the code.

Change the Make/files
Code:

rhoSimpleBaffleFoam.C
EXE = $(FOAM_APPBIN)/rhoSimpleBaffleFoam

Add the following libraries in the the Make/options
Code:

EXE_INC = \
    -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
    -I$(LIB_SRC)/regionModels/thermoBaffleModels/lnInclude
EXE_LIBS = \
    -lthermoBaffleModels \
    -lregionModels

Compile the code
Code:

$ Allwmake
8. Run the case using the new solver rhoSimpleBaffleFoam.

I hope that helps!

Kind regards,
Stefano

newOFuser August 23, 2011 12:03

Hi Stefano,

Thanks so much for the detailed reply! This should be very useful!
Currently I am using OF 1.7.1 but will be upgrading to the newer version, and will post once I have results.

Thanks again,
ak

karlamora March 26, 2014 07:12

Hi,

I am following a similar process but when I use extrudeToRegionMesh -overwrite I got the following error:

--> FOAM FATAL ERROR:
Zone walls is not consistently all internal or all boundary faces. Face 107868 at (-4 0.1 -3.9) is the first occurrence.

From function checkZoneInside(..)
in file extrudeToRegionMesh.C at line 439.

FOAM exiting

Do you have an idea about how can I solve this?

Regards,

Karla

Naresh yathuru February 26, 2015 05:30

two sided wall in openfoam
 
Hi karla mora

I m new to openfoam. I m using openfoam 2.3 i would like to know if u could able to solve the error and procceed further. Its a very interesting topic to simulate two sided walls in openfoam . could you please share your experience and challenges u faced. it would be a real contribution. Thank you.

regards,
Naresh


All times are GMT -4. The time now is 06:22.