|
[Sponsors] |
January 7, 2017, 00:43 |
customizing the meanVorticity utility
|
#1 |
Senior Member
Join Date: Jan 2013
Posts: 134
Rep Power: 13 |
Hi,
I am trying to calculate the vorticity of the mean velocity fields. So far what I have done to achieve this is to save the UMean file in another time directory as U and calculate the vorticity of this U with the built-in utility 'vorticity'. This works good but not elegant. I would like to customize a 'meanVorticity' utility that does the same thing as I have mentioned above. I anticipated that it would not be difficult since what I need to do is change the U with UMean in the original vorticity.C and then wmake. However, it turns out that this is far more complicated than I had expected. The meanVorticity.C file I modified is as follows: Code:
#include "calc.H" #include "fvc.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { bool writeResults = !args.optionFound("noWrite"); IOobject UMeanheader ( "UMean", runTime.timeName(), mesh, IOobject::MUST_READ ); if (Uheader.typeHeaderOk<volVectorField>(true)) { Info<< " Reading UMean" << endl; volVectorField UMean(UMeanheader, mesh); Info<< " Calculating meanVorticity" << endl; volVectorField meanVorticity ( IOobject ( "meanVorticity", runTime.timeName(), mesh, IOobject::NO_READ ), fvc::curl(UMean) ); volScalarField magMeanVorticity ( IOobject ( "magMeanVorticity", runTime.timeName(), mesh, IOobject::NO_READ ), mag(meanVorticity) ); Info<< "meanVorticity max/min : " << max(magMeanVorticity).value() << " " << min(magMeanVorticity).value() << endl; if (writeResults) { meanVorticity.write(); magMeanVorticity.write(); } } else { Info<< " No UMean" << endl; } Info<< "\nEnd\n" << endl; } Code:
meanVorticity.C:55:9: error: ‘Uheader’ was not declared in this scope if (Uheader.typeHeaderOk<volVectorField>(true)) ^ meanVorticity.C:55:44: error: expected primary-expression before ‘>’ token if (Uheader.typeHeaderOk<volVectorField>(true)) ^ make: *** [Make/linux64Gcc48DPOpt/meanVorticity.o] Error 1 Could someone shed light on this problem? I attached the source code in here. |
|
January 7, 2017, 12:45 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
||
January 8, 2017, 13:06 |
|
#3 |
Senior Member
Join Date: Jan 2013
Posts: 134
Rep Power: 13 |
Thank you for pointing this out, Zeppo. But it still does not solve this problemIMG_1873.jpg Sent from my iPhone using CFD Online Forum mobile app |
|
January 8, 2017, 15:07 |
|
#4 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Code:
if (Uheader.typeHeaderOk<volVectorField>(true)) Code:
if (UMeanheader.headerOk()) |
|
January 8, 2017, 23:13 |
|
#5 |
Senior Member
Join Date: Jan 2013
Posts: 134
Rep Power: 13 |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
Noise postprocessing utility setup | RFlamm | OpenFOAM Post-Processing | 5 | July 30, 2018 11:06 |
wallHeatFlux Calculation wrt utility version | ahmet | OpenFOAM Post-Processing | 1 | December 18, 2016 20:45 |
[mesh manipulation] mirrorMesh utility preserving regions | zfaraday | OpenFOAM Meshing & Mesh Conversion | 1 | November 7, 2016 22:51 |
Something doens't work with wallHeatFlux utility or externalWallHeatFluxTemperat BC!! | zfaraday | OpenFOAM Post-Processing | 0 | February 5, 2015 17:47 |