|
[Sponsors] |
How to know where a specified "const scalar" defined and calculated in openfoam ?? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
May 11, 2016, 07:06 |
How to know where a specified "const scalar" defined and calculated in openfoam ??
|
#1 |
Member
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10 |
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 ( const typename CloudType::parcelType& p, const scalar dt, const scalar mass, const scalar Re, const scalar muc ) const Now, I want to know where the scalar "dt" defined and calculated before it have been imported to these code?? |
|
May 15, 2016, 05:54 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
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 |
|
May 15, 2016, 16:10 |
|
#3 |
Member
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10 |
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. |
|
July 17, 2016, 21:08 |
const scalar
|
#4 | |
New Member
Fidel Vallejo
Join Date: Dec 2015
Location: Santiago
Posts: 7
Rep Power: 10 |
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:
|
||
July 19, 2016, 03:21 |
|
#5 |
Member
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10 |
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 |
|
July 19, 2016, 06:34 |
|
#6 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
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 |
|
July 20, 2016, 12:56 |
|
#7 | |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
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:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dsmcFoam setup | hherbol | OpenFOAM Pre-Processing | 1 | November 19, 2021 01:52 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 05:36 |
pipe flow OpenFOAM | stix | OpenFOAM Running, Solving & CFD | 1 | March 4, 2013 16:44 |
Difference between exact value and calculated value | OFU | OpenFOAM Post-Processing | 2 | August 19, 2011 06:10 |
User Defined Scalars - Returning Values | Carlos V. | FLUENT | 0 | April 19, 2006 18:18 |