|
[Sponsors] |
January 10, 2012, 10:31 |
Dictionary operation
|
#1 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 14 |
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 |
|
January 10, 2012, 12:18 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Are you looking for this:
word scalarQuantity(dimensionedInternalField().name());
__________________
~~~ Follow me on twitter @DavidGaden |
|
January 11, 2012, 11:04 |
|
#3 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 14 |
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 |
|
January 12, 2012, 03:02 |
|
#4 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 14 |
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 |
|
January 12, 2012, 10:59 |
|
#5 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
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 |
|
|
|
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 |