schuyler |
July 27, 2015 14:45 |
Modifying the wallHeatFlux utility
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
|