CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Deffining New Patch Field Type

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 9, 2011, 09:10
Default Deffining New Patch Field Type
  #1
Member
 
Dan
Join Date: Oct 2010
Location: UK
Posts: 41
Rep Power: 6
dandalf is on a distinguished road
Hi All
I have been trying to define a new velocity patch field type, based on timeVaryingInletOutlet under openFoam 1.7.0 for use with pimpleDyMFoam

I copied and pasted the files, replaced all instances of "timeVaryingInletOutlet" with "myTimeVaryingInletOutlet"

Then altered the code slightly so that instead of taking the refValue from a time data series, it takes it from a ".dat" file.

The code compiled and my new patch field appeared in the list headed
Valid patchField types are :
However when I attempted to run it I got the following error,
Code:
Reading field U

pimpleDyMFoam: symbol lookup error: /home/droper1/OpenFOAM/droper1-1.7.0/lib/linux64GccDPOpt/libmytvfriv.so: undefined symbol: _ZN4Foam43myTimeVaryingUniformInletOutletFvPatchFieldINS_6VectorIdEEEC1ERKNS_7fvPatchERKNS_16DimensionedFieldIS2_NS_7volMeshEEERKNS_10dictionaryE
Then it spat me back into the terminal.

Can anybody help shed some light on what I'm doing wrong?
Any help would be greatly appreciated.

Daniel
dandalf is offline   Reply With Quote

Old   May 10, 2011, 05:11
Default
  #2
Member
 
Dan
Join Date: Oct 2010
Location: UK
Posts: 41
Rep Power: 6
dandalf is on a distinguished road
Its Ok... I fixed it.. still not sure how?
dandalf is offline   Reply With Quote

Old   May 10, 2011, 12:20
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 673
Rep Power: 17
mturcios777 will become famous soon enough
I may be doing something similar in the future, so it would be interesting as to how you fixed it. Between getting this problem and having it work, what steps did you take. List as many as you can remember, it could be something as simple as the command you typed to compile being slightly different
mturcios777 is offline   Reply With Quote

Old   May 11, 2011, 06:35
Default
  #4
Member
 
Dan
Join Date: Oct 2010
Location: UK
Posts: 41
Rep Power: 6
dandalf is on a distinguished road
After my first failed attempt I started from scratch, but I will go through my successful attempt

Ok Here goes.

The first thing I did was copy and paste the whole source file into my openFoam user directory, I then created the make folder, ensuring that the library that the original was located in was included in the options file. And in this case the files folder listed only the file ending in ..."s.C".

I then renamed each file and used search and replace function in my text editor to change all instances of "timeVaryingUniformInputOutput" to "myTimeVaryingUniformInputOutput"

Then it was a case of deleting the time series variable from the header file, and replacing it with a fileNameVariable, and in my case a scalar.

In the .C source file I then included "IFstream.H"

and instigated my two new variables in each of the constructors, following the pattern of the time series variables, i.e replacing timeSeries_() with DataFile_("0.dat");
and timeSeries_(ptf.timeSeries_) with DataFile_(ptf.DataFile_) etc..

in updateCoeffs()
it took me some time to realize that refValue() is a vector field not a vector so I copied and pasted the dictionary constructor from the InputOutput parch class, and changed it so that the dictionary comes from the IFstream, I used the scalar from earlier to store the size of the vector field needed.

Finally I altered the write function to write the data file name instead of the time series.

it was then just a case of getting my runtime function to output a file with the desired velocity at each time iteration, then link my boundary patch to outputted file.

It seems to work as long as I create an the velocity file before starting.

There is probably a much more elegant way of doing all this. I hope this helps..
Attached Files
File Type: c myTimeVaryingUniformInletOutletFvPatchField.C (4.1 KB, 19 views)
dandalf is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 123 April 9, 2013 09:53
Fluent msh and cyclic boundary cfdengineering OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 January 25, 2013 03:28
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 17:08
buoyantSimpleRadiationFoam msarkar OpenFOAM 0 February 15, 2010 06:22
Problems with Turbulence Modeling ezsoal OpenFOAM Running, Solving & CFD 4 November 26, 2009 15:12


All times are GMT -4. The time now is 19:49.