|
[Sponsors] |
No matching function for call to "FOAM::GeometricField<double, FOAM::fvPatchField, >" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2021, 03:52 |
No matching function for call to "FOAM::GeometricField<double, FOAM::fvPatchField, >"
|
#1 |
New Member
Teresa Sun
Join Date: Jun 2021
Posts: 21
Rep Power: 5 |
Dear Foamers,
This issues happen while building a new eddy viscosity model which is based on Smagorinsky model. Error messages Code:
../turbulenceModels/lnInclude/QR.C:91:10: error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField()’ 91 | 0; | ^ In file included from /software/software/OpenFOAM/v2006-foss-2020a/OpenFOAM-v2006/src/OpenFOAM/lnInclude/GeometricField.H:792, from /software/software/OpenFOAM/v2006-foss-2020a/OpenFOAM-v2006/src/OpenFOAM/lnInclude/GeometricScalarField.H:40, from /software/software/OpenFOAM/v2006-foss-2020a/OpenFOAM-v2006/src/OpenFOAM/lnInclude/GeometricFields.H:40, from /software/software/OpenFOAM/v2006-foss-2020a/OpenFOAM-v2006/src/finiteVolume/lnInclude/volFields.H:39, from /software/software/OpenFOAM/v2006-foss-2020a/OpenFOAM-v2006/src/finiteVolume/lnInclude/nearWallDist.H:41, from ../turbulenceModels/lnInclude/turbulenceModel.H:49, from ../turbulenceModels/lnInclude/TurbulenceModel.H:40, from lnInclude/IncompressibleTurbulenceModel.H:42, from turbulentTransportModels/turbulentTransportModels.H:28, from turbulentTransportModels/turbulentTransportModels.C:28: The modified codes are Code:
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template<class BasicTurbulenceModel> tmp<volScalarField> QR<BasicTurbulenceModel>::k ( const tmp<volTensorField>& gradU ) const { volSymmTensorField D(symm(gradU)); volScalarField q1(dimensionedScalar("q1", dimensionSet(0, 0, -2, 0, 0, 0, 0), 1e-5)); // volScalarField k1(dimensionedScalar("k1", dimensionSet(0, 0, -1, 0, 0, 0, 0), 0)); volScalarField r(max(-det(D),dimensionedScalar("r1", dimensionSet(0, 0, -3, 0, 0, 0, 0), 0))); volScalarField q((1.0/2.0)*(dev(D) && D)); // if ( q <= (dimensionedScalar("q1", dimensionSet(0, 0, -2, 0, 0, 0, 0), 1e-6))) if ( q <= q1 ) { return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), // dimensionedScalar ("k",dimensionSet(0, 0, -1, 0, 0, 0, 0), 0); // this->k = k1; 0; ) ); } return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), mag(r)/q; ) ); } Any pointer would be great appreciated! Teresa |
|
December 14, 2021, 13:10 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
That's the problem when you stare at code too long. You have an ';' in your creation of tmp<volScalarField>. The flood of compiler errors doesn't really help with finding it. |
||
December 14, 2021, 13:17 |
|
#3 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
[QUOTE=Teresa Sun;818460]
Code:
return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), mag(r)/q; ) ); For that type of code it can be a bit clearer if you use the forwarding factory method instead. Eg, Code:
return tmp<volScalarField>::New ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), mag(r)/q ); |
|
December 16, 2021, 09:44 |
|
#4 | ||
New Member
Teresa Sun
Join Date: Jun 2021
Posts: 21
Rep Power: 5 |
Hi Mark,
thanks for your correction and will change the layout later. The mistake was way too straightforward. But after correcting the issue is as same as before. Is that because something went wrong about the conversion between dimensioedScalar and volScalarField? The is issue Quote:
Quote:
|
|||
December 16, 2021, 10:58 |
|
#5 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Not really the problem. At this point you really need to check how the fields are defined, which arguments are expected etc. Either in the header or here: https://www.openfoam.com/documentati...d.html#details See which constructors are available and pick the one that you think you are using. In your current case you will notice that you are trying something, but not really sure what. |
||
Tags |
dimensionedscalar, eddy viscosity model, les, volscalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
Elementwise multiplication operator | johndeas | OpenFOAM Running, Solving & CFD | 3 | March 9, 2019 14:03 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
Running UDF with Supercomputer | roi247 | FLUENT | 4 | October 15, 2015 14:41 |
A stupid question | luckyluke | OpenFOAM Running, Solving & CFD | 14 | August 13, 2007 05:25 |