|
[Sponsors] |
October 13, 2017, 13:27 |
What is psi technically speaking?
|
#1 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 250
Rep Power: 22 |
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 |
|
October 14, 2017, 18:34 |
|
#2 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9 |
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. |
|
|
|
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 |