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

Divergence of a volTensorField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2013, 06:49
Default Divergence of a volTensorField
  #1
New Member
 
Dean Hawthorne
Join Date: Jan 2013
Location: Ithaca
Posts: 1
Rep Power: 0
SpinDoctor is on a distinguished road
Send a message via Skype™ to SpinDoctor
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 07:14. Reason: Forgot compiler version
SpinDoctor is offline   Reply With Quote

Reply

Tags
solver, spin dynamics, tensor


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
UDF divergence of a vector cris FLUENT 3 September 4, 2014 18:06
Divergence problem for species transport model MY FLUENT 3 January 11, 2014 04:46
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 11:34
flux limiter involving tensor : How to use fvc::flux() with volTensorField ? Cyp OpenFOAM Programming & Development 2 January 21, 2011 04:36
divergence in MAC Method Maciej Matyka Main CFD Forum 2 December 19, 2000 10:43


All times are GMT -4. The time now is 03:18.