View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001508||OpenFOAM||Bug||public||2015-02-04 17:12||2015-02-06 10:02|
|Summary||0001508: Polynomial boundary condition not awaylable|
|Description||Trying to use polynomial boundary condition for inlet velocity like:|
The output is:
--> FOAM FATAL ERROR:
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.
|Tags||No tags attached.|
||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?|
||I simple try to set z-component of velocity as polynomial. x and y components are zero.|
||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.|
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.
||I have already templated the polynomial DataEntry type, I will push shortly|
Resolved by commit e72b2557d50085a3c089a042fe89b6e502e9de09
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:
((10 0 0) (0 0 0))
((100 0 0) (1 0 0))
|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|