|
[Sponsors] |
October 16, 2019, 13:52 |
error with compiling
|
#1 |
New Member
hui cheng
Join Date: Jul 2017
Posts: 4
Rep Power: 9 |
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; } |
|
|
|
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 08:30 |
Getting error both interpreting and compiling | serene6390 | Fluent UDF and Scheme Programming | 1 | October 27, 2017 01:49 |
All files present. but solver not compiling | saddy | OpenFOAM Programming & Development | 1 | July 29, 2017 10:50 |
[OpenFOAM.org] Trouble Compiling OpenFOAM-dev using Intel Compiler 15 for use on Xeon Phi | foamer123 | OpenFOAM Installation | 9 | August 20, 2015 15:03 |
Help with KIVA4 source code compiling | geothokar | Main CFD Forum | 0 | September 3, 2010 06:40 |