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

the arrangement of the components gradU

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

Like Tree1Likes
  • 1 Post By jackjiang1989@gmail.com

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2020, 18:36
Unhappy the arrangement of the components gradU
  #1
New Member
 
zaki
Join Date: Nov 2018
Posts: 17
Rep Power: 8
zikou55 is on a distinguished road
Hello,
gradU is a 9 components tensor, I want to know the arrangement of the components
gradU.compoent(0)=dudx
gradU.compoent(1)=dudy
gradU.compoent(2)=dudz
gradU.compoent(3)=dvdx
gradU.compoent(4)=dvdy
gradU.compoent(5)=dvdz
gradU.compoent(6)=dwdx
gradU.compoent(7)=dwdy
gradU.compoent(8)=dwdz


please am I right ?
zikou55 is offline   Reply With Quote

Old   September 17, 2021, 08:54
Default
  #2
New Member
 
jackjiang
Join Date: Feb 2020
Posts: 10
Rep Power: 7
jackjiang1989@gmail.com is on a distinguished road
Hi,
I got the same question, after some search found it should be like below,
gradU.compoent(0)=dudx
gradU.compoent(1)=dvdx
gradU.compoent(2)=dwdx
gradU.compoent(3)=dudy
gradU.compoent(4)=dvdy
gradU.compoent(5)=dwdy
gradU.compoent(6)=dudz
gradU.compoent(7)=dvdz
gradU.compoent(8)=dwdz

check below link,
discrepancy in fvc::grad(U)

BR/Jack
fly_light likes this.
jackjiang1989@gmail.com is offline   Reply With Quote

Old   September 17, 2021, 11:30
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16
Tobermory will become famous soon enough
Yep - for confirmation, check out Tensor.H (https://cpp.openfoam.org/v8/Tensor_8H_source.html):

Code:
     //- Component labeling enumeration
     enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
but remember that for partial derivatives, the derivative is the first index. So for the second component in the list above, XY, this is \partial /\partial x (V) = \partial V/\partial x. Take a look at the link that Jack quotes for more discussion.
Tobermory is offline   Reply With Quote

Old   February 6, 2025, 08:00
Default
  #4
Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 31
Rep Power: 6
Redrakham is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
Yep - for confirmation, check out Tensor.H (https://cpp.openfoam.org/v8/Tensor_8H_source.html):

Code:
     //- Component labeling enumeration
     enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
but remember that for partial derivatives, the derivative is the first index. So for the second component in the list above, XY, this is \partial /\partial x (V) = \partial V/\partial x. Take a look at the link that Jack quotes for more discussion.
Is there a way to calculate tangential component of velocity in normal direction to a curved surface in OpenFOAM?
Redrakham is offline   Reply With Quote

Old   February 6, 2025, 08:05
Default
  #5
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16
Tobermory will become famous soon enough
Yes - with some simple vector arithmetic. Start with the unit normal vector to the surface, n, then the component of f that is normal to the surface is

(f \cdot n) n

and therefore the tangential part is:

f - (f \cdot n)n

Dot product in OpenFOAM is done with the & operator.
Tobermory is offline   Reply With Quote

Reply

Tags
grad u

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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 21:00
Accessing velocity components and gradient of velcoity components vivekgnhtr OpenFOAM Programming & Development 3 June 27, 2022 02:39
Error while postProcessing icoFoam case to get grad(U) shashanktiwari619 OpenFOAM Post-Processing 1 July 29, 2019 02:47
Question on the sequence of grad(U) components ripperjack OpenFOAM Post-Processing 1 September 18, 2018 12:19
div(phi,U) linearUpwind default; or div(phi,U) linearUpwind grad(U); cyln OpenFOAM Running, Solving & CFD 8 August 1, 2018 08:46


All times are GMT -4. The time now is 21:46.