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

3D tensorField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2011, 07:21
Default 3D tensorField
  #1
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Hello,

I would need a field where I can store a fieldField<Field, tensor> at every position in the field. Is this possible to do in a smart way in OpenFoam? If not, does anyone know how it can be done in C++ in a rel. simple way?

Regards
/NW
nikwin is offline   Reply With Quote

Old   January 19, 2011, 11:52
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
hi Niklas,

you can use volTensorField :

Code:
volTensorField T
(
    IOobject
    (
        "T",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    mesh,
dimensionedTensor("T",dimensionSet(-1,3,1,0,0),tensor::zero)
);
Regards,
Cyp
Cyp is offline   Reply With Quote

Old   January 20, 2011, 07:25
Default
  #3
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Clumsy of me saying I needed a 3D tensorField. What I needed is a matrix to store tensor variables in with 3dimensions. A standard matrix or the FieldField-class gives the oppurtunity to store data in 2dimensions of e.g. the type tensor.

I solved my issue by storing the data in a larger list, which works but makes the indexing more complex.

Anyway, Thank for your reply, Cyp!
/NW
nikwin 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
Laplacian of a TensorField ? T.D. OpenFOAM Running, Solving & CFD 6 September 23, 2010 12:40


All times are GMT -4. The time now is 15:47.