|
[Sponsors] |
January 31, 2013, 07:49 |
Divergence of a volTensorField
|
#1 |
New Member
|
I am a physicist trying to write an OpenFOAM solver for a computational spin dynamics problem. I am getting a compiler error at the line where I attempt to take the divergence of a volTensorField times a surfaceScalarField. Here is a simplified version of the code:
#include "fvCFD.H" int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMeshNoClear.H" #include "initContinuityErrs.H" /* * Create: * volVectorField M * volVectorField Omega * surfaceScalarField Deff */ #include "createFields.H" while (runTime.loop()) { volTensorField Gamma(fvc::grad(M)); // The following line gives this compilation error: // error: no matching function for call to // ‘Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField,Foam::volMesh>:: // GeometricField(Foam::tmp<Foam::fvMatrix<Foam::Tens or<double> > >)’ volVectorField foo(fvm::div(Deff, Gamma)); } return 0; } The exact error message is this: forum.cpp:35:49: error: no matching function for call to ‘Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::tmp<Foam::fvM atrix<Foam::Tensor<double> > >)’ I expected that the compiler would match the above code with the following declaration from fvmDiv.H : template<class Type> tmp<fvMatrix<Type> > div ( const surfaceScalarField&, const GeometricField<Type, fvPatchField, volMesh>& ); Compiler /OS info: g++ (SUSE Linux 12.2) 4.7.1 20120723 [gcc-4_7-branch revision 189773] Any advice would be appreciated. Dean Last edited by SpinDoctor; January 31, 2013 at 08:14. Reason: Forgot compiler version |
|
Tags |
solver, spin dynamics, tensor |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF divergence of a vector | cris | FLUENT | 3 | September 4, 2014 19:06 |
Divergence problem for species transport model | MY | FLUENT | 3 | January 11, 2014 05:46 |
Quarter Burner mesh with periosic condition | SamCanuck | FLUENT | 2 | August 31, 2011 12:34 |
flux limiter involving tensor : How to use fvc::flux() with volTensorField ? | Cyp | OpenFOAM Programming & Development | 2 | January 21, 2011 05:36 |
divergence in MAC Method | Maciej Matyka | Main CFD Forum | 2 | December 19, 2000 11:43 |