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

Multiplication of two volVectorField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ChGr

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2016, 11:50
Default Multiplication of two volVectorField
  #1
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Hey,

I'm new to OpenFOAM and want to access the volVectorField U. It's not a problem to scale it by a scalar, simply by writing

Code:
volVectorField scaledU = scalar * U.
The Problem is that I need to scale every component of U by it's own value. I need to multiply the vector field U by another vectorField.

Code:
volVectorField S = [(s11, s12, s13), (s21,s22,s33),...]
volVectorField scaledU = [(s11*U11,s12*U12,s13*U13(), (s21*U21,s22*U22,s23*U23(),...]
Does anyone have a hint how i could realize this?
ChGr is offline   Reply With Quote

Old   May 30, 2016, 12:08
Default
  #2
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Sorry, this post was too early.

The Programmers Guide says that the function "scale(a, b)" should be used. Sadly the guide is not up to date at this point for a long time. The function that should be used is

Code:
cmptMultiply(a, b)
Jim1310 likes this.
ChGr 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
Initialize a uniform 0 volVectorField Schag OpenFOAM 4 July 24, 2024 03:18
Elementwise multiplication operator johndeas OpenFOAM Running, Solving & CFD 3 March 9, 2019 14:03
[Problem] paraFoam Throws volVectorField Error At t=0 for 0/U iamed18 OpenFOAM Pre-Processing 3 April 11, 2016 11:03
Pstream reduce sum volVectorField ganeshv OpenFOAM Running, Solving & CFD 0 December 11, 2012 15:35
multiplication of scalar and volVectorField mikeP OpenFOAM 5 March 27, 2012 13:34


All times are GMT -4. The time now is 22:30.