|
[Sponsors] |
November 24, 2015, 07:35 |
Mathematic expression of grad(U)
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi all,
I have just one question. In mostly all literature we find the gradient of a scalar or vector in that way. But in a mathematic point of view this is not correct for vectors. So we get for any scalar: Of course I assume as the partial differentials of the three directions and this is correct but For any vector: My question now. Is it just a definition that we suppose that everybody know that is the transposed dyadic product of these two vectors? Because normally, and are two vectors with the matrix notation (3x1) and (3x1). Therefore we have to use the dyadic product of this operation and after that we really have to transpose that matrix to get the correct form of the gradient matrix. Example: Again. Is it a definition that in CFD numerics we say: I would kindly appreciate some feedback.
__________________
Keep foaming, Tobias Holzmann Last edited by Tobi; November 24, 2015 at 11:36. |
|
November 24, 2015, 12:12 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Just for clarify the stuff. If we have the momentum equation we are using it in the same way like:
Maybe I should ask more carefully. Are we always talking about the dyadic product if we have two vectors like above () or ...
__________________
Keep foaming, Tobias Holzmann |
|
November 25, 2015, 07:20 |
|
#3 |
Member
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 53
Rep Power: 16 |
Hi Tobias,
Just to give you some feedback You are not the only one that thinks this notation can be unclear. I prefer myself to use Einstein notation as it is clear what opperation is being performed. For openfoam you can take a look in the ProgrammersGuide around page 25 (some old version had an error in this chapter, don't remember which one, but the new one should be up to date) To my knowledge, this is generally used for outer (dyadic) product. /Eysteinn |
|
November 25, 2015, 07:36 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi,
thanks for the replay. So its clear now ... it is the the outer product of two vectors (dyadic). Of course it is clear that it has to be the outer product (dyadic) but you know, if you start derivating all the equations you get sometimes confused what they mean exactly. So actually it is: Thanks for the replay. But at least I could answer my question myself due to the fact that I derived all equations and you always have to take the outer product. Otherwise it's not defined (: Kind regards, Tobi
__________________
Keep foaming, Tobias Holzmann |
|
December 1, 2015, 04:22 |
|
#5 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Hi Tobi,
Maybe this is of some help to you, this is my understanding: OpenFOAM uses different notations whether it is applied to fields and tensors. The standard tensor or matrix multiplication is the sum of the multiplication of elements within one row of the left hand tensor with the elements of one column of the right hand tensor. So, in short, you always apply the rule: go horizontal left hand side, then vertical right hand side. This is easy to grasp using some better software, which can handle matrix operations such as Mathcad. The standard matrix multiplication typically has no operator (x, * or whatever, just nothing). Since this is difficult to descibe within a programming language, I guess, OpenFOAM uses dot and cross product for tensor operations: and In OpenFOAM, the dot product sign is "&", the cross product sign is "*". Since there is also a transpose operator ("T(...)"), you can describe all standard tensor multiplications by transposing either the right hand tensor or the left hand tensor. This works for all tensor operations since the number are limited (3 dimensions) 3 x 1 and 3 x 1 (vector multiplied by vector), 3 x 3 and 3 x 1 (quadratic tensor multiplied by vector) 3 x 3 and 3 x 3 (quadratic tensor multiplied by quadratic tensor) To make things more confusing, OpenFOAM uses the "*" sign also as scalar multiplication sign (scalar multiplied by vector or tensor). There is no dyadic product in tensor multiplication of OpenFOAM that I know of. The dyadic product of 2 vectors is the product of each row, so you get a vector again. This method does not comply to the standard matrix multiplication. For field operations, the annotation is totally different. In OpenFOAM, the multiplication of two fields is always the dyadic product. The sign that is used for mutiplication then defines what is done within one field element, e.g. dot product or cross product. The word "field" in OpenFOAM is a vector of a number of elements (e.g. cells) that can be scalars, vectors or tensors. For matrix field multiplication, OpenFOAM uses the standard multiplication form (Apsi for A psi or Atpsi for transpose A psi). A matrix (fv matrix class) is always a quadratic cell volume matrix (rows = columns = number of cells), whereas fields can be volume fields (rows = number of cells, + patches) and surface fields (rows are number of internal faces, + patches). This is also why a matrix multiplication between a matrix and a surface field is not possible (the number of columns of the matrix needs to be identical to the number of rows of the field). Hope this makes things a little more clear. Regards, Daniel |
|
December 14, 2015, 06:15 |
|
#6 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Hello,
I have to excuse myself, but some of my above statements are wrong. What I have called "standard" multiplication is, according to Wikipedia, just a matrix multiplication. According to the same source, the outer product and the dyadic product is the same, just a different annotation. The multiplications of fields in OpenFOAM, row by row, has no name that I know of. It is not the dyadic product though. The rule of transformation of outer and scalar products by transposing the left or right vector does not work for vector and tensor multiplication. A matrix multiplication of a vector by a tensor is not defined, since column number of the vector has to correpond to the row number of the tensor. Transposing the tensor does not help, you only can transpose the vector. You then get a one row tensor as a result. The result is the same as the transpose of the matrix multiplication of the transposed tensor by the vector. In OpenFOAM, the multiplication of a vector by a tensor do exist (e.g. in the fvc::reconstruct code). The code uses the "*" sign. It is not clear to me what this sign means in this context. The result should be a vector. If you look at your example of nabla dot U x U: Since the dot sign shall reduce the dimension, so U x U is a tensor, the dot sign reduces back to a vector. This makes sense. But which matrix multiplication is applied, using the tensor as it is or the transpose of it? The last example is obviously of no practicable use, since the code looks very differently (It is a surface integrate of a surface multiplication of phi or rhoPhi and u using weight factors). Regards, Daniel |
|
December 14, 2015, 06:34 |
|
#7 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Quote:
you use the tensor which you get as it is by the dyadic product. Then just use the divergence convention and thats it.
__________________
Keep foaming, Tobias Holzmann |
||
December 14, 2015, 08:17 |
|
#8 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Hello Tobi,
Thanks for the hint, but what is the dot convention for vector tensor multiplications? In OpenFOAM, fvcReconstruct.C: Code:
inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf) and: Remark: for the multiplication between scalar and vector, I left the multiplier sign off how it is usually done in mathematic formula, in OpenFOAM, the "*" is used. So (b shall be the result vector): The result of this multiplication is a vector. This, I am sure. A is the inverse of a symmetric tensor. This, I know too, since the outer product of two vectors is a symmetric tensor. I want to rewrite this into a matrix multiplication, something like: So, is A* equal to A or A transpose or what? If I want to invert A*, then do a multiplication to b, how does it look like? How to use the dot sign then? Regards, Daniel |
|
December 14, 2015, 08:34 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Dear Daniel
please do not mix that one: The first one is the dyadic product the second one is the curl. They are treated in different ways! Additionally your equation is somehow not identical with the code (--> x = ). Where is mesh.Sf() in the second term in the code? At least I did not check the equation. Its just some hint, especially with the curl and dyadic product.
__________________
Keep foaming, Tobias Holzmann |
|
December 14, 2015, 09:41 |
|
#10 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Hello Tobi,
You are correct. In MatCad, the X sign is the vector product sign. Since vector product = outer product = dyadic product, this is just another way to confuse people. So, let's settle on for that product. I found the following link: http://people.rit.edu/pnveme/EMEM851...sors_rect.html a and b shall be vectors, A and B tensors: and: Now, according to that above link: This is such in MathCad, in OpenFOAM? The reverse is: Finally two tensors: This basically solves that problem, that you have (if the link is correct): Do you agree? Regards, Daniel |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlet boundary condition in interFoam | Andrea_85 | OpenFOAM Running, Solving & CFD | 51 | July 20, 2017 13:31 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 06:16 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 06:25 |
Lift, Drag Vs time chart,calculations | Jamesd69climber | CFX | 8 | February 17, 2005 17:23 |