CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Calculate pressure between internal faces (with swak4foam) (https://www.cfd-online.com/Forums/openfoam-post-processing/96743-calculate-pressure-between-internal-faces-swak4foam.html)

Kalas January 31, 2012 05:56

Calculate pressure between internal faces (with swak4foam)
 
Hi,

I have a pipe-flow type simulation in which I want to measure the difference in (total)pressure between two internal surfaces. Usually this is done in fluent which allows internal surfaces to be defined, and hence one can calculate pressure and velocity etc on them. But since OF doesn't allow internal surfaces I have defined two faceSets (through fluentMeshToFoam -writeSets). I have discovered OF itself can't really do anything with these, but the swak4foam package supposedly can. But there seems to be something I have missed, because not even swak4foam can read the values on the faceSet. The functions part of my controlDict looks like this:

Code:


functions
(
 averagePresInlet
 {
  type swakExpression;
  valueType faceSet;
  setname sec_inlet;
  expression "p";
  accumulations (
  average
  );
  verbose true;
 }
);

which I thought would atleast write the average pressure on the sec_inlet faceSet. But my problem is that after the first timestep simpleFoam exits with the error:

Code:


--> FOAM FATAL ERROR:
Could not find a field name "p" of type scalar (neither type surfaceScalarField nor volScalarField) Autointerpolate: 0

Obviously there is something I have missed, I just can't figure out what it is.. help would be greatly appreciated!

Thanks,
Klas

Kalas February 3, 2012 05:18

Nvm,

found out that you need

autoInterpolate true;

Br,
Klas


All times are GMT -4. The time now is 15:34.