CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

wallHeatFlux utility with sonicFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 27, 2015, 10:06
Default wallHeatFlux utility with sonicFoam
  #1
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 44
Rep Power: 4
hiuluom is on a distinguished road
Hi everybody,

When I tried wallHeatFlux the buoyantSimpleFoam OF 2.1.1 in hotroom tutorial it was no problem with thermotype:

Code:
thermoType      hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;

pRef            100000;

mixture
{
    specie
    {
        nMoles          1;
        molWeight       28.9;
    }
    thermodynamics
    {
        Cp              1000;
        Hf              0;
    }
    transport
    {
        mu              1.8e-05;
        Pr              0.7;
    }
}
But in sonicFoam with prism tutorial has difference thermo:

Code:
thermoType      ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>;

mixture
{
    specie
    {
        nMoles          1;
        molWeight       28.9;
    }
    thermodynamics
    {
        Cv              717.5;
        Hf              0;
    }
    transport
    {
        mu              1.8e-05;
        Pr              0.7;
    }
}
I used the wallHeatFluxRho and wallHeatflux (default) which was provide in forum, OF 2.1.1 and had been a problem:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec   : wallHeatFlux -latestTime
Date   : Jul 25 2015
Time   : 06:53:06
Host   : "CompEng"
PID    : 2979
Case   : /home/huynh/OpenFOAM/huynh-2.1.1/run/prism
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create mesh for time = 0.0003
Time = 0.0003
Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>

--> FOAM FATAL ERROR: 
Not implemented
    From function basicThermo::h()
    in file basicThermo/basicThermo.C at line 260.
FOAM aborting
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2  Foam::basicThermo::h() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libbasicThermophysicalModels.so"
#3  
 in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/wallHeatFlux"
#4  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#5  
 in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/wallHeatFlux"
Aborted
therefore, I copy the thermotype from buoyantSimpleFoam to sonicFoam calculation wallHeatFlux again. It was run but the result equal to zero.

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec   : wallHeatFluxRho -latestTime
Date   : Jul 25 2015
Time   : 22:05:09
Host   : "CompEng"
PID    : 4590
Case   : /home/huynh/OpenFOAM/huynh-2.1.1/run/prism
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0.0003

Time = 0.0003
Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading/calculating face flux field phi

Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
    Prt             1;
}


Wall heat fluxes [W]
prismWall 0

End
I saw the source code wallHeatFlux which was compute by gradient of enthalpy h corresponding hPsiThermo. Otherwise, the ePsiThermo with internal energy e was not described in equation wallHeatFlux. I replace the enthalpy h by internal energy e and compile it unsuccessful.

Code:
fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h)
I would like to calculate wallHeatFlux for sonicFoam but it cannot. Could anybody can show me the solve for this, please?

Thank you so much
hiuluom is offline   Reply With Quote

Old   August 20, 2015, 00:34
Default
  #2
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 44
Rep Power: 4
hiuluom is on a distinguished road
Hi everybody,

I modified the wallHeatFlux that can be calculated for ePsithermo. Here is the code:
WallHeatFlux.C
Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Application
    wallHeatFlux

Description
    Calculates and writes the heat flux for all patches as the boundary field
    of a volScalarField and also prints the integrated flux for all wall
    patches.

\*---------------------------------------------------------------------------*/

#include "fvCFD.H"
#include "hCombustionThermo.H"
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "turbulenceModel.H"
#include "wallFvPatch.H"

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

int main(int argc, char *argv[])
{
    timeSelector::addOptions();
#   include "addRegionOption.H"
    #include "setRootCase.H"
    #include "createTime.H"
    instantList timeDirs = timeSelector::select0(runTime, args);
    #include "createNamedMesh.H"

    forAll(timeDirs, timeI)
    {
        runTime.setTime(timeDirs[timeI], timeI);
        Info<< "Time = " << runTime.timeName() << endl;
        mesh.readUpdate();

        #include "createFields.H"

        surfaceScalarField heatFlux
        (
            fvc::interpolate(turbulence->alphaEff())*fvc::snGrad(e)
        );

        const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
            heatFlux.boundaryField();

        Info<< "\nWall heat fluxes [W]" << endl;
        forAll(patchHeatFlux, patchi)
        {
            if (isA<wallFvPatch>(mesh.boundary()[patchi]))
            {
                Info<< mesh.boundary()[patchi].name()
                    << " "
                    << gSum
                       (
                           mesh.magSf().boundaryField()[patchi]
                          *patchHeatFlux[patchi]
                       )
                    << endl;
            }
        }
        Info<< endl;

        volScalarField wallHeatFlux
        (
            IOobject
            (
                "wallHeatFlux",
                runTime.timeName(),
                mesh
            ),
            mesh,
            dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0)
        );

        forAll(wallHeatFlux.boundaryField(), patchi)
        {
            wallHeatFlux.boundaryField()[patchi] = patchHeatFlux[patchi];
        }

        wallHeatFlux.write();
    }

    Info<< "End" << endl;

    return 0;
}

// ************************************************************************* //
And createFields.H
Code:
    Info<< "Reading thermophysical properties\n" << endl;

    autoPtr<basicPsiThermo> pThermo
    (
        basicPsiThermo::New(mesh)
    );
    basicPsiThermo& thermo = pThermo();

    //volScalarField& p = thermo.p();
    volScalarField& e = thermo.e();
    //const volScalarField& psi = thermo.psi();

    volScalarField rho
    (
        IOobject
        (
            "rho",
            runTime.timeName(),
            mesh
        ),
        thermo.rho()
    );

    Info<< "Reading field U\n" << endl;
    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    #include "compressibleCreatePhi.H"


    Info<< "Creating turbulence model\n" << endl;
    autoPtr<compressible::turbulenceModel> turbulence
    (
        compressible::turbulenceModel::New
        (
            rho,
            U,
            phi,
            thermo
        )
    );
Then the result with my nozzle tube in example ran sonicFoam
Code:
Create time

Create mesh for time = 0.0090052

Time = 0.0090052
Reading thermophysical properties

Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>
Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    gamma1          0.05532;
    gamma2          0.4403;
    a1              0.31;
    c1              10;
    Prt             1;
}


Wall heat fluxes [W]
bottom_heat -104748
But it has been difference with wallHeatFlux default in OF and replace epsiThermo by hpsiThermo.
Code:
Create time

Create mesh for time = 0.0090052

Time = 0.0090052
Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading/calculating face flux field phi

Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1         0.85034;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.85616;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    gamma1          0.05532;
    gamma2          0.4403;
    a1              0.31;
    c1              10;
    Prt             1;
}


Wall heat fluxes [W]
bottom_heat -146611

End

Last edited by hiuluom; August 21, 2015 at 13:15.
hiuluom is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
wallHeatFlux utility for an incompressible case Mr.Jingles OpenFOAM Post-Processing 43 July 25, 2015 11:10
wrong calculation of wallHeatFlux utility in solid patches zfaraday OpenFOAM Post-Processing 4 April 3, 2015 04:25
Something doens't work with wallHeatFlux utility or externalWallHeatFluxTemperat BC!! zfaraday OpenFOAM Post-Processing 0 February 5, 2015 17:47
wallHeatFlux utility and chtMultiRegionFoam solver Lada OpenFOAM Post-Processing 4 June 7, 2012 09:46
wallHeatFlux utility in OpenFoam1.6 maruthamuthu_venkatraman OpenFOAM 29 October 3, 2011 10:43


All times are GMT -4. The time now is 18:47.