|
[Sponsors] |
Calculation of a dimensionedScalar in a modified turbulence model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 9, 2019, 01:49 |
Calculation of a dimensionedScalar in a modified turbulence model
|
#1 |
New Member
Rahul
Join Date: Aug 2018
Posts: 6
Rep Power: 8 |
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! |
|
June 9, 2019, 06:28 |
|
#2 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
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 |
|
June 10, 2019, 00:11 |
|
#3 |
New Member
Rahul
Join Date: Aug 2018
Posts: 6
Rep Power: 8 |
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 |
|
June 10, 2019, 05:39 |
|
#4 | |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
Quote:
Code:
volScalarField HaByRe ( IOobject ( "HaByRe", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE // NO_WRITE if no output desired ), mesh, dimensionedScalar("0", dimensionSet(0, 0, 0 , 0, 0, 0, 0), 0.0) // init to zero, dimensions must be set via dimensionSet ); Cheers RP |
||
June 11, 2019, 05:10 |
|
#5 |
New Member
Rahul
Join Date: Aug 2018
Posts: 6
Rep Power: 8 |
Hey, Thanks a lot. I will try this.
|
|
June 26, 2019, 04:55 |
|
#6 |
New Member
Rahul
Join Date: Aug 2018
Posts: 6
Rep Power: 8 |
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; RAS { RASModel SpalartAllmaras; SpalartAllmarasCoeffs { Cv1 30; } turbulence on; printCoeffs on; } |
|
Tags |
mhd, modified turbulence model, programming, turbulencemodel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Use of k-epsilon and k-omega Models | Jade M | Main CFD Forum | 40 | January 27, 2023 08:18 |
Turbulence model choice | dave13 | CFX | 3 | December 22, 2015 08:12 |
What model of turbulence choose to study an external aerodynamics case | raffale | OpenFOAM | 0 | August 23, 2012 06:45 |
question about turbulence model selection and sensitivity | karananand | Main CFD Forum | 1 | February 26, 2010 05:41 |
Turbulence Model and Accuracy of convective flux calculation | Lokesh Agrawal | Main CFD Forum | 1 | November 15, 1998 00:24 |