CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Tensor list in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-programming-development/257872-tensor-list-openfoam.html)

mat_brain September 24, 2024 15:59

Tensor list in OpenFOAM
 
Hello guys, i defined a variable k as a tensor, where ∇k∇T = 0, like this:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  11
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      volTensorField;
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 1 -3 -1 0 0 0];

internalField  nonuniform List<tensor>
8
(
    tensor(7 0 0  0 7 0  0 0 7)
    tensor(3 0 0  0 3 0  0 0 3)
    tensor(3 0 0  0 3 0  0 0 3)
    tensor(7 0 0  0 7 0  0 0 7)
    tensor(3 0 0  0 3 0  0 0 3)
    tensor(7 0 0  0 7 0  0 0 7)
    tensor(7 0 0  0 7 0  0 0 7)
    tensor(3 0 0  0 3 0  0 0 3)
);

But it's giving me an error, what am i doing wrong?
The error:
Code:

--> FOAM FATAL IO ERROR:
Expected a '(' while reading VectorSpace<Form, Cmpt, Ncmpts>, found on line 22 the word 'tensor(7'

file: /home/.../k at line 22.

    From function Foam::Istream& Foam::Istream::readBegin(const char*)
    in file db/IOstreams/IOstreams/Istream.C at line 92.



All times are GMT -4. The time now is 08:23.