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

Dimensioned Tensor: having diagonal terms which are not predefined constant

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2015, 12:39
Default Dimensioned Tensor: having diagonal terms which are not predefined constant
  #1
Member
 
Paolo Capobianchi
Join Date: Sep 2014
Posts: 35
Rep Power: 11
pablitobass is on a distinguished road
Hello everyone,

I would like to ask if someone can tell me if it is possible to define a dimensionedSymmtensor having diagonal terms which are not predefined constant (variables, let say).

In practice I would like to know if it is possible to define an "object " like this:

Code:
    D_
    (
        dimensionedSymmTensor
        (
            "D",
            dimensionSet(0, 0, 0, 0, 0, 0, 0),
            symmTensor
            (
               D_.xx , 0, 0,
                    D_.yy, 0,
                        D_.zz                      
            )
        )
    ),
Furtherome, is it is possible to convert it in a "volTensorField"? I must to manipulate it with other objects that are defined in this manner.

Thank you very much in advance.

Regards,
Paolo
pablitobass is offline   Reply With Quote

Old   July 25, 2015, 12:11
Default
  #2
Member
 
Paolo Capobianchi
Join Date: Sep 2014
Posts: 35
Rep Power: 11
pablitobass is on a distinguished road
Hello,

I have just found another way to define the volumeTensorField
Code:
{    
    return tmp<Foam::volTensorField>
    (
        new volTensorField
        (
            IOobject
            (
                "D",
                localtimeName,
                *localmesh,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            *localmesh
        )
    );
}
It compile fine but I cannot define the diagonal tensor field I need. If I have understood correctly, by using the following operation: diag(T) give the diagonal of the matrix T, which is obviously a matrix as well. Since in my case D is a volTensorField, that operation is not allowed.

Furthermore, I have another tensor field A, and my goal is to obtain D as the diagonal of the field A.

Does anyone knows if there is a way around to get the diagonal of a tensor field?

Thanks

Paolo
pablitobass 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
why divergence occures in these cases immortality OpenFOAM Running, Solving & CFD 2 January 25, 2013 10:21
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 06:25
Really big problems when creating own materials da Jop FLUENT 0 June 28, 2007 11:15
constant and exotic source terms in NS eq Mika FLUENT 2 September 6, 2001 08:55


All times are GMT -4. The time now is 06:42.