access to member function variable
Hello everyone,
I'm using the lagrangian evaporation methods of OF2.4.0 and trying to change one to the Abramzon&Sirignano model. Since my C++ knowledge isone beginners level, I'm stuck with the following problem. In short: in the 1.function 'calculate' there's a value Bt which is calculated. This values should be passed to the 2.function 'dh'. Two different scopes. I guess a direct passing is not possible. Is there an alternative way to get access to this variable? Declare it globally or introduce it as a function? Or how? For the evaporation part I found a very helpful work of the Chalmers University. But for this issue everything I tried leads to errors! I'll appreciate any help. Thanks! Code:
template<class CloudType> |
These are in the same object? You could store it as a member variable. But in the first instance above, Bt is calculated within a forAll(activeLiquids_), and in the second, Bt is just used. So which activeLiquid applies to the second scope?
|
Quote:
Thank you for your response. Yes, everything is (unfortunatelly) in one object. If I store it as a member variable (= member function?) then I still have to pass the values from one function to another or everything property has to be again calculated in the second variable or am I wrong? The function 'dh' is called from another class for each liquid. So that's why I thing every Bt (each cellId and activeLiquid) should be applied to the second scope. I didn't pay attention while writing it here, sorry. But here I'm still confused with the subscripts. Or how would the call for Bt look like and what type (scalarField/volScalarfield) would it have if defined as a member variable to be be sure that every cell and liquid is correctly designated? From ReactingParcel.C: Code:
forAll(dMassPC, i) |
No, a member variable is not the same as a member function. Use a scalarList for Bt and index it by activeLiquid index. I hope one of the dh function parameters is the activeLiquid index, otherwise you will have to add that.
There's lots of examples of using a scalarList throughout the code base. Best of luck! |
All times are GMT -4. The time now is 20:42. |