introvoyz042's picture
Migrated from GitHub
5a600cf verified
Raw History Blame Contribute Delete
1.36 kB
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "constant";
object alphaInternalField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
internalField
{
type coded;
name $name;
y0 $y0;
y1 $y1;
evaluate
#{
const vectorField& Ci(C);
const scalarField x(Ci.component(vector::X));
const scalarField y(Ci.component(vector::Y));
const scalar x0 = 0.032;
const scalar x1 = 0.064;
const scalar x2 = 0.128;
const scalar x3 = 0.224;
const scalarField f
(
pos(x - x0)*pos(x1 - x)*(x - x0)/(x1 - x0)
+ pos(x - x1)*pos(x2 - x)
+ pos(x - x2)*pos(x3 - x)*(x3 - x)/(x3 - x2)
);
field.primitiveFieldRef() = 0.5*pos(y - $y0)*pos($y1 - y)*f;
#};
};
// ************************************************************************* //