CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   customized densityBasedTurbo compilation error in FE4.0 (https://www.cfd-online.com/Forums/openfoam/223551-customized-densitybasedturbo-compilation-error-fe4-0-a.html)

BSengupta January 15, 2020 22:17

customized densityBasedTurbo compilation error in FE4.0
 
Hi Foamers,


I am trying to write some code by modifying densityBasedTurbo in foam extend 4. I am getting the following error:

************************************************** ************************************************** *************************
BSTurboFoam.C:127:25: error: passing ‘const surfaceVectorField {aka const Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ as ‘this’ argument discards qualifiers [-fpermissive]
dbnsFlux.dotX() = mrfZones.faceU();

************************************************** ************************************************** ************************
In BSTurboFoam.C : dbnsFlux.dotX() = mrfZones.faceU();

************************************************** ************************************************** ************************
In numericFlux.C:

template<class Flux, class Limiter>
Foam::numericFlux<Flux, Limiter>::numericFlux
(
const volScalarField& p,
const volVectorField& U,
const volScalarField& T,
basicThermo& thermo
)
:
numericFluxBase<Flux>(p.mesh()),
p_(p),
U_(U),
T_(T),
thermo_(thermo),
rhoFlux_
(
....
),
rhoUFlux_
(
...
),
rhoEFlux_
(
...
),
dotX_
(
IOobject
(
"dotX",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedVector("zero", dimVelocity, vector::zero)
)

{}

************************************************** ************************************************** *************************

In MRFZone.C :
void Foam::MRFZone::faceU
(
surfaceVectorField& zoneFaceU
) const
{
...
}

************************************************** ************************************************** *************************
In MRFZones.C :
Foam::tmp<Foam::surfaceVectorField> Foam::MRFZones::faceU() const
{
tmp<surfaceVectorField> tMRFZonesFaceU
(
new surfaceVectorField
(
...
)
);
surfaceVectorField& MRFZonesFaceU = tMRFZonesFaceU();

forAll(*this, i)
{
operator[](i).faceU(MRFZonesFaceU);
}

return tMRFZonesFaceU;
}


I shall be greatly helped if the error gets resolved and can proceed further. Thanks a lot for your time.


Bidesh

BSengupta January 20, 2020 20:42

Any help please...


All times are GMT -4. The time now is 15:46.