|
[Sponsors] |
Reading in Custom Field for Multiple Blocks using blockMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 2, 2018, 21:02 |
Reading in Custom Field for Multiple Blocks using blockMesh
|
#1 |
New Member
Join Date: Jun 2018
Posts: 3
Rep Power: 8 |
Hello,
I'm new here and I've looked through several forums and google searches with no luck on this issue, but feel free to redirect me if I have overlooked something. I am trying to read in a custom volScalarField, "R", using blockMesh. Should be pretty straight forward but I have a few blocks and I want a different value of "R" in one of the blocks. See the code snippets below. blockMeshDict: Code:
. . blocks ( hex ( . . . ) Region_0 ( . . . ) simpleGrading ( . . . ) hex ( . . . ) Region_1 ( . . . ) simpleGrading ( . . . ) . . . hex ( . . . ) Region_5 ( . . . ) simpleGrading ( . . . ) ); . . Code:
. . FoamFile { version 2.0; format ascii; class volScalarField; object R; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; internalField { Region_0 { type fixedValue; value 0; } Region_1 { type fixedValue; value 0; } . . . Region_5 { type fixedValue; value 10E10; } } . . . Code:
. . Info <<"Reading field R\n" <<endl; volScalarField R ( IOobject ( IOobject::groupName("R",continuousPhaseName), runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); . . Code:
Reading field R --> FOAM FATAL IO ERROR: Attempt to return dictionary entry as a primitive file: . . . /0/R.internalField from line 23 to line 54. From function virtual Foam::ITstream& Foam::dictionaryEntry::stream() const in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 83. FOAM aborting Any help is appreciated! |
|
July 3, 2018, 11:28 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
If you're only trying to set the values of R in one of your regions, why not try the setFields utility? The utility allows you to set the values of a field within a subsection of cells -- selected with boxToCell, for example. Here is a link to an example from one of the tutorials : https://github.com/OpenFOAM/OpenFOAM.../setFieldsDict.
Caelan |
|
July 5, 2018, 19:10 |
|
#3 |
New Member
Join Date: Jun 2018
Posts: 3
Rep Power: 8 |
Hi Caelan,
That seems to do the trick for this case! Thanks for the help Austin |
|
Tags |
blockmeshdict, createfields.h, volscalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[Other] dynamicTopoFVMesh and pointDisplacement | RandomUser | OpenFOAM Meshing & Mesh Conversion | 6 | April 26, 2018 08:30 |
[Commercial meshers] Problem converting fluent mesh | vinz | OpenFOAM Meshing & Mesh Conversion | 28 | October 12, 2015 07:37 |
AMI memory leak? | MichiB | OpenFOAM Programming & Development | 14 | August 1, 2015 19:18 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |