CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Regarding preprocessing (https://www.cfd-online.com/Forums/openfoam-pre-processing/172201-regarding-preprocessing.html)

Zhiheng Wang May 25, 2016 19:18

Regarding preprocessing
 
1 Attachment(s)
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.


All times are GMT -4. The time now is 03:35.