View Issue Details
ID  Project  Category  View Status  Date Submitted  Last Update 

0001508  OpenFOAM  [All Projects] Bug  public  20150204 17:12  20150206 10:02 
Reporter  Svensen  Assigned To  henry  
Priority  normal  Severity  minor  Reproducibility  always 
Status  resolved  Resolution  fixed  
Platform  GNU/Linux  OS  Ubuntu  OS Version  14.04 
Product Version  
Fixed in Version  
Summary  0001508: Polynomial boundary condition not awaylable  
Description  Trying to use polynomial boundary condition for inlet velocity like: inlet { 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: > FOAM FATAL ERROR: Unknown DataEntry type polynomial for DataEntry uniformValue Valid DataEntry types are: 5 ( CompatibilityConstant constant csvFile table tableFile ) From function DataEntry<Type>::New(const word&, const dictionary&) in file /home/sergey/OpenFOAM/OpenFOAM2.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 zcomponent 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*(xx0)^2 + b*(yy0)^2 + c*(zz0)^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(xx0) + datay>value(yy0) + datay>value(zz0); flowvector = magnitude * direction; I reported sortof 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 in OpenFOAMdev 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: inlet { type uniformFixedValue; uniformValue polynomial ( ((10 0 0) (0 0 0)) ((100 0 0) (1 0 0)) ); } 
Date Modified  Username  Field  Change 

20150204 17:12  Svensen  New Issue  
20150204 17:30  henry  Note Added: 0003671  
20150204 18:05  Svensen  Note Added: 0003672  
20150204 18:34  henry  Note Added: 0003673  
20150206 09:29  wyldckat  Note Added: 0003706  
20150206 09:35  henry  Note Added: 0003707  
20150206 10:02  henry  Note Added: 0003708  
20150206 10:02  henry  Status  new => resolved 
20150206 10:02  henry  Resolution  open => fixed 
20150206 10:02  henry  Assigned To  => henry 