|
[Sponsors] |
May 25, 2016, 20:27 |
Regarding code
|
#1 |
Member
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10 |
Hi, I have stuck in code where I am preprocesing Temperature values.
label patchID = mesh.boundaryMesh().findPatchID("inlet"); scalarField InletTGrad=T.boundaryField()[patchID].snGrad(); const scalarField HEIGHT = 1.0/mesh.deltaCoeffs().boundaryField()[patchID]; const fvBoundaryMesh& myBoundary = mesh.boundary(); forAll( myBoundary, fvPatchID ) / { const fvPatch& myPatch = myBoundary[patchID]; const vectorField& position = myPatch.Cf(); forAll( myPatch, i) { Ts.boundaryField()[fvPatchID][i] = Ts.boundaryField()[patchID][i]+HEIGHT*InletTGrad; } Problem is Ts is volScalarField and Height*InleGrad is scalarField How can I update my boundary values using this code plese Send your valuable suggetions. Can we convert scalarField to volScalarField ?? or Can access scalarField element one by one |
|
May 26, 2016, 03:35 |
|
#2 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 16 |
Hi,
I am not sure how helpful this will be, but you could probably take a look at how OF defines "gh" term in order to compute p_rgh. If I remember correct, it ends up creating a volScalarField in order to do any computations with the 'p' field. Cheers, Antimony |
|
May 26, 2016, 17:48 |
|
#3 |
Member
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10 |
Hi First I am grateful and Thankful for your quick reply
I have resolved the issue by T.boundaryField()[patchID][i]=Height[i]*InletGradT[i] gives DT[i] (for ith face-center [facei]) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The FOAM Documentation Project - SHUT-DOWN | holger_marschall | OpenFOAM | 242 | March 7, 2013 13:30 |
How to make code run in parallel? | cwang5 | OpenFOAM Programming & Development | 1 | May 30, 2011 05:47 |
Open Source Vs Commercial Software | MechE | OpenFOAM | 28 | May 16, 2011 12:02 |
Small 3-D code | Zdravko Stojanovic | Main CFD Forum | 2 | July 19, 2010 11:11 |
public CFD Code development | Heinz Wilkening | Main CFD Forum | 38 | March 5, 1999 12:44 |