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

error with compiling

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2019, 12:52
Default error with compiling
  #1
New Member
 
hui cheng
Join Date: Jul 2017
Posts: 4
Rep Power: 8
chenghui62000 is on a distinguished road
Dear all,

I am trying to compile a solver from OF301 to OF1812 and encountered an error in the code.

The error are like that:
Code:
multiStepNetPorosityZone/multiStepNetPorosityZone.C: In member function ‘Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::multiStepNetPorosityZone::ddt(Foam::volScalarField&, Foam::volVectorField&) const’:
multiStepNetPorosityZone/multiStepNetPorosityZone.C:202:19: error: binding reference of type ‘Foam::fvVectorMatrix& {aka Foam::fvMatrix<Foam::Vector<double> >&}’ to ‘const Foam::fvMatrix<Foam::Vector<double> >’ discards qualifiers
     modifyddt(tres());
               ~~~~^~
multiStepNetPorosityZone/multiStepNetPorosityZone.C:51:6: note:   initializing argument 1 of ‘void Foam::multiStepNetPorosityZone::modifyddt(Foam::fvVectorMatrix&) const’
 void Foam::multiStepNetPorosityZone::modifyddt(fvVectorMatrix& m) const
      ^~~~
/opt/OpenFOAM/OpenFOAM-v1812/wmake/rules/General/transform:34: recipe for target 'Make/linux64GccDPInt32Opt/multiStepNetPorosityZone/multiStepNetPorosityZone.o' failed

The relevant source code is liked:
Code:
//- modify ddt term
void Foam::multiStepNetPorosityZone::modifyddt(fvVectorMatrix& m) const
{
    const labelList& cells = mesh_.cellZones()[porosityZoneID_];
    const scalar coeff((1.0+addedMassCoeff_*(1-porosity_)/porosity_)/porosity_);
    forAll(cells, i)
    {
        m.diag()[cells[i]]   *= coeff;
        m.source()[cells[i]] *= coeff;
    }
}

Foam::tmp<Foam::fvVectorMatrix> 
Foam::multiStepNetPorosityZone::ddt(volScalarField& rho, volVectorField& U) const
{
    tmp<fvVectorMatrix> tres = fvm::ddt(rho,U);
    modifyddt(tres());
    return tres;
}
Could anyone help me with that?
chenghui62000 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
[OpenFOAM.org] Compiling OpenFOAM 5.0 on the Titan Supercomputer wildfire230 OpenFOAM Installation 20 May 6, 2020 07:30
Getting error both interpreting and compiling serene6390 Fluent UDF and Scheme Programming 1 October 27, 2017 00:49
All files present. but solver not compiling saddy OpenFOAM Programming & Development 1 July 29, 2017 09:50
[OpenFOAM.org] Trouble Compiling OpenFOAM-dev using Intel Compiler 15 for use on Xeon Phi foamer123 OpenFOAM Installation 9 August 20, 2015 14:03
Help with KIVA4 source code compiling geothokar Main CFD Forum 0 September 3, 2010 05:40


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