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

argument deduction/substitution failed when calling fvc::ddt

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2019, 13:51
Question argument deduction/substitution failed when calling fvc::ddt
  #1
New Member
 
Yu Zhang
Join Date: May 2019
Posts: 1
Rep Power: 0
Zhangyy is on a distinguished road
Hi,
I am trying to compute the residual of kEqn given the data for U, k and Reynold stress. So, I modified the original kEqn:
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(alpha, rho, k_)
+ fvm::div(alphaRhoPhi, k_)
- fvm::laplacian(alpha*rho*DkEff(F1), k_)
==
alpha()*rho()*Pk(G)
- fvm::SuSp((2.0/3.0)*alpha()*rho()*divU, k_)
- fvm::Sp(alpha()*rho()*epsilonByk(F1, F23), k_)
+ kSource()
+ fvOptions(alpha, rho, k_)
);
to
kResidual_ = fvc::ddt(alpha, rho, k_)
+ fvc::div(alphaRhoPhi, k_)
- fvc::laplacian(alpha*rho*DkEff(F1), k_)
- alpha()*rho()*Pk(G)
+ fvc::SuSp((2.0/3.0)*alpha()*rho()*divU, k_)
+ fvc::Sp(alpha()*rho()*epsilonByk(F1, F23), k_)
- kSource()
- fvOptions(alpha, rho, k_);

Here, I changed all the fvm to fvc, as kResidual should be calculated explicitly.
However, it complains that
" template argument deduction/substitution failed:
cannot convert ‘alpha’ (type ‘const alphaField {aka const Foam::geometricOneField}’) to type ‘const volScalarField& {aka const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&}’ "

I looked at the definition of function fvcDdt in ddtScheme.C, which is
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh>> ddtScheme<Type>::fvcDdt
(
const volScalarField& alpha,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
NotImplemented;

return tmp<GeometricField<Type, fvPatchField, volMesh>>
(
GeometricField<Type, fvPatchField, volMesh>::null()
);
}

The type of alpha is indeed inconsistent with that in kEqn. In fact, I have the same problems when calling fvc::SuSp and fvc::Sp.
I also found that the function fvmDdt has the same argument declarations:

template<class Type>
tmp<fvMatrix<Type>> ddtScheme<Type>::fvmDdt
(
const volScalarField& alpha,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
NotImplemented;

return tmp<fvMatrix<Type>>
(
new fvMatrix<Type>
(
vf,
alpha.dimensions()*rho.dimensions()
*vf.dimensions()*dimVol/dimTime
)
);
}

My question is
1) How can I fix this problem?
2) Why there is no error occurring when calling fvm::ddt?

Thanks,
ZhangYY

Last edited by Zhangyy; May 8, 2019 at 13:54. Reason: make the question more clear
Zhangyy is offline   Reply With Quote

Reply

Tags
fvc::ddt(), openfoam 6, programing


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
Foam::error::printStack(Foam::Ostream&) with simpleFoam -parallel U.Golling OpenFOAM Running, Solving & CFD 52 September 23, 2023 04:35
Initial conditions for uniform flow andreas OpenFOAM 5 November 16, 2012 16:00
[OpenFOAM] ParaView/Parafoam error when making animation Disco_Caine ParaView 6 September 28, 2010 10:54
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31
user defined function cfduser CFX 0 April 29, 2006 11:58


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