|
[Sponsors] |
November 17, 2010, 15:57 |
volScalarField
|
#1 |
Member
Diego Villa
Join Date: Mar 2010
Location: Genova Italy
Posts: 37
Rep Power: 16 |
HI all,
I have a little problem with a volScalarField, I have create that field in a class where is not defined the runTime object, but I want create a volScalarField that than I fill in that way: __________________________________________________ ______ volScalarField alfa ( IOobject ( "alfa", fileName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), mesh_ ); forAll(cells, i) { label lab=cells[i]; if(IntCell_[lab]) alfa.internalField()[lab]=1; else alfa.internalField()[lab]=0; } __________________________________________________ ______ All can be compiled but when I run the solver that use that class I have that error: __________________________________________________ ______ /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.x | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.x-a654f2c8b4fb Exec : MYMRFSimpleFoam Date : Nov 17 2010 Time : 15:30:43 Host : salaria PID : 11695 Case : /home/diego/OpenFOAM/diego-1.7.x/run/VerificaMRF/SimplePropeller nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting RAS turbulence model kOmegaSST kOmegaSSTCoeffs { alphaK1 0.85034; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.85616; gamma1 0.5532; gamma2 0.4403; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; c1 10; } Starting time loop Time = 1 --> FOAM FATAL ERROR: NO_READ specified for read-constructor of object alfa of class IOobject From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 46. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) in "/home/diego/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/home/diego/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so" #2 Foam::regIOobject::readStream() in "/home/diego/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so" #3 Foam::regIOobject::readStream(Foam::word const&) in "/home/diego/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libOpenFOAM.so" #4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/diego/OpenFOAM/diego-1.7.x/applications/bin/linux64GccDPOpt/MYMRFSimpleFoam" #5 Foam::MRFZone::correctVelocityEquation(Foam::fvMat rix<Foam::Vector<double> >&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&) const in "/home/diego/OpenFOAM/diego-1.7.x/applications/bin/linux64GccDPOpt/MYMRFSimpleFoam" #6 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/diego/OpenFOAM/diego-1.7.x/applications/bin/linux64GccDPOpt/MYMRFSimpleFoam" #7 main in "/home/diego/OpenFOAM/diego-1.7.x/applications/bin/linux64GccDPOpt/MYMRFSimpleFoam" #8 __libc_start_main in "/lib/libc.so.6" #9 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/diego/OpenFOAM/diego-1.7.x/applications/bin/linux64GccDPOpt/MYMRFSimpleFoam" Aborted __________________________________________________ ______ Someone have an idea on which is the problem? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create initiate a volScalarField p without reading from disk NO_READ does not seem to work | dbxmcf | OpenFOAM Running, Solving & CFD | 14 | March 25, 2022 06:08 |
if-loop, volScalarField comparison | volker | OpenFOAM | 7 | March 6, 2020 20:03 |
Problems with creating a volScalarField | georlade | OpenFOAM Programming & Development | 4 | December 4, 2016 12:31 |
Fill a volScalarField | DiegoNaval | OpenFOAM Programming & Development | 6 | November 19, 2010 09:26 |
dimensioned volScalarField | lions85 | OpenFOAM | 1 | November 12, 2009 02:41 |