|
[Sponsors] |
argument deduction/substitution failed when calling fvc::ddt |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 8, 2019, 13:51 |
argument deduction/substitution failed when calling fvc::ddt
|
#1 |
New Member
Yu Zhang
Join Date: May 2019
Posts: 1
Rep Power: 0 |
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 |
|
Tags |
fvc::ddt(), openfoam 6, programing |
|
|
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 |