diff --git a/openfoam/run/flowAroundCylinder/0/U b/openfoam/run/flowAroundCylinder/0/U index ddad14bc50577f7c7425d05aa9b952ec045281f4..e9fd0f81b2f02de4055c0656714d4d4c1d00384e 100644 --- a/openfoam/run/flowAroundCylinder/0/U +++ b/openfoam/run/flowAroundCylinder/0/U @@ -18,6 +18,8 @@ dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); +#include "../scale" + boundaryField { wall @@ -29,8 +31,19 @@ boundaryField inlet { type codedFixedValue; - value uniform (0.2 0 0); + value uniform ($ubar 0 0); name parabolicChannelInlet; + code #{ + auto y0 = -0.2; // Reference coordinate, lower wall + auto vmean = 0.2; // Mean velocity + //auto vmean = 1; // Mean velocity + + Foam::Field<double> y = patch().Cf().component(vector::Y) - y0; + operator == + ( + vmean*((6.0*y*(0.41-y))/pow(0.41,2))*vector(1,0,0) + ); + #}; } outlet diff --git a/openfoam/run/flowAroundCylinder/system/codeDict b/openfoam/run/flowAroundCylinder/system/codeDict deleted file mode 100644 index 2256d63b019918193e915ba4f5cc015af0cd7436..0000000000000000000000000000000000000000 --- a/openfoam/run/flowAroundCylinder/system/codeDict +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5.0 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object codeDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Note that you must adjust y0 with respect to the origin of -// you coordinate system. - -parabolicChannelInlet -{ - code - #{ - auto y0 = -0.2; // Reference coodinate, lower wall - auto vmean = 300; // Mean velocity - //auto vmean = 1; // Mean velocity - - Foam::Field<double> y = patch().Cf().component(vector::Y) - y0; - operator == - ( - vmean*((6.0*y*(0.41-y))/pow(0.41,2))*vector(1,0,0) - ); - #}; -}