June 30, 2020, 22:10
|
I'm having the "error: no matching function.." when compiling a modified mhdFoam
|
#1
|
New Member
Kevi Pegoraro
Join Date: Jun 2020
Posts: 1
Rep Power: 0
|
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));
|
|
|
|