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

Transform volSymmTensorField to volTensorField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2022, 05:30
Default Transform volSymmTensorField to volTensorField
  #1
New Member
 
Sean
Join Date: Apr 2022
Posts: 5
Rep Power: 4
DataDriven is on a distinguished road
Hi!

I'm working on a customized turbulence model in OF7. Somewhere in the calculations I have to add volSymmTensorField and volTensorField which I can't figure out.

On the forum I've seen one post about this, where it was suggested to multiply the volSymmTensorfield with tensor(1, 0, 0, 0, 1, 0, 0, 0, 1) if the computational overhead was not that important, which it isn't since they are very small 2D cases. See below:
Code:
  tauij_ = -2*nut() * S & tensor(1, 0, 0, 0, 1, 0, 0, 0, 1);
This is only part of the expression, later another volTensorField must be added, but this is already not allowed because S is symmetric and tauij is not.



The error message is:

Code:
 no match for ‘operator=’ (operand types are ‘Foam::volTensorField 
 {aka Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, 

Foam::volMesh>}’ and‘Foam::tmp<Foam::DimensionedField<Foam::SymmTensor<double>, 

Foam::volMesh> >’)

       tauij_ = -2*nut() * S & I
Another solution was to define a volTensorField and then set each individual component from the volSymmTensorField as below. But that's ugly and also I'm unsure whether indexing starts at 1 (I think the programmersGuide implies it starts at 1).

Code:
S.component(1) =  S_symm.component(1);
S.component(2) =  S_symm.component(2);
S.component(3) =  S_symm.component(3);
   
S.component(4) =  S_symm.component(2);
S.component(5) =  S_symm.component(4);
S.component(6) =  S_symm.component(5);
  
S.component(7) =  S_symm.component(3);
S.component(8) =  S_symm.component(5);
S.component(9) =  S_symm.component(6);
Can anybody help me with the proper transformation of a volSymmTensorField to volTensorField? Thank you in advance.



PS: these are the same right?

Code:
I = tensor(1, 0, 0, 0, 1, 0, 0, 0, 1)
DataDriven is offline   Reply With Quote

Old   April 22, 2022, 07:21
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi,


could you provide the equation you want to add in OpenFOAM? Maybe it is possible to find a way to implement it.
agustinvo is offline   Reply With Quote

Reply

Tags
programing, transformation tensor, volsymmtensorfield, voltensorfield


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
eigenValues of volTensorField xuegy OpenFOAM Programming & Development 8 February 26, 2021 16:46
create volTensorField in rhoCentralFoam SKLee OpenFOAM Running, Solving & CFD 1 December 30, 2012 03:36
flux limiter involving tensor : How to use fvc::flux() with volTensorField ? Cyp OpenFOAM Programming & Development 2 January 21, 2011 04:36
Transformation of volSymmTensorField to volTensorField svens OpenFOAM 2 November 19, 2009 05:47
Question on Hilbert Transform Wen Long Main CFD Forum 1 April 29, 2004 05:58


All times are GMT -4. The time now is 02:14.