|
[Sponsors] |
February 4, 2016, 14:54 |
Usage of DataEntry
|
#1 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 |
I have programmed a simple mesh Motion Solver. It currently moves a patch with constant velocity "vel". I now want to extend this velocity to be a function of time. The DataEntry class seems to be the way to go. I want to supply a table with time and velocity inside my dynamicMeshDict and use those for interpolation.
My first attempt is adding Code:
#include "DataEntry.H" Code:
const DataEntry<vector> vel ( motionDict_.lookup("vel") ); Code:
forAll(patchPoints, ppI) { np[patchPoints[ppI]] += vel.value(time().value())*time().deltaTValue(); } Code:
--> FOAM FATAL ERROR: Not implemented From function Type Foam::DataEntry<Type>::value(const scalar) const in file /opt/openfoam30/src/OpenFOAM/lnInclude/DataEntry.C at line 73. FOAM aborting |
|
February 5, 2016, 02:31 |
|
#2 |
Senior Member
|
Hi,
value method is implemented only in children of DataEntry class (CSV, Constant, Table, etc.). You can find example of usage in $FOAM_SRC/mesh/extrudeModel/radial. |
|
February 6, 2016, 13:19 |
|
#3 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 |
Thank you for the quick reply alexeym. Because of your input I now include InterpolationTable.H instead of DataEntry.H, which then itself includes it. I also had to make minor adjustments to the rest of the code. With this i can now provide a file with tabulated values. The problem is therefore solved.
I would nevertheless like to have the flexability boundary conditions have. Like choosing between table polynom etc. Is this not possible in this scope? |
|
February 6, 2016, 16:50 |
|
#4 |
Senior Member
|
Well, if radial example is not quite convincing, you can take a look at $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue boundary condition.
Since you would like user to select between CSV, Polynomial, etc. you need: 1. Include DataEntry.H 2. Declare property as autoPtr<DataEntry<vector> > vel_ 3. Use DataEntry::New(...) (http://foam.sourceforge.net/docs/cpp...be2ac84884862f) to create vel_ property. You can find example of DataEntry construction on line 87 of uniformFixedValueFvPatchField.C. And you can find variants of uniformFixedValue usage (i.e. dictionary describing DataEntry) in Code:
$ cd $FOAM_TUTORIALS $ grep -lr uniformFixedValue * incompressible/pimpleDyMFoam/movingCone/0/pointMotionUx incompressible/simpleFoam/turbineSiting/0.org/U incompressible/simpleFoam/turbineSiting/0.org/p lagrangian/reactingParcelFilmFoam/hotBoxes/0.org/U multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/U multiphase/interPhaseChangeDyMFoam/propeller/0.org/U multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.org/pointDisplacement |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New workstation for different usage scenarios - CPU and RAM | natem | Hardware | 6 | August 7, 2013 02:47 |
Boosting CPU usage | earlybird | FLUENT | 2 | November 2, 2012 10:32 |
DataEntry class implementation | calim_cfd | OpenFOAM Programming & Development | 0 | March 2, 2012 05:11 |
BoF-Group: interFoam - documentation and usage | unnikrsn | OpenFOAM Running, Solving & CFD | 0 | November 12, 2011 22:39 |
OpenFOAM Solver/BC usage description | murrayjc | OpenFOAM | 3 | August 25, 2009 04:48 |