|
[Sponsors] |
March 6, 2023, 13:31 |
Temperature average by codedFunctionObject
|
#1 |
New Member
george
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Hi,
I'm trying to get average value of temperature with additional statements, like if the Velocity magnitude is zero take that cell to account. I've just 2 conditions.
Code:
temperatureAverage { type coded; libs (utilityFunctionObjects); writeControl writeTime; name temp; codeWrite #{ scalar P1 = 1.0; scalar P2 = 2.0; scalar Tm = 0; scalar TposAve = 0; scalar counter = 0; const scalarField& zPos= mesh().C().component(2); const volVectorField& U = mesh().lookupObject<volVectorField>("U"); const volScalarField& T = mesh().lookupObject<volScalarField>("T"); forAll(zPos,i) { if (zPos[i] >= P1 && zPos[i] <= P2) { if (U[i] > 0) { Tm += T[i]; counter += 1; } } } TposAve = Tm/counter; #}; } Code:
/aveTest/system/controlDict.functions.temperatureAverage: In member function ‘virtual bool Foam::tempFunctionObject::write()’: /aveTest/system/controlDict.functions.temperatureAverage:96:14: error: no match for ‘operator>’ (operand types are ‘const Foam::Vector<double>’ and ‘int’) regards, scfd |
|
Tags |
coded, coded function object, temperature average value |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 09:21 |
Converging Diverging Nozzle with dbnsTurbFoam | Saleh Abuhanieh | OpenFOAM Running, Solving & CFD | 4 | December 13, 2019 10:26 |
Area weighted average temperature | vin95 | Main CFD Forum | 2 | August 8, 2018 01:46 |
How can i export the average Temperature for many time steps from Fluent? | benmel2006 | FLUENT | 1 | April 5, 2017 13:32 |
average interior temperature less than the operating temperature | Naher | FLUENT | 4 | March 31, 2011 23:14 |