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

Interpretting an error message

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 13, 2016, 07:41
Default Interpretting an error message
  #1
New Member
 
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 9
ChasingNeutrons is on a distinguished road
Hi guys,

Struggling to get a solver I've made to compile and have only one somewhat obscure error message left to overcome. I am hoping that someone might be able to advise me on what I'm doing wrong. The message is:
Code:
In file included from /opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.H:343:0,
                 from /opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
                 from /opt/openfoam30/src/OpenFOAM/lnInclude/TimeState.H:38,
                 from /opt/openfoam30/src/OpenFOAM/lnInclude/Time.H:47,
                 from /opt/openfoam30/src/finiteVolume/lnInclude/fvCFD.H:6,
                 from MOCsolver.C:32:
/opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.C: In instantiation of ‘Foam::dimensioned<typename Foam::pTraits<arg1>::cmptType> Foam::dimensioned<Type>::component(Foam::direction) const [with Type = double; typename Foam::pTraits<arg1>::cmptType = double; Foam::direction = unsigned char]’:
/opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.C:404:23:   required from ‘Foam::dimensioned<typename Foam::pTraits<arg1>::cmptType> Foam::dimensioned<Type>::operator[](Foam::direction) const [with Type = double; typename Foam::pTraits<arg1>::cmptType = double; Foam::direction = unsigned char]’
MOCsolver.C:86:68:   required from here
/opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.C:287:5: error: request for member ‘component’ in ‘((const Foam::dimensioned<double>*)this)->Foam::dimensioned<double>::value_’, which is of non-class type ‘const double’
     );
     ^
/opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.C: In member function ‘Foam::dimensioned<typename Foam::pTraits<arg1>::cmptType> Foam::dimensioned<Type>::component(Foam::direction) const [with Type = double; typename Foam::pTraits<arg1>::cmptType = double; Foam::direction = unsigned char]’:
/opt/openfoam30/src/OpenFOAM/lnInclude/dimensionedType.C:288:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
This seems to flag up for the line featuring the calculation of tau in my solver:

Code:
for (int i=0; i<naz; i++)
{
    for (int j=0; j<npo; j++)
    {
        for (int n=0; n<ncells; n++)
        {
            tau[i][j][n]=Lray[celllabel[n]]*sigmaT[celllabel[n]].value()/mag(cosphi[i]*sintheta[j]);
            exp_factor[i][j][n]= 1.0+Foam::exp(tau[i][j][n]);
        }
    }
}
My suspicion is that it's to do with tau and all other variables being scalars except for sigmaT which is a dimensioned scalar (although without a dimension set) property defined in createFields.H. Also, celllabel is an array containing the indices of each cell in the order they occur for my specific routine. I had thought that using the .value() method would overcome any such problems of incompatibility but seemingly not. Hence, I'm keen on any advice which might simplify things.

Cheers for any help.
ChasingNeutrons is offline   Reply With Quote

Old   June 13, 2016, 14:31
Default
  #2
New Member
 
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 9
ChasingNeutrons is on a distinguished road
Found a work around by changing the sigmaT to a volScalarField. Now other problems to fix!
ChasingNeutrons 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
error interpretting 2 UDFs Thomashoffmann Fluent UDF and Scheme Programming 0 January 16, 2013 10:09


All times are GMT -4. The time now is 19:31.