|
[Sponsors] |
December 8, 2021, 06:09 |
weighted average of a volScalarField
|
#1 |
New Member
Usama Niaz
Join Date: Oct 2019
Location: Pakistan
Posts: 7
Rep Power: 7 |
Hi Foamers,
I am trying to read the pressure field from the mesh and then take a weighted average of pressure and using that I want to find the velocity on the inlet patch. to read the Pressure field I am using the following, const volScalarField& pIn=db().lookupObject<volScalarField>("p"); then to take the weightedaverage const volScalarField pAverage = pIn.weightedAverage(patch().boundaryMesh().mesh(). V()); and for velocity calculation vectorField :: operator=(n_*pow(p1-pAverage)/rho,0.5)); but as I am new to OpenFOAM I don't understand how to properly implement that. I get the following error, conversion from ‘Foam::dimensioned<double>’ to non-scalar type ‘const volScalarField’ {aka ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} requested 175 | const volScalarField pAverage = pIn.weightedAverage(patch().boundaryMesh().mesh(). V()); Can anyone please help me out here, I will be greatly thankful. |
|
December 10, 2021, 04:21 |
|
#2 | ||||||
New Member
Usama Niaz
Join Date: Oct 2019
Location: Pakistan
Posts: 7
Rep Power: 7 |
Thanks to Alexeym, I was able to figure out the problem.
Quote:
|
|||||||
Tags |
boundaryconditon, internalfields, openfoam, program development, weighted average |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
Converging Diverging Nozzle with dbnsTurbFoam | Saleh Abuhanieh | OpenFOAM Running, Solving & CFD | 4 | December 13, 2019 11:26 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
area weighted average or mass weighted average | sa har | Main CFD Forum | 0 | January 5, 2016 14:16 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 07:16 |