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

Modifying the wallHeatFlux utility

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 27, 2015, 14:45
Default Modifying the wallHeatFlux utility
  #1
New Member
 
Schuyler Hinman
Join Date: Apr 2013
Location: Calgary, Alberta, Canada
Posts: 10
Rep Power: 4
schuyler is on a distinguished road
Hello,

I am making a different version of wallHeatFlux for myself that will use the fvc::grad to calculate the gradient instead of the snGrad.

This is how it looks after I modified it:

Code:
    

 #include "createFields.H"
volVectorField gradh
    (
        IOobject
        (
        "gradh",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
        ),
        fvc::grad(h)
    );

    volScalarField wallgradh
    (
        IOobject
        (
        "wallgradh",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
        ),
        mesh,
        dimensionedScalar("wallgradh",dimensionSet(1,1,-2,0,0,0,0),0)
    );

    volScalarField heatFlux
    (
        IOobject
        (
        "heatFlux",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
        ),
        mesh,
        dimensionedScalar("heatFlux",dimensionSet(1,0,-3,0,0,0,0),0)
    );

    forAll(wallgradh.boundaryField(), patchI)
    {
        wallgradh.boundaryField()[patchI] =
        (
            ( mesh.Sf().boundaryField()[patchI] ) / ( mesh.magSf().boundaryField()[patchI] ) & gradh.boundaryField()[patchI]
        );
    }
    
    forAll(heatFlux.boundaryField(),patchI)
    {
        heatFlux.boundaryField()[patchI] = 
        fvc::interpolate
                (
                    (
                    turbulence.valid()
                  ? turbulence->alphaEff()()
                  : thermo->alpha()
                    )
                )*wallgradh.boundaryField()[patchI];
    }
The above compiles in the utility but when I run it on a case I get the following error code:

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::operator*(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  
 in "/home/wshinman/OpenFOAM/wshinman-2.2.1/platforms/linux64GccDPOpt/bin/mywallHeatFlux"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  
 in "/home/wshinman/OpenFOAM/wshinman-2.2.1/platforms/linux64GccDPOpt/bin/mywallHeatFlux"
Anything obvious that I may have screwed up?

Thanks,

Schuyler
schuyler is offline   Reply With Quote

Old   July 27, 2015, 15:48
Default Solved!
  #2
New Member
 
Schuyler Hinman
Join Date: Apr 2013
Location: Calgary, Alberta, Canada
Posts: 10
Rep Power: 4
schuyler is on a distinguished road
I found the problem (stupid mistake by me).

The section:

Code:
    forAll(heatFlux.boundaryField(), patchI)
    {
        heatFlux.boundaryField()[patchI] =
        (
        fvc::interpolate(
            ( turbulence.valid()
                      ? turbulence->alphaEff()()
                      : thermo->alpha()
            )
            )*(wallgradh.boundaryField()[patchI])
        );
    }
Was causing the problem because when I call out alpha it is not a boundary field. I just defined a new surfaceScalarField called alpha and then calculated the heatFlux using its boundaryField.

Schuyler
schuyler is offline   Reply With Quote

Reply

Tags
wallheatflux, wallnormalgradient

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 with sonicFoam hiuluom OpenFOAM Post-Processing 1 August 20, 2015 00:34
Something doens't work with wallHeatFlux utility or externalWallHeatFluxTemperat BC!! zfaraday OpenFOAM Post-Processing 0 February 5, 2015 17:47
Local heat transfer / modifying wallHeatFlux buck_s OpenFOAM Programming & Development 0 June 17, 2014 06:54
Local heat transfer / modifying wallHeatFlux buck_s OpenFOAM Post-Processing 0 June 17, 2014 06:52
wallHeatFlux utility in OpenFoam1.6 maruthamuthu_venkatraman OpenFOAM 29 October 3, 2011 10:43


All times are GMT -4. The time now is 10:29.