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

power of vectorField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2014, 09:52
Default power of vectorField
  #1
Member
 
Matthias Walter
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 63
Rep Power: 17
matthias is on a distinguished road
Hi,

I need the element-wise power of a vectorField (or a volVectorField), e.g.

vectorField V;
pow(V, 0.7)

with pow(V.X(), 0.7) , pow(V.Y(), 0.7) and pow(V.Z(), 0.7).

A possible way could be to use the component method as

Code:
scalarField x = pow(V.component(vector:X), 0.7);
scalarField y = pow(V.component(vector:Y), 0.7);
scalarField z = pow(V.component(vector:Z), 0.7);
and to create a new vector Field and to set the single components

Code:
vectorField tmp = x*vector(0,0,0);

tmp.component(0) = x;
tmp.component(1) = y;
tmp.component(2) = z;

All in all, it is working but I think there must be a better way to do that or has OF already such function?

Best regards

Matthias
matthias 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
Non-Newtonian Power Law for Viscosity John FLUENT 16 September 12, 2015 07:18
Modeling the power sources saisanthoshm88 CFX 2 April 6, 2011 19:46
Wind Power Frank Grassi FLUENT 0 October 12, 2007 12:20
power curve of windmills with CFD sayid FLUENT 2 March 28, 2007 10:55
Intl Conf Computational Methods in Fluid Power Jacek Stecki Main CFD Forum 0 November 10, 2002 06:49


All times are GMT -4. The time now is 17:26.