CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Field values at the boundary cells

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vcvedant
  • 1 Post By Sugajen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2017, 11:14
Default Field values at the boundary cells
  #1
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
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.
Kummi likes this.
vcvedant is offline   Reply With Quote

Old   August 1, 2017, 19:39
Default check this out!
  #2
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
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();
    }
}
best,
Sugajen
Kummi likes this.
Sugajen is offline   Reply With Quote

Old   August 2, 2017, 15:35
Default Reading user labels
  #3
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
Quote:
Originally Posted by Sugajen View Post
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();
    }
}
best,
Sugajen

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
        )
    )
but I receive an error:
cannot convert 'Foam::dimensioned<int>' to 'Foam::label {aka int}' in initialization

Can you correct me on this?
vcvedant is offline   Reply With Quote

Old   August 2, 2017, 17:19
Default
  #4
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
Sorry, haven't used CoeffDict before.
Sugajen is offline   Reply With Quote

Old   August 2, 2017, 17:50
Default Similar question
  #5
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
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.
vcvedant is offline   Reply With Quote

Reply

Tags
looping over cells, realizableke, turbulent kinetic energy


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 01:37
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05


All times are GMT -4. The time now is 02:42.