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

Assigning a component of a volTensorField a particular value

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2021, 16:27
Default Assigning a component of a volTensorField a particular value
  #1
Member
 
Anonymous
Join Date: Aug 2016
Posts: 75
Rep Power: 9
backscatter is on a distinguished road
Hi,

Is there any elegant way to manually assign one component of a volTensorField a particular value? Let's say we have to replace the (1,1) component of the tensor field by zero, how would you elegantly get this done?
backscatter is offline   Reply With Quote

Old   November 24, 2021, 10:13
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
https://www.openfoam.com/documentati...1_1Tensor.html

you can assess the (1,1) via the xx() function.
mAlletto is offline   Reply With Quote

Old   November 24, 2021, 14:14
Default
  #3
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 8
s1291 is on a distinguished road
Quote:
Originally Posted by backscatter View Post
Hi,

Is there any elegant way to manually assign one component of a volTensorField a particular value? Let's say we have to replace the (1,1) component of the tensor field by zero, how would you elegantly get this done?

if T is tensor, you can access its components via:

Code:
T.xx();
T.xy();
T.xz();
...
// etc.
You can also assign values to the components, e.g:

Code:
T.xx() = 5.0;
T.xy() = -99.0; 
...
//etc
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 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
OpenFOAM extended 4.0 Error with Multinode Set-up Liweix OpenFOAM Running, Solving & CFD 1 February 18, 2020 01:50
Error running openfoam in parallel fede32 OpenFOAM Programming & Development 5 October 4, 2018 17:38
Access (I, J) component of a volTensorField longonig OpenFOAM Programming & Development 2 February 15, 2018 08:53
Momentum source coefficient, cylindrical coordinates, circumferential component? polakse CFX 15 January 18, 2016 03:40
probes for a component of a volTensorField titio OpenFOAM Post-Processing 0 July 2, 2010 14:50


All times are GMT -4. The time now is 09:38.