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

May I know more about tensor calculation?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2011, 14:53
Default May I know more about tensor calculation?
  #1
New Member
 
yafuji aki
Join Date: Jul 2010
Location: Japan
Posts: 14
Rep Power: 15
aki_yafuji is on a distinguished road
Hello, everyone!

How do I calculate partial derivative dA/dx (= (dAxx/dx, dAxy/dx, dAxz/dx, dAyy/dx, dAyz/dx, dAzz/dx)) of a symmetric tensor A (= (Axx, Axy, Axz, Ayy, Ayz, Azz))?
I tried to use "grad(A)" but failed. I am at a loss of what to do...
If anyone has information concerning this, please let me know!

Sincerely yours

aki
aki_yafuji is offline   Reply With Quote

Old   July 4, 2011, 03:05
Default
  #2
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
Hi Aki,

fvc::grad(A) should do the trick

Best

Kathrin
kathrin_kissling is offline   Reply With Quote

Old   July 4, 2011, 23:51
Default
  #3
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Kathrin,

I don't think that would work... The gradient of a tensor would contain 27 components, which Foam doesn't cater for at the moment. It can be done, just that the templates need to be instantiated, but that wouldn't be trivial.

Cheers,
Sandeep
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   July 5, 2011, 03:05
Default
  #4
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
Sandeep,

you are totally right. I overlooked A being a tensor. I feel a little embarrassed about it.

Thank you for letting me know!

Aki,

for what do you need this?
Do you just need the single components?

Best Kathrin
kathrin_kissling is offline   Reply With Quote

Old   July 5, 2011, 14:53
Default
  #5
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
A simple workaround would be to store the gradient of each row of the tensor as another tensor, and manipulating that as necessary.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   July 6, 2011, 03:33
Default
  #6
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
A not so simple way would be to use the VectorN library, which would make possible to have this huge tensor as a whole and add the fvc::grad for this special case. But for me it seems to be overengineered, as least as long as Aki doesn't need the complete tensor.
The question really is for what it is needed...
kathrin_kissling 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



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