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

double dot tensor product (double inner product) implementation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2011, 08:55
Default double dot tensor product (double inner product) implementation
  #1
New Member
 
clément
Join Date: May 2011
Posts: 4
Rep Power: 15
yogzebul is on a distinguished road
[RESOLVED]

Hello,

I'm trying to solve energy equation using a modified icoFoam solver.
I would like to take into account viscous dissipations in energy equation and to do that I need to calculate the double inner product between the viscous stress tensor and gradient of velocity.
I tried this:
Code:
//tensors computation
volTensorField gradU = fvc::grad(U);
volTensorField tau = nu * (gradU + gradU.T());

//solve the steady-state energy equation in temperature.
solve ( rho * Cp * fvm::div(phi, T) - fvm::laplacian(ka, T) - (tau && gradU));
but it doesn't compile leading to the error :
Code:
error: no match for ‘operator-’ in ‘Foam::operator-(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = Foam::Vector<double>](((const Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >&)((const Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >*)(& Foam::fvm::laplacian(const Foam::dimensioned<Type2>&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::Vector<double>, GType = double](((Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&)(& T)))))))
- Foam::operator&&(const Foam::GeometricField<TypeR, PatchField, GeoMesh>&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Type1 = Foam::Tensor<double>, Type2 = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&)((const Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>*)(& gradU))))’
When I remove the term
Code:
- (tau && gradU)
of the formlation, the solver compiles perfectely...

So it's seems to be the double dot product implementation which doesn't work...

Any ideas ? (I use OpenFoam1.7.1)

Thanks in advance

Clément

Last edited by yogzebul; July 28, 2011 at 12:32.
yogzebul is offline   Reply With Quote

Old   July 28, 2011, 10:48
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Hi,
just a suggestion but I not sure it works:
Quote:
volScalarField source = (tau && gradU);
solve ( rho * Cp * fvm::div(phi, T) - fvm::laplacian(ka, T) - source);
Amir is offline   Reply With Quote

Old   July 28, 2011, 12:28
Default
  #3
New Member
 
clément
Join Date: May 2011
Posts: 4
Rep Power: 15
yogzebul is on a distinguished road
Thank you Amir,

I understood my mistake !
T was declared as a vector field in my createField.H !

I don't understand anymore why it successed to compile without the inner product term. Although laplacian can be a vector field, I believed that the divergence one cannot...
Maybe the divergence of a tensor field is a vector field ?

Anyway, that's working perfectly now.
Bye
yogzebul is offline   Reply With Quote

Reply


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
Continuing User Defined Real Gas Model issues aeroman FLUENT 6 April 8, 2016 04:34
New densitybased solver AeroFoam giulio_romanelli OpenFOAM Running, Solving & CFD 48 January 15, 2016 09:20
Parallel User Defined Real Gas Model aeroman FLUENT 4 July 1, 2015 07:09
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


All times are GMT -4. The time now is 00:16.