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

Tensor operation scale

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2007, 12:49
Default In programmer's guide: c_i =
  #1
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
In programmer's guide:
c_i = scale(a, b) = (a1*b1, a2*b2, a3*b3)

I'm looking for a similar operation but with division operators.

scalediv(a, b) = (a1/b1, a2/b2, a3/b3). Is there a function to do that? or I have to write a one? I intend to use it on 2 volVectorFields Thanks.

Best regards,
Maka
maka is offline   Reply With Quote

Old   August 22, 2007, 12:57
Default I needed this in my developmen
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
I needed this in my development stuff a while back and it's been added to my development version. It's called invScale.

I would recommend thinking carefully if you really need it or not. If you do, you can grep and search because for proper functionality it needs to be added in 4-5 places.

Good luck,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 22, 2007, 15:21
Default I do not know how complicated
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
I do not know how complicated is your case, but can't you simply make d_i = 1/b_i and then a_i * d_i ?
paka is offline   Reply With Quote

Old   August 23, 2007, 06:41
Default Thanks Hrv, I will try it. @
  #4
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Thanks Hrv, I will try it.
@Krystian: the operation of scalar division is defined as tensor/scalar but not the opposite. As a result 1/tensor will give a compilation error.

Best regards,
Maka.
maka is offline   Reply With Quote

Old   August 23, 2007, 07:06
Default Which is exactly what it shoul
  #5
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
Which is exactly what it should do. What do you mean by 1/tensor? The operation is not mathematically defined. You could ask for the inverse of the tensor, of course, but is that what you mean?

For that matter, scaling one vector by another component-wise probably is mathematically a bit dodgy as well. If you are looking for a transformation of the vector by different amounts in each direction, once again this would be a tensor operation.

Gavin
grtabor is offline   Reply With Quote

Old   August 23, 2007, 09:52
Default The operation of devision is n
  #6
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
The operation of devision is not defined for vector (example of a tensor) because it only has a meaning when they are parallel. But here what I'm after is not an legitimate operation on vector or tensor. I need a scaling FUNCTION, that can take on vector field and scale it by another vector field (element by element scalar division). Assume you have two terms in an equation and you explicitly want to see how they wait relative to each other during run time. Then you will not Hrv's invScale function. That was exactly my situation. Thanks Gavin and Krystian for your comments. Please feel free to criticize the need that I explained. At the moment, I'm recompiling after I added Hrv's function. Thanks for your help.

Best regards,
Maka.
maka is offline   Reply With Quote

Old   November 11, 2008, 13:57
Default If we have an equation: s*T1=
  #7
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
If we have an equation:
s*T1=T2; where s is unknown scalar; T1 and T2 is two tensors; How can we calculate s by well defined mathematical operation?

s=T2/T1; is not mathematically defined. Thanks.
maka is offline   Reply With Quote

Old   November 11, 2008, 14:07
Default I think it should be: s*T1*
  #8
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
I think it should be:

s*T1*inv(T1)= s*I=T2*inv(T1);

Then we know X=s*I;
s=sqrt(mag(X)/n); where n is the number of diagonal elements of the tensor I;

is that correct? Thanks.
maka is offline   Reply With Quote

Old   November 20, 2008, 08:43
Default I think it is: s=tr(T2 & in
  #9
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
I think it is:

s=tr(T2 & inv(T1))/3;
maka is offline   Reply With Quote

Old   September 11, 2012, 03:36
Default
  #10
New Member
 
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 14
mscheng is on a distinguished road
where can I find invScale function?
mscheng is offline   Reply With Quote

Old   October 10, 2013, 21:27
Default
  #11
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 848
Rep Power: 18
sharonyue is on a distinguished road
Anyone knows where can I find this scale function's header?
sharonyue 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
Dimension problem with operation scale booz OpenFOAM Pre-Processing 0 October 10, 2008 04:57
Large Scale Model:Small scale computer gull COMSOL 0 March 5, 2007 07:37
scale or full scale justin FLUENT 1 August 4, 2006 23:00
relation b/n Kolomogorov scale and Taylor scale hanman Main CFD Forum 0 February 28, 2006 05:16
Convert color-scale pictures to gray-scale ones XC FLUENT 4 March 29, 2005 19:55


All times are GMT -4. The time now is 07:29.