|
[Sponsors] |
Manually entering fvSchemes information into mesh object |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 6, 2014, 16:43 |
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 |
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) 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); 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); Thanks much in advance Anirban |
|
October 8, 2014, 08:26 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
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 |
|
|
|
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 03:57 |
[snappyHexMesh] Propeller mesh not smooth | nortanapura | OpenFOAM Meshing & Mesh Conversion | 0 | May 16, 2014 04:26 |
[snappyHexMesh] Layers:problem with curvature | giulio.topazio | OpenFOAM Meshing & Mesh Conversion | 10 | August 22, 2012 10:03 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |