View Issue Details

IDProjectCategoryView StatusLast Update
0001508OpenFOAMBugpublic2015-02-06 10:02
ReporterSvensen Assigned Tohenry  
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Summary0001508: Polynomial boundary condition not awaylable
DescriptionTrying to use polynomial boundary condition for inlet velocity like:
    type uniformFixedValue;
    uniformValue polynomial
        (0.46559 0)
        (-4.2037 1)
        (120.13 2)
        (-643.32 3)
        (-235.15 4)
        (12594 5)
        (-48153 6)
        (88742 7)
        (-89600 8)
        (1 9)
        (-10437 10)

The output is:
Unknown DataEntry type polynomial for DataEntry uniformValue

Valid DataEntry types are:

    From function DataEntry<Type>::New(const word&, const dictionary&)
    in file /home/sergey/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/DataEntryNew.C at line 65.
TagsNo tags attached.



2015-02-04 17:30

manager   ~0003671

DataEntry type polynomial is provided for scalars, it is not clear how it should be applied to vector. Would you like the polynomial coefficients to be vectors, specify 3 separate polynomials or specify the kind of DataEntry separately for each component?


2015-02-04 18:05

reporter   ~0003672

I simple try to set z-component of velocity as polynomial. x and y components are zero.


2015-02-04 18:34

manager   ~0003673

It is not clear how you would like the BC enhanced to support your requirements in a general framework. If you want a BC which does just only what you currently need you could write one based on the funcionality provided.


2015-02-06 09:29

updater   ~0003706

After reading this report, took me a while to remember that this is one of those features that people usually ask about on the forum, usually for a paraboloid inlet flow profile.

To make such a feature truly generic, then it's just a matter of thinking of the general 3D paraboloid'ish expression:

  d = a*(x-x0)^2 + b*(y-y0)^2 + c*(z-z0)^2

In other words, we'll need 5 variables for a vector patch field:

  - xpolynom - the polynomial expression (DataEntry) for the X terms
  - ypolynom - the polynomial expression (DataEntry) for the Y terms
  - zpolynom - the polynomial expression (DataEntry) for the Z terms
  - offset - the offset vector (x0 y0 z0)
  - direction - the vector for the 3D flow profile, over which the magnitude is extended. Not being normalized could come in handy for having an additional scaling factor for each axis.

Beyond this, it's possible to create a lot of derivative classes:
  - scalar patch field is just a matter of omitting the direction option.
  - be trigonometrical, cylindrical and spherical coordinates

The base field would be something like:

   magnitude = datax->value(x-x0) + datay->value(y-y0) + datay->value(z-z0);

   flowvector = magnitude * direction;

I reported sort-of recently about another patch field that has a structure that could be partially reused for this... ah, issue #1415, where fanFvPatchField is a template class with specializations. This can also be used for this new class, in the sense that the specializations can be implemented for scalar and vector and possibly tensor.


2015-02-06 09:35

manager   ~0003707

I have already templated the polynomial DataEntry type, I will push shortly


2015-02-06 10:02

manager   ~0003708

Resolved by commit e72b2557d50085a3c089a042fe89b6e502e9de09

in OpenFOAM-dev

PolynomialEntry: Templated polynomial DataEntry to support all basic field types from scalar to tensor.

This allows polynomial functions for e.g. velocity to be specified in the uniformFixedValue BC
    Consider a linear function for Ux(t) with Uy and Uz = 0:
            type uniformFixedValue;
            uniformValue polynomial
                ((10 0 0) (0 0 0))
                ((100 0 0) (1 0 0))

Issue History

Date Modified Username Field Change
2015-02-04 17:12 Svensen New Issue
2015-02-04 17:30 henry Note Added: 0003671
2015-02-04 18:05 Svensen Note Added: 0003672
2015-02-04 18:34 henry Note Added: 0003673
2015-02-06 09:29 wyldckat Note Added: 0003706
2015-02-06 09:35 henry Note Added: 0003707
2015-02-06 10:02 henry Note Added: 0003708
2015-02-06 10:02 henry Status new => resolved
2015-02-06 10:02 henry Resolution open => fixed
2015-02-06 10:02 henry Assigned To => henry