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

What is psi technically speaking?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2017, 13:27
Default What is psi technically speaking?
  #1
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 250
Rep Power: 22
klausb will become famous soon enough
Hello,

psi appears as:

Foam::scalarField &psi,

but what is it technically speaking. A Field (=array) of values or of pointers?

I keep going in circles with value type compiler errors like:

error: cannot convert ‘Foam::scalarField {aka Foam::Field<double>}’ to ‘double**’

or

error: cannot convert ‘Foam::scalarField* {aka Foam::Field<double>*}’ to ‘double**’

Maybe someone can clarify the value type for me?

Klaus
klausb is offline   Reply With Quote

Old   October 14, 2017, 18:34
Default
  #2
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
scalarField is a class. It is used here to declare a reference variable psi, which is used to store an address of a scalar field.

scalarField and array are different that scalarField has more things in it but not only scalar itself. So you cannot assign a scalarField variable directly with an array unless the operator "=" has its function overwritten. The array may be assigned in a constructor such as using this sentence "scalarField & psi ("your array")".

Pointer and reference are similar as both of them store address. Reference is more safe.
Marpole 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
"unknown psi type" error in reactingFoam Speno93 OpenFOAM Running, Solving & CFD 2 May 25, 2021 09:15
How rho_ and psi_ are calculated in compressible solvers of OpenFOAM? JBUNSW OpenFOAM Programming & Development 17 February 12, 2021 08:59
How to modify psi value from the solver level (based on reactingFoam)? xinyu OpenFOAM Programming & Development 1 March 30, 2017 23:33
Different define of psi uesd in pEqn.H zqlhzx OpenFOAM Running, Solving & CFD 0 December 24, 2013 08:45
Writting Fluent Data in Psi alimrad110 FLUENT 0 August 29, 2013 18:01


All times are GMT -4. The time now is 00:12.