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

Tensor Definition in openfoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By wouter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2016, 13:25
Post Tensor Definition in openfoam
  #1
Member
 
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0
13msmemusman is on a distinguished road
Hi guys i am sorry i feel low while asking this question. I need to define a tensor in openfoam. I just did simple thing i copied following code fro programmers guide and pasted in my solver

dimensionedTensor sigma
(
"sigma",
dimensionSet(1, -1, -2, 0, 0, 0, 0),
tensor(1e6,0,0,0,1e6,0,0,0,1e6),
);


but it gives following error

In function ‘int main(int, char**)’:
stability.C:217:1: error: expected primary-expression before ‘)’ token
);
^
In file included from stability.C:63:0:


What can be the matter... it is the simplest case.....
13msmemusman is offline   Reply With Quote

Old   March 23, 2016, 16:24
Default
  #2
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
hello 13msmemusman
maybe the , at the end of the line starting with tensor:
tensor(1e6,0,0,0,1e6,0,0,0,1e6),
hope this helps
Wouter
13msmemusman likes this.
wouter is offline   Reply With Quote

Old   March 24, 2016, 13:45
Default
  #3
Member
 
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0
13msmemusman is on a distinguished road
thank you sir please guide me about this

Hi i added following codes in a solver.

Ixz = sum((mesh.C().component(0))*(mesh.C().component(2) )*(rho*mesh.V()));

I set Ixx dimensions as

dimensionSet( 1, 2, 0, 0, 0, 0, 0)


Whenever i run solver i get following error

FOAM FATAL ERROR:
Different dimensions for =
dimensions : [1 2 0 0 0 0 0] = [0 0 0 0 0 0 0]


I can not find why its happening. mesh.C() has a dimension of meter when summed up and rho*mesh.V() has a dimension of kg when summed up. it should have dimensions same as dimensions of Ixx. Please tell me some method to deal with it.
13msmemusman is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
OpenFOAM Foundation releases OpenFOAM® 3.0.0 CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 1 November 7, 2015 16:16
OpenFOAM Foundation Releases OpenFOAM v2.3.0 opencfd OpenFOAM Announcements from OpenFOAM Foundation 3 December 23, 2014 04:43
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


All times are GMT -4. The time now is 11:04.