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/)
-   -   Using .stl - Surface for Average Pressure / Mass Flux / ... (https://www.cfd-online.com/Forums/openfoam-pre-processing/171021-using-stl-surface-average-pressure-mass-flux.html)

CellZone May 3, 2016 09:52

Using .stl - Surface for Average Pressure / Mass Flux / ...
 
Dear Reader,

I made a pipe with blockMesh where I want to implement some .stl - surfaces , where I can analyze for example the average pressure , mass flux, mean temperature etc. during my calculations (not in post-processing).

I tried to use the tutorial snappyMultiRegionHeater as help:

First I created a .stl -surface in Ansa. Then I created a dictionary in the constant dictionary called triSurface, where I have put my .stl file

Questions

1) Overall: Do I have to use snappyhexmesh or is it possible to do it without snappy . That means: Do I have to mesh my .stl surface file or is it enough just to create a directory with the .stl file?

2) Since it is only used for analyzing: do I have to create a dictionary in the constant directory with files for turbulenceproperties, RasProperties, ... for the .stl surface? Actually I would not know what kind of entries I should add in those files, because it's just for analyzing data.

3) I am trying to implement the analyzing of the surface in the ControlDict using swak4Foam :

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//"libtabulatedHeatTransferMassFlow.so"
libs (
//"libtabulatedHeatTransferMassFlow.so"
"libfieldFunctionObjects.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);
application rhoPorousSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable true;
 
// ************************************************************************* //
functions
(
PressureBefore
{
type swakExpression;
outputControlMode timeStep;
outputInterval 1;
valueType surface;
surfaceName ControlSurfaceHWTEinlass;
surface {
type sampledTriSurfaceMesh;
surface ControlSurfaceHWTEinlass.stl;
source cells; // What to sample: cells (nearest cell)

interpolate false;
}
expression "p";
accumulations (average);
verbose true;
}
);

Could this work like this?

Thank you in advance

akidess May 4, 2016 01:14

Quote:

Originally Posted by CellZone (Post 598353)
Could this work like this?

Begs the question that if you worked it out so far, why didn't you just try it? ;)

It is possible to use the STL sampling surface without changes to your mesh (it wouldn't be as useful IMO otherwise). Think of it as giving OF a list of points to probe. You don't need any dictionaries or such for the STL file apart from the sampling command. I haven't used triSurfaceSampling with swak, but your code looks reasonable.

CellZone May 4, 2016 02:25

It's working :-) Thank you for your background information!


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