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

Error dividing surfaceScalarFields using fvc::interpolate(volScalarField)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2010, 18:14
Default Error dividing surfaceScalarFields using fvc::interpolate(volScalarField)
  #1
Member
 
Fábio César Canesin
Join Date: Mar 2010
Location: Florianópolis
Posts: 67
Rep Power: 16
Canesin is on a distinguished road
Hi all, I'm writing an modification of chtMultiRegionFoam and have been facing errors in calculation of diffusion-number as it follows:

Code:
Adding magnetic field 

Region: fluidflow Courant Number mean: 0.14898649 max: 0.3
#0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/printStack.C:202
#1  Foam::sigFpe::sigFpeHandler(int) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/signals/sigFpe.C:127
#2   in "/lib/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/fields/Fields/scalarField/scalarField.C:95
#4  void Foam::divide<Foam::fvsPatchField>(Foam::FieldField<Foam::fvsPatchField, double>&, Foam::FieldField<Foam::fvsPatchField, double> const&, Foam::FieldField<Foam::fvsPatchField, double> const&) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude/scalarFieldField.C:89
#5  void Foam::divide<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude/GeometricScalarField.C:114
#6  Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator/<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) at ~/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude/GeometricScalarField.C:114
#7  
 at ~/OpenFOAM/canesin-1.7.x/solvers/amrIcoPolo/solid/solidRegionDiffNo.C:47
#8  
 at ~/OpenFOAM/canesin-1.7.x/solvers/amrIcoPolo/solid/solidRegionDiffusionNo.H:16
#9  __libc_start_main in "/lib/libc.so.6"
#10  
 in "/home/canesin/OpenFOAM/canesin-1.7.x/applications/bin/linux64GccDPDebug/amrIcoPolo"
The source code looks like for solidRegionDiffNo.C:
Code:
#include "solidRegionDiffNo.H"
#include "fvc.H"

Foam::scalar Foam::solidRegionDiffNo
(
    const fvMesh& mesh,
    const Time& runTime,
    const volScalarField& cp,
    const volScalarField& rho,
    const volScalarField& K
)
{
    scalar DiNum = 0.0;
    scalar meanDiNum = 0.0;

    //- Can have fluid domains with 0 cells so do not test.
    if (mesh.nInternalFaces())
    {
        surfaceScalarField KrhoCpbyDelta =
            mesh.surfaceInterpolation::deltaCoeffs()
          * fvc::interpolate(K)
          / (fvc::interpolate(cp) * fvc::interpolate(rho));

        DiNum = max(KrhoCpbyDelta.internalField())*runTime.deltaT().value();

        meanDiNum = (average(KrhoCpbyDelta)).value()*runTime.deltaT().value();
    }

    Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
        << " max: " << DiNum << endl;

    return DiNum;
}
What is wrong here ?? I'm really missing it.
Canesin is offline   Reply With Quote

Old   September 27, 2010, 19:05
Default
  #2
Member
 
Fábio César Canesin
Join Date: Mar 2010
Location: Florianópolis
Posts: 67
Rep Power: 16
Canesin is on a distinguished road
Hi all, sorry for the lame post!!!!

I have setup an unphysical boundary condition by mistake, had cp 0 them gat the floint point error...

Sorry !
Canesin 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
SurfaceScalarFields fabianpk OpenFOAM 7 August 10, 2016 05:00


All times are GMT -4. The time now is 16:09.