|
[Sponsors] |
November 19, 2020, 12:41 |
Why can't I multiply these two tensors?
|
#1 |
New Member
Join Date: Sep 2019
Posts: 17
Rep Power: 7 |
I am simply trying to multiply the strain rate tensor by the rotation rate tensor:
Code:
volSymmTensorField S //Mean strain rate ( IOobject ( "S", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedSymmTensor("S",dimensionSet(0,0,-1,0,0,0,0),symmTensor::zero) ); volTensorField R //Mean rotation rate ( IOobject ( "R", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedTensor("R",dimensionSet(0,0,-1,0,0,0,0),tensor::zero) ); volTensorField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedTensor("T",dimensionSet(0,0,-2,0,0,0,0),tensor::zero) ); ... S = symm(fvc::grad(U)); R = skew(fvc::grad(U)); T = S * R; Code:
n file included from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/doubleFloat.H:33, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/floatScalar.H:42, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/scalar.H:42, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/zeroI.H:30, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/zero.H:157, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/UList.H:51, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/List.H:46, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/labelList.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/UPstream.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/Pstream.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/parRun.H:39, from /usr/lib/openfoam/openfoam2006/src/finiteVolume/lnInclude/fvCFD.H:4, from tbnnFoam.C:66: /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/products.H: In instantiation of ‘class Foam::outerProduct<Foam::SymmTensor<double>, Foam::Tensor<double> >’: /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/GeometricFieldFunctions.C:952:1: required by substitution of ‘template<class Type1, class Type2, template<class> class PatchField, class GeoMesh> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Type1, Type2>::type, PatchField, GeoMesh> > Foam::operator*(const Foam::GeometricField<TypeR, PatchField, GeoMesh>&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Type1 = Foam::SymmTensor<double>; Type2 = Foam::Tensor<double>; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]’ tbnnFoam.C:129:11: required from here /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/products.H:114:13: error: no type named ‘type’ in ‘class Foam::typeOfRank<double, 4>’ 114 | >::type type; | ^~~~ tbnnFoam.C: In function ‘int main(int, char**)’: tbnnFoam.C:129:9: error: no match for ‘operator*’ (operand types are ‘Foam::volSymmTensorField’ {aka ‘Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>’} and ‘Foam::volTensorField’ {aka ‘Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>’}) 129 | T = S * R; | ~ ^ ~ | | | | | GeometricField<Foam::Tensor<double>,[...],[...]> | GeometricField<Foam::SymmTensor<double>,[...],[...]> In file included from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/zero.H:157, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/UList.H:51, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/List.H:46, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/labelList.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/UPstream.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/Pstream.H:45, from /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/parRun.H:39, from /usr/lib/openfoam/openfoam2006/src/finiteVolume/lnInclude/fvCFD.H:4, from tbnnFoam.C:66: |
|
November 19, 2020, 15:02 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hi,
Could you please open a ticket in https://develop.openfoam.com/Development/openfoam ? As a workaround, could you please try to set the type of `S` as `volTensorField`?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
Pressure instability with rhoSimpleFoam | daniel_mills | OpenFOAM Running, Solving & CFD | 44 | February 17, 2011 18:08 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 0 | March 10, 2009 23:07 |
Courant no%23 and sharp corner in 3D | jam | OpenFOAM Running, Solving & CFD | 6 | November 18, 2008 09:21 |