ENH: added surfaceFieldValue uniformity operation

This commit is contained in:
Mark Olesen
2018-03-22 22:38:34 +01:00
parent acfa0d3ed1
commit e53384362c
14 changed files with 363 additions and 52 deletions

View File

@ -20,23 +20,22 @@ internalField uniform 1000;
boundaryField
{
Default_Boundary_Region
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 1000;
value $internalField;
}
outlet
{
type inletOutlet;
//type zeroGradient;
value uniform 1000;
inletValue uniform 1000;
value $internalField;
inletValue $internalField;;
}
".*"
{
type zeroGradient;
}
}

View File

@ -33,8 +33,8 @@ boundaryField
outlet
{
type inletOutlet;
value uniform (0 0 0);
inletValue uniform (0 0 0);
value $internalField;
inletValue $internalField;
}
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,17 +24,17 @@ boundaryField
{
type compressible::alphatWallFunction;
Prt 0.85;
value uniform 0;
value $internalField;
}
inlet
{
type calculated;
value uniform 0;
value $internalField;
}
outlet
{
type calculated;
value uniform 0;
value $internalField;
}
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -27,19 +26,19 @@ boundaryField
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 200;
value $internalField;
}
inlet
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value uniform 200;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue uniform 200;
value uniform 200;
value $internalField;
inletValue $internalField;
}
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -24,19 +23,19 @@ boundaryField
Default_Boundary_Region
{
type kqRWallFunction;
value uniform 1;
value $internalField;
}
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 1;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
value $internalField;
inletValue $internalField;
}
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -27,17 +26,17 @@ boundaryField
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
value $internalField;
}
inlet
{
type calculated;
value uniform 0;
value $internalField;
}
outlet
{
type calculated;
value uniform 0;
value $internalField;
}
}

View File

@ -28,17 +28,17 @@ boundaryField
{
type zeroGradient;
//type mixed;
refValue uniform 110000;
refValue $internalField;
refGradient uniform 0;
valueFraction uniform 0.3;
}
outlet
{
type fixedValue;
value uniform 110000;
value $internalField;
//type mixed;
//refValue uniform 110000;
//refValue $internalField;
//refGradient uniform 0;
//valueFraction uniform 1;
//type transonicOutletPressure;
@ -46,7 +46,12 @@ boundaryField
//phi phi;
//gamma 1.4;
//psi psi;
//pInf uniform 110000;
//pInf $internalField;
}
".*"
{
type zeroGradient;
}
}

View File

@ -47,5 +47,12 @@ graphFormat raw;
runTimeModifiable true;
#include "sampleControls"
functions
{
#include "sampling"
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
// -*- C++ -*-
// ************************************************************************* //
// Transcribe volume fields to surfaces.
fieldTransfer
{
type surfMeshes;
libs ("libsampling.so");
log true;
writeControl none;
createOnRead true;
executeControl timeStep;
executeInterval 1;
fields (p rho U T);
derived (rhoU);
_plane
{
type plane;
source cells;
planeType pointAndNormal;
pointAndNormalDict
{
normal (-1 0 0);
point (-0.04 0 0);
}
}
surfaces
(
// Top channel
plane1
{
${_plane}
bounds (-1 0 -1) (0 1 1);
}
// Bottom channel
plane2
{
${_plane}
bounds (-1 -1 -1) (0 0 1);
}
);
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
// -*- C++ -*-
// restartTime:
// - a 'one-shot' reset at a particular time
//
// fields [required]
// Pairs of fields to use for calculating the deviation.
// The fields must already exist on the surfaces.
//
// weightField [optional]
// A scalar or vector field for weighting.
//
// postOperation [optional]
// Modify the results by particular operations.
// (none | sqrt)
// The sqrt operation is useful when determining RMS values.
//
// The 'output/write' control triggers the calculation.
__surfaceFieldValue
{
type surfaceFieldValue;
libs ("libfieldFunctionObjects.so");
log on;
enabled true;
writeControl timeStep;
writeInterval 1;
writeFields false;
surfaceFormat vtk;
// writeArea true;
// resetOnStartUp true;
// resetOnOutput false;
// periodicRestart true;
// restartPeriod 0.0005;
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
// -*- C++ -*-
// ************************************************************************* //
#include "fieldTransfer"
massflow
{
${__surfaceFieldValue}
regionType surface;
name plane1;
operation areaNormalIntegrate;
fields ( rhoU );
}
areaIntegrate
{
${__surfaceFieldValue}
regionType surface;
name plane1;
operation weightedAreaIntegrate;
weightField rhoU;
fields ( T );
}
// Inflow uniformity
UI1
{
${__surfaceFieldValue}
regionType surface;
name plane1;
operation uniformity;
fields ( U T );
}
// Uniformity after the bend
UI2
{
${__surfaceFieldValue}
regionType surface;
name plane2;
operation uniformity;
fields ( U T );
}
// Inflow uniformity, but use a scalar field for weighting
// Since this field is quite uniform, there should be no difference
T_UI1
{
${__surfaceFieldValue}
regionType surface;
name plane1;
operation weightedUniformity;
weightField T;
fields ( U );
}
// rhoU-weighted uniformity, including weighting U too (weird but possible)
rhoU_UI1
{
${__surfaceFieldValue}
regionType surface;
name plane1;
operation weightedUniformity;
weightField rhoU;
fields ( p rho U rhoU );
}
// rhoU-weighted uniformity
rhoU_UI2
{
${__surfaceFieldValue}
regionType surface;
name plane2;
operation weightedUniformity;
weightField rhoU;
fields ( p rho U rhoU );
}
// ************************************************************************* //