|
[Sponsors] |
--> FOAM FATAL IO ERROR: problem while reading header for object U |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
Brett
Join Date: May 2013
Posts: 217
Rep Power: 14 ![]() |
Hi fellow Foamers.
This one's a real head scratcher. So I wrote a batch script in sublime text editor with settings: view > syntax > batch view > line endings > Unix The script is meant to change the volumetric flow rate of a base project that it's copied. See script: rem #!/bin/bash @echo off for /l %%x in (5, 5, 15) do ( echo Starting simulation %%x cp -rf att_test att_test_%%x powershell -Command "(gc att_test_%%x/0/U) -replace 'volumetricFlowRate 25;', 'volumetricFlowRate %%x;' | Out-File att_test_%%x/0/U" cd att_test_%%x echo pwd simpleFoam cd .. ) echo All done It copies the base project, changes the volumetric flow rate value and executes simpleFoam. However it comes back with this error: Reading field U --> FOAM Warning : From function bool Foam::IOobject::readHeader(Foam::Istream&) in file db/IOobject/IOobjectReadHeader.C at line 88 Reading "C:/OpenFOAM/18.10/AUBD501827-dev/run/att_test_5/0/U" at line 1 First token could not be read or is not the keyword 'FoamFile' Check header is of the form: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | |*---------------------------------------------------------------------------*| |* OpenFOAM for Windows 18.10 (v1) *| |* Built by CFD Support, www.cfdsupport.com (based on Symscape). *| \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // --> FOAM FATAL IO ERROR: problem while reading header for object U file: C:/OpenFOAM/18.10/AUBD501827-dev/run/att_test_5/0/U at line 1. From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::rea dStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 540. FOAM exiting So I copied the suggested header format into one of the copied projects and tried to run it by itself. Same error. I noticed that the suggested header file is different from header files I've used on other projects, so I tried that header file, again no luck. I've also tried closing the OpenFoam shell and re loading it, no luck. Any thoughts???? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 70
Rep Power: 17 ![]() |
Make sure the encoding of the faulty file "att_test_5/0/U" is UTF-8 and not UTF-8-BOM [1]. Notepad++ displays encoding in the bottom right corner. This change solved for me the same problem with another dict in OpenFOAM v2012.
Maybe too late for you, but hopefully useful for future readers! [1]: https://en.wikipedia.org/wiki/Byte_order_mark |
|
![]() |
![]() |
![]() |
Tags |
openfoam 1806, shell command, syntax error, unix |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 05:18 |
Incompatible dimensions for operation | ruben23 | OpenFOAM Running, Solving & CFD | 2 | June 12, 2015 05:14 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |