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

multiplicate all elements of volScalarField with scalar to get new volScalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2014, 06:27
Default multiplicate all elements of volScalarField with scalar to get new volScalarField
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

I want to do something like this:

Code:
volScalarField TWO = volScalarField ONE * dimensionedScalar SCALAR;
Each element of "volScalarField ONE" should be multiplicated with the "dimensionedScalar SCALAR" -> the result should be "volScalarField TWO". Is this multiplication-operation already defined? How can I do so?

greetings
maybee
maybee is offline   Reply With Quote

Old   February 18, 2014, 16:20
Default
  #2
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14
ChrisA is on a distinguished road
I am 99% sure this multiplication is already implemented. All you have to do is declare ONE and SCALAR with proper values/declarations prior to declaring TWO like you did there. Then its as simple as:

//ONE and SCALAR declarations
volScalarField TWO = ONE * SCALAR;

Sometimes the best way to figure things out is to simply try it and see what the results are!
ChrisA is offline   Reply With Quote

Old   February 18, 2014, 16:43
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

thx for the help . I know it is good to just try things out, but in this case I am implementing a new algorithm into the multiphaseEulerFoam solver and there are a few "construction sites" now - so I can t test it so easy within the solver - though it is right that I could check if the compiler gives me some error messages for specific code segments .
maybee 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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 08:15
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 02:47
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 07:16
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 02:27
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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