|
[Sponsors] |
August 1, 2017, 12:14 |
Field values at the boundary cells
|
#1 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
I want to get values of turbulent kinetic energy at the cells of one of the boundary along with its x and y coordinates. I will use these values to modify one of the terms of the realizableKE model.
My approach is to run loop along the patch to get these values before the kEqn. Which function should I use to get TKE values at the boundary. I have defined the boundary as zeroGradient. |
|
August 1, 2017, 20:39 |
check this out!
|
#2 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
Hi Vedamt,
You are right about running a loop along boundary and patch to get values. I am not aware of the turbulent kinetic energy field variable, but assuming it is TKE, the general method is something like this Code:
forAll (mesh.boundaryMesh(), patchI) { forAll(TKE.boundaryField()[patchI], faceI) { scalar tKEVal = TKE.boundaryField()[patchI][faceI]; scalar Xval = mesh.Cf().boundaryField()[patchI][faceI].x(); scalar Yval = mesh.Cf().boundaryField()[patchI][faceI].y(); } } Sugajen |
|
August 2, 2017, 16:35 |
Reading user labels
|
#3 | |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
Quote:
Thanks for your response. Very much what I required. One more question that I would need patchI if need to loop over a particular patch. But I want to read the patch value from the user defined files such as CoeffDict. I have added Code:
inletID ( dimensioned<label>::lookupOrAddToDict ( "inletID", coeffDict_, 1 ) ) cannot convert 'Foam::dimensioned<int>' to 'Foam::label {aka int}' in initialization Can you correct me on this? |
||
August 2, 2017, 18:19 |
|
#4 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
Sorry, haven't used CoeffDict before.
|
|
August 2, 2017, 18:50 |
Similar question
|
#5 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
Dear Sugajen,
When using the code below Code:
tmp<volScalarField> FST(k_); forAll(mesh_.C(),cellI) //loop through all cells defined in mesh { FST[cellI] = scalar(1); } I get the following error: no match for 'operator []' in 'FST[cellI]'. I tried several things but unable to resolve. |
|
Tags |
looping over cells, realizableke, turbulent kinetic energy |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh running killed! | Mark JIN | OpenFOAM Meshing & Mesh Conversion | 7 | June 14, 2022 02:37 |
CFD analaysis of Pelton turbine | amodpanthee | CFX | 31 | April 19, 2018 19:02 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |