|
[Sponsors] |
having trouble reading from either const or 0 directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 25, 2016, 16:20 |
having trouble reading from either const or 0 directory
|
#1 |
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 13 |
Hi folks,
I am (trying) to initializing my variable with file from 0. the specific file being alphaPhi but for some reason the object isn't initialized by that object. (alphaPhi is of type "volScalarField") Here is my snippet. Code:
alphaPhi_ ( volScalarField (IOobject ( "alphaPhi", mesh.time().timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh, dimensionSet(0, 0, 0, 0, 0) )) The (non-empty/symmetry) boundary conditions for this variable are totally different for the file defined in 0 and the one initialized ('uniform'/fixed vs calculated). and I am getting this warning when I run my code (NO ERROR just this warning). Code:
--> FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /home/vasu/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/GeometricField.C at line 108 read option IOobject::MUST_READ or MUST_READ_IF_MODIFIED suggests that a read constructor for field alphaPhi would be more appropriate. Last edited by fedvasu; October 25, 2016 at 19:18. |
|
October 28, 2016, 16:27 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Hi
Actually, the signature of the volScalarField's constructor you are calling is Code:
GeometricField (const IOobject &, const Mesh &, const dimensionSet &, const word &patchFieldType=PatchField< Type >::calculatedType()) You didn't pass anything for this parameter so the default value was used. You'd be better off calling the following constructor Code:
GeometricField (const IOobject &, const Mesh &) |
|
January 4, 2017, 05:55 |
|
#3 | |
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 13 |
Quote:
You are right, one has to use appropriate constructors. However I had to specify the read atrributes (for other reasons), I used READ_IF_PRESENT, attribute, It works for my case. Thanks Zeppo. Regards, |
||
Tags |
initialization, thermophysical model, volscalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Viscoelastic Fluid Flows using OpenFOAM The solver viscoelasticFluidFoam | jovani | OpenFOAM Running, Solving & CFD | 475 | January 13, 2023 09:21 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
[snappyHexMesh] Error in SnappyHexMesh | gooya_kabir | OpenFOAM Meshing & Mesh Conversion | 2 | October 23, 2013 05:41 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 07:16 |
Compiling | morfeus80 | OpenFOAM Installation | 18 | March 16, 2008 02:21 |