Calculation of a dimensionedScalar in a modified turbulence model
Hey guys, I am actually working on developing a turbulence model for magneto hydrodynamic flow. I need to modify a coefficient (which is dimensionedScalar) used in the model. In the original model, it has a constant number value, but in my case I need it to be a function of ratio of Hartmann number to Reynold's number (Ha/Re), but it should be still a dimensioned Scalar.
Now while defining the ratio, Ha/Re = sigma*(B)^2/(U)^2*rho. Now here, B is magnetic field and U is Velocity (both of which are volVectorField). How do I perform this operation so that my LHS and RHS become of same type. I tried a lot, but I always end up with "error: no match for operator=" Any suggestions are more than welcome! |
Hey there,
as you already figured out, you will need an additional field for your dynamic variable (checkout the type volScalarField). Additionally, in order to calculate the HaByRe field with your equation, you will have to be aware of the syntax for different vector/tensor operations in OpenFoam. For example, the inner product between two vectors a and b is a & b. You can find all possible operations in the OF programmers guide p. 22 (google). Good luck! RP |
Hey, Thanks for your reply.
I had read through the various operations before, but I am never able to achieve the desired operation to make sure that the value of the turbulence coefficient remains dimensionedScalar. Could you please elaborate on how I can perform the operation? Rahul |
Quote:
Code:
volScalarField HaByRe Cheers RP |
Hey, Thanks a lot. I will try this.
|
Hey guys, I solved this problem in a different, but less complicated way without changing the existing code. The only thing that varies in my problem with Ha/Re value is the closure coefficient used in the turbulent model. So, one can easily change it by editing the turbulenceProperties file in the case directory. This is a very common fact which took me long enough to figure out.
Code:
simulationType RAS; |
All times are GMT -4. The time now is 09:40. |