How to know where a specified "const scalar" defined and calculated in openfoam ??
Dear Foamers
In many OpenFoam codes we can see some imported constant scalars. For example look at lines 163-170 of: Code:
src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C Code:
Foam::forceSuSp Foam::BrownianMotionForce<CloudType>::calcCoupled Now, I want to know where the scalar "dt" defined and calculated before it have been imported to these code?? |
This code snippet is basically the definition of a member function called calcCoupled and dt, mass , ... are the input parameters (arguments) of this function. Their values depend on the passed values when this function is called. Therefore, you have to search OF source code related to this function and see how these values are calculated and passed to this particular function.
Best wishes, Hassan Kassem |
Thanks very much "hk318i"
Unfortunately, I'm beginner in openfoam programming. So need more help. Can you tell me how I can search and find that special source code?? (where this function have been defined or "dt" have been calculated) Because I want to define my own constant "dt". but openfoam use variable "dt" that calculated and changed in each lagrangian solution iteration. best regards. |
const scalar
Hi,
I'm in the same topic. I want to use a set of equations only in a one region. In your problem, I think you must write const scalar 'name_of_variable' 'expression' Example: const scalar a=0.5*U; Please, comment if it's correct Quote:
|
Dear fvallejog
Thanks for your attention. unfortunately, your commit didn't work. my question is still remaining with no answer. and I don't find the place that "dt" have been defined and calculated. ping |
I will try to give you a quick hint because I don't know alot about your problem and the solver you are using.
From SprayParcel line 248 Code:
const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, muAv); Best wishes, Hassan |
Name of parameters can change on every call so don't rely on them. Name of the function on the other hand should always be the same, so just try this:
Quote:
|
All times are GMT -4. The time now is 21:31. |