|
[Sponsors] |
January 23, 2017, 03:23 |
IOobject
|
#1 |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Hi
I'm a new user in OpenFoam. plz tell me about what these lines of "creatFields.H" files do: volScalarField T ( IOobject //What is it? ( "omega", runTime.timeName(), mesh, IOobject::MUST_READ, //What's the meaning? IOobject::AUTO_WRITE //What's the meaning? ), mesh //What is it? ); |
|
January 23, 2017, 04:46 |
|
#2 |
Senior Member
|
Hi,
Documentation is useful from time to time: http://cpp.openfoam.org/v4/a01196.html#details And mesh is mesh object created within createMesh.H file, which is included before createFields.H. |
|
January 23, 2017, 05:30 |
|
#3 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
Dear Alexey According to what I have found out, we call the mesh file by using this command. is it true? If yes, why do we need mesh at the middle of reading T from initial condition? another question: I want to change laplacianFoam to solve this equation: laplacian(sai)=omega is this procedure true: 1- defining sai and omega in createFilelds.H: volScalarField sai ( IOobject ( "sai", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); volScalarField omega ( IOobject ( "omega", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); 2- in file mylaplacian.C : /*---------------------------------------------------------------------------*\ ========= | \\ / 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); #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } 3- debuging the code |
||
January 23, 2017, 05:42 |
|
#4 | ||
Senior Member
|
Hi,
Not quite sure I have got what you tried to say, in particular Quote:
Quote:
|
|||
January 24, 2017, 06:59 |
|
#5 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
The second 'mesh' is the reference where your field will be attached to. /mark |
||
January 24, 2017, 08:52 |
|
#6 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
Thanks |
||
Tags |
ioobject |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Read a vector list with IFstream and create IOobject from it | Sylv | OpenFOAM Programming & Development | 1 | October 9, 2017 16:25 |
Creating a new field from terms of the turbulence model | HaZe | OpenFOAM Programming & Development | 15 | November 24, 2014 14:51 |
IOobject Function+interPhaseChangeFoam | nimasam | OpenFOAM | 1 | July 21, 2010 22:56 |
reconstructParMesh not working with an axisymetric case | francesco | OpenFOAM Bugs | 4 | May 8, 2009 06:49 |
Saving patch motion as an IOobject | jaswi | OpenFOAM Running, Solving & CFD | 1 | June 26, 2007 14:07 |