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

Dictionary operation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2012, 10:31
Default Dictionary operation
  #1
Member
 
Join Date: Oct 2011
Posts: 37
Rep Power: 14
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, 12:18
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
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, 11:04
Default
  #3
Member
 
Join Date: Oct 2011
Posts: 37
Rep Power: 14
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, 03:02
Default
  #4
Member
 
Join Date: Oct 2011
Posts: 37
Rep Power: 14
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, 10:59
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
complex number operation in udf? hongxiao FLUENT 5 June 14, 2017 14:11
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 06:51
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 03:50


All times are GMT -4. The time now is 00:06.