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

error: no matching function for call to

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2018, 01:32
Default error: no matching function for call to
  #1
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Hi

I am trying to make a dual grid icoFoam solver in which Navier-Stokes is solved in one grid and temperature is solved in another grid.

I am defining my two regions similar to the concept of chtmultiRegionFoam. Now the solver need an interpolation function between two grids.

The solver.c I am showing below:

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.

OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.

Application
icoFoam

Description
Transient solver for incompressible, laminar flow of Newtonian fluids.

\*---------------------------------------------------------------------------*/

#include "fvCFD.H"
#include "regionProperties.H"
#include "pisoControl.H"
#include "meshToMesh0.H"
//#include "MapMeshes.H"
#include "IOobjectList.H"
#include "MapConsistentVolFields.H"
#include "UnMapped.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<template<class> class CombineOp>
void MapConsistentMesh
(
const Foam::IOobjectList& objects,
const fvMesh& meshSource,
const fvMesh& meshTarget,
const meshToMesh0:rder& mapOrder
)
{
// Create the interpolation scheme
meshToMesh0 meshToMesh0Interp(meshSource, meshTarget);

{
// Map volFields
// ~~~~~~~~~~~~~
MapConsistentVolFields<scalar>
(
objects,
meshToMesh0Interp,
mapOrder,
CombineOp<scalar>()
);
MapConsistentVolFields<vector>
(
objects,
meshToMesh0Interp,
mapOrder,
CombineOp<vector>()
);
}

{
// Search for list of target objects for this time
// IOobjectList objects(meshTarget, meshTarget.time().timeName());
//objects.add(U);
//objects.add(p);
//objects.add(T);
// Mark surfaceFields as unmapped
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UnMapped<surfaceScalarField>(objects);
UnMapped<surfaceVectorField>(objects);
UnMapped<surfaceSphericalTensorField>(objects);
UnMapped<surfaceSymmTensorField>(objects);
UnMapped<surfaceTensorField>(objects);

// Mark pointFields as unmapped
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UnMapped<pointScalarField>(objects);
UnMapped<pointVectorField>(objects);
UnMapped<pointSphericalTensorField>(objects);
UnMapped<pointSymmTensorField>(objects);
UnMapped<pointTensorField>(objects);
}

//mapLagrangiannew(meshToMesh0Interp);
}

int main(int argc, char *argv[])
{
#define NO_CONTROL
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"

#include "setRootCase.H"
#include "createTime.H"
#include "createMeshes.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "readSolidTimeControls.H"
#include "setInitialMultiRegionDeltaT.H"

meshToMesh0:rder mapOrder = meshToMesh0::INTERPOLATE;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nStarting time loop\n" << endl;

while (runTime.loop())
{
#include "readTimeControls.H"
#include "readSolidTimeControls.H"
#include "setMultiRegionDeltaT.H"
Info<< "Time = " << runTime.timeName() << nl << endl;

//#include "CourantNo.H" //?

forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
pisoControl piso(fluidRegions[i]);
#include "setRegionFluidFields.H"

// Momentum predictor

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);

if (piso.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

// --- PISO loop
while (piso.correct())
{
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::flux(HbyA)
+ fvc::interpolate(rAU)*fvc::ddtCorr(U, phi)
);

adjustPhi(phiHbyA, U, p);

// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAU);

// Non-orthogonal pressure corrector loop
while (piso.correctNonOrthogonal())
{
// Pressure corrector

fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);

pEqn.setReference(pRefCell, pRefValue);

pEqn.solve(fluidRegions[i].solver(p.select(piso.finalInnerIter())));

if (piso.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}
}

// #include "continuityErrs.H"

U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
//Interpolation from coarser to finer mesh
//MapConsistentMesh(fluidRegions[i], solidRegions[i], mapOrder);
// Create the interpolation scheme
meshToMesh0 meshToMesh0Interp(fluidRegions[i], solidRegions[i]);

Info<< nl
<< "Consistently creating and mapping fields for time "
<< fluidRegions[i].time().timeName() << nl << endl;

// Search for list of objects for this time
Foam::IOobjectList objects(fluidRegions[i], fluidRegions[i].time().timeName());
objects.add(U);
objects.add(p);
objects.add(T);
Info<< "object size" << objects.size()
<< endl;

MapConsistentMesh(objects, fluidRegions[i], solidRegions[i], mapOrder);

} //all fluid regions
//subtract= false;

forAll(solidRegions, i)
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
//add these lines...
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
);

TEqn.solve();
//done adding lines...

//Interpolation from finer to coarser mesh
//MapConsistentMesh(solidRegions[i], fluidRegions[i], mapOrder);
} //all solid regions


runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return 0;
}


// ************************************************** *********************** //

I have highlighted the point where I am facing the problem. The error I am getting is error: no matching function for call to ‘MapConsistentMesh(Foam::IOobjectList&, Foam::fvMesh&, Foam::fvMesh&, Foam::meshToMesh0:rder&)’.

I am not getting what could be the reason for the error.

Can any one suggest something. It will be deeply appreciated.

Thanks
kk415 is offline   Reply With Quote

Old   June 6, 2018, 07:07
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!
The reason for that is simply you don't have this function. At least not with these arguments.
I only found in doxygen this:
MapConsistentMesh (const fvMesh &meshSource, const fvMesh &meshTarget, const meshToMesh0:rder &mapOrder)
( https://cpp.openfoam.org/v5/MapMeshes_8H_source.html )

So there is no IOobjectList for the first argument. Only (mesh source, target, mapOrder).
simrego is offline   Reply With Quote

Old   June 7, 2018, 00:43
Default
  #3
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Quote:
Originally Posted by simrego View Post
Hi!
The reason for that is simply you don't have this function. At least not with these arguments.
I only found in doxygen this:
MapConsistentMesh (const fvMesh &meshSource, const fvMesh &meshTarget, const meshToMesh0:rder &mapOrder)
( https://cpp.openfoam.org/v5/MapMeshes_8H_source.html )

So there is no IOobjectList for the first argument. Only (mesh source, target, mapOrder).
Yes but I want to modify that function for my requirement and I defined this new function before the main function in the code shown before. So what is wrong in that definition
kk415 is offline   Reply With Quote

Old   June 7, 2018, 03:31
Default
  #4
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
It is because the template line above the MapConsistentMesh function.

template<template<class> class CombineOp>

How does it works ? Any tutorials to understand that?
kk415 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
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
Elements that limit the Courant number skabilan OpenFOAM Running, Solving & CFD 9 July 3, 2008 12:07
No matching function multiplying tensors for BC Erik OpenFOAM 3 March 20, 2008 13:05
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


All times are GMT -4. The time now is 09:47.