|
[Sponsors] |
January 23, 2017, 03:15 |
stream failure while reading header on line
|
#1 |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Hi
I made some changes on "laplacian solver" and I wanted to solve a simple problem. but I saw this error: stream failure while reading header on line 55 of file "/home/drnili/Desktop/laplacianFoam/example/laplacianFoam/test/0/sai" for essential objectsai Of course the file "sai" in "0" folder doesn't have 55 lines!! Could you please help me? |
|
January 23, 2017, 04:51 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
If you open any of OpenFoam's case files (e.g. constant/transportProperties, but any file will do), you'll find a header that looks somewhat like:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Therefore, you should include the above header (but then adapted for your file, of course). Also mind the OpenFoam version, so do not simply copy my header above, but rather take a header from one of your other case files. |
|
January 23, 2017, 05:17 |
|
#3 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
Dear Kevin Thanks for your answer. But I copy a similar header (e.g. the header of T in "0" folder) for the "sai" parameter. so what is the problem? |
||
January 23, 2017, 05:31 |
|
#4 |
Senior Member
|
Hi,
Surely game called "Guess what I have done wrong!" is fascinating and people here like to play it VERY much. Yet, it would be MUCH easier if: 1. You tell a little bit more about `some changes on "laplacian solver"`. 2. Post your sai file. |
|
January 23, 2017, 05:35 |
|
#5 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
I sent it to you on other question. Regards |
||
January 23, 2017, 05:43 |
|
#6 |
Senior Member
|
Hi,
In other question you have posted your modifications. This question is about problem with sai file. And there is no sai file in this thread. |
|
January 23, 2017, 06:20 |
|
#7 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createFields.H" simpleControl simple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating temperature distribution\n" << endl; while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; while (simple.correctNonOrthogonal()) { solve(fvm::laplacian(sai) == omega); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************** *********************** // This is the "createFields.H" : Info<< "Reading field sai\n" << endl; volScalarField sai ( IOobject ( "sai", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field omega\n" << endl; volScalarField omega ( IOobject ( "omega", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field gradU\n" << endl; volTensorField gradU ( IOobject ( "gradU", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); forAll(omega, counter) { omega[counter] = gradU[counter].component(tensor::XY) - gradU[counter].component(tensor::YX); } Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); Info<< "Reading diffusivity DT\n" << endl; dimensionedScalar DT ( transportProperties.lookup("DT") ); |
||
January 23, 2017, 07:57 |
|
#8 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
Thank you. I got the "gradU" file from the "100" folder of other solution (it means the results of that solution at 100 second) and paste it in the "0" folder of present problem as an initial condition. The problem was run but no result folder is written in the folder of problem!! why? Regards |
||
January 23, 2017, 09:37 |
|
#9 |
Senior Member
|
Cause you do not call runTime.write(). And it seems, you are playing another game called "Randomly put curly brackets and see if your code can be compiled".
|
|
January 24, 2017, 08:50 |
|
#10 |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
||
Tags |
header, stream failure |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 | keepfit | ParaView | 60 | September 18, 2013 04:23 |
OpenFOAM15 installables are incomplete problem with paraFoam | tryingof | OpenFOAM Bugs | 17 | December 7, 2008 05:41 |
Problem of compilation OF 14Allwmake command not found | erik_d | OpenFOAM Bugs | 13 | September 13, 2008 22:45 |
[blockMesh] BlockMeshmergePatchPairs polyTopoChanger | benru | OpenFOAM Meshing & Mesh Conversion | 3 | June 29, 2008 22:24 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |