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

multiplicate all elements of volScalarField with scalar to get new volScalarField

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

Reply
 
LinkBack Thread Tools 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: 159
Rep Power: 6
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: 73
Rep Power: 5
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: 159
Rep Power: 6
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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 11 April 22, 2014 12:32
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 06: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 12, 2001 23:19


All times are GMT -4. The time now is 07:50.