CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Electromagnetics (https://www.cfd-online.com/Forums/electromagnetics/)
-   -   I'm having the "error: no matching function.." when compiling a modified mhdFoam (https://www.cfd-online.com/Forums/electromagnetics/228416-im-having-error-no-matching-function-when-compiling-modified-mhdfoam.html)

kevi June 30, 2020 21:10

I'm having the "error: no matching function.." when compiling a modified mhdFoam
 
I'm adding the mass conservation equation to the mhdFoam solver because I want to do a simulation of the ideal 1-fluid mhd case. For that I also defined the rho in the createfields field, I researched this error and found that first argument should always be flux as surface field. But even so I could not tackle the cause of the error I am facing, I am new to opemFoam, if anyone knows how to help me I would be very grateful.

I am using Ubuntu 20.0 and the latest version of OpemFoam.
I added this lines below the piso loop in mhdFoam.c:
Quote:

// defining the time derivative of rho, continuity equation
fvScalarMatrix Cnt (fvm::ddt(rho) + fvm::div(1.0,rho*U));

// end also with ...div(phi,rho*U))
// solving the continuity equation
Cnt.solve();

I added this lines in creatFields.c:
Quote:

Info<< "Reading field rho\n" << endl; //I added the temporal dependence for rho
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

error:

Quote:

error: no matching function for call to ‘div(Foam::surfaceScalarField&, Foam::tmp<Foam::GeometricField<Foam::Vector<double >, Foam::fvPatchField, Foam::volMesh> >)’
136 | fvScalarMatrix Cnt (fvm::ddt(rho) + fvm::div(phi,rho*U));


All times are GMT -4. The time now is 07:25.