graphTest2.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Application
25  graphTest
26 
27 Description
28  Test program for making graphs
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #include "graph.H"
33 
34 using namespace Foam;
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 int main()
39 {
40  scalarField eta(200);
41  scalarField C1mR(eta.size());
42 
43  forAll(eta, i)
44  {
45  eta[i] = scalar(i)/10.0;
46  }
47 
48  scalar C1 = 1.42;
49  scalar eta0 = 4.38;
50  scalar beta = 0.012;
51 
52  C1mR = C1 - ((eta*(1.0 - eta/eta0))/(1.0 + beta*pow(eta, 3.0)));
53 
54  graph("C&1! - R", "C&1! - R", "@h!", eta, C1mR).write
55  (
56  "C1mR",
57  "xmgr"
58  );
59 
60  Info<< "end" << endl;
61 }
62 
63 
64 // ************************************************************************* //
65 
beta
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
Foam::graph
Class to create, store and output qgraph files.
Definition: graph.H:58
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::Info
messageStream Info
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:73
Foam::graph::write
void write(Ostream &, const word &format) const
Write graph to stream in given format.
Definition: graph.C:221
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
graph.H
main
int main()
Definition: graphTest2.C:35