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

Manually entering fvSchemes information into mesh object

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2014, 15:43
Default Manually entering fvSchemes information into mesh object
  #1
New Member
 
Anirban Jana
Join Date: Apr 2010
Location: Pittsburgh, PA, USA
Posts: 19
Rep Power: 16
jans is on a distinguished road
Hi,
For a particular application, I have written a code that creates the mesh object using the constructor
Code:
fvMesh (const IOobject &io, const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< labelList > &allOwner, const Xfer< labelList > &allNeighbour, const bool syncPar=true)
instead of the usual mesh constructor that reads in usual OpenFOAM files.

However, the fvSchemes information are absent from the resulting mesh object, i.e., mesh.schemesDict() will return empty braces {}. I expected this, and thought I can afterwards insert this missing information into the mesh object, but I am unable to find the right method to do this.

Data members like mesh.ddtSchemes_ etc are private and so cannot be edited later. E.g.,
Code:
error #308: member "Foam::fvSchemes::ddtSchemes_" (declared at line 57 of "/work/01255/siliu/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvSchemes.H") is inaccessible
      mesh.ddtSchemes_.add(keyType("ref"),7.0);
mesh.schemesDict() returns a constant pointer, and hence cannot be edited later too. E.g.:
Code:
error: no instance of overloaded function "Foam::dictionary::add" matches the argument list and object (the object has cv-qualifiers that prevent a match)
In file included from icoFoam_iohdf5.C(44):
            argument types are: (Foam::keyType, double)
In file included from icoFoam_iohdf5.C(44):
            object type is: const Foam::dictionary
In file included from icoFoam_iohdf5.C(44):
      mesh.schemesDict().add(keyType("ref"),7.0);
Is there a way to do the above?
Thanks much in advance
Anirban
jans is offline   Reply With Quote

Old   October 8, 2014, 07:26
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
It looks like fvSchemes is hard-coded to read from a file, and if you construct the mesh with an IOobject whose read option is NO_READ, fvSchemes will be an empty dictionary. After it is constructed, you can add entries to its dictionary, but it never uses those... the schemes dictionaries it keeps are copies of the dictionary it had on construction. If you call read(), it will, again, try reading the file, and return false, indicating the read option is NO_READ. The quickest way I can see to bootstrap fvSchemes is to make fvSchemes::read(const dictionary& dict) a public function. Then you create a dictionary, add entries to it, and call mesh.fvSchemes::read(dict);

You may also experience problems with fvSolution.

Good luck!
__________________
~~~
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
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 18 January 15, 2024 02:57
[snappyHexMesh] Propeller mesh not smooth nortanapura OpenFOAM Meshing & Mesh Conversion 0 May 16, 2014 03:26
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43


All times are GMT -4. The time now is 11:36.