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

Dictionary operation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 10, 2012, 11:31
Default Dictionary operation
  #1
Member
 
Join Date: Oct 2011
Posts: 36
Rep Power: 5
Peter Müller is on a distinguished road
Hello together

I created an fvPatchField for a mixing plane and now try to make it a bit more general. The idea is to have an fvPatchField for any scalar quantity (k,epsilon,omega,..) that are exchanged in the same way.
What I now need is to pick up the name of the patch that I'm actually on (the updateCoeffs() function). Something like:

word scalarQuantity = this.patch().name()

but like this I receive the name of the patch i have chosen in the boundary-file and not "p", "U","k",... or however the folders are called in the zero-directory.

Does anybody have any idea?

Thanks a lot
Peter Müller is offline   Reply With Quote

Old   January 10, 2012, 13:18
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
Are you looking for this:

word scalarQuantity(dimensionedInternalField().name());
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Old   January 11, 2012, 12:04
Default
  #3
Member
 
Join Date: Oct 2011
Posts: 36
Rep Power: 5
Peter Müller is on a distinguished road
Thanks a lot for your reply. Sadly I was not able to use your suggestion, I always got the error:
scalarQuantity not declared.
I solved the problem in a different way. First I defined a const protected word in the header file of my fvPatchField. The constructor then assigns it a word that I defined in the dictionary.

Have a nice evening
Peter
Peter Müller is offline   Reply With Quote

Old   January 12, 2012, 04:02
Default
  #4
Member
 
Join Date: Oct 2011
Posts: 36
Rep Power: 5
Peter Müller is on a distinguished road
Hello David

Perhaps you know this. I would like to use the lookupPatchField for and kind of Field (scalar, vector, tensor), like

const fvPatchField<Type>& typeValues =
mpPatch_.shadow().lookupPatchField<volField<Type>, Type>(typeName_);

The problem I have is that that it doesn't know a template form volField<Type>, it works fine if i use it for example for vector like

const fvPatchVectorField& vectorValues =
mpPatch_.shadow().lookupPatchField<volVectorField, vector>(vectorName_);

Do you have any idea how I should replace volVectorField?

Thanks Peter
Peter Müller is offline   Reply With Quote

Old   January 12, 2012, 11:59
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
Hi Peter, a volVectorField is actually a GeometricField, but it's templated on more than just Type. One of them is even a template template parameter.

See finiteVolume/fields/surfaceFields/surfaceFieldsFwd.H and /finiteVolume/fields/volFields/volFieldsFwd.H.
__________________
~~~
Follow me on twitter @DavidGaden
marupio 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
writing subDict in a dictionary ubaid OpenFOAM Programming & Development 3 October 25, 2014 17:17
Reading from User Defined Dictionary File brosemu OpenFOAM Running, Solving & CFD 2 March 30, 2009 15:25
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
complex number operation in udf? hongxiao FLUENT 4 April 9, 2005 07:50
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 04:50


All times are GMT -4. The time now is 05:27.