initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / financial / financialFoam / createFields.H
blob6cdbbe2bde3c24d5d5a49f631a0fbd36db924cf9
1     Info<< "Reading financial properties\n" << endl;
3     IOdictionary financialProperties
4     (
5         IOobject
6         (
7             "financialProperties",
8             runTime.constant(),
9             mesh,
10             IOobject::MUST_READ,
11             IOobject::NO_WRITE
12         )
13     );
15     dimensionedScalar strike
16     (
17         financialProperties.lookup("strike")
18     );
20     dimensionedScalar r
21     (
22         financialProperties.lookup("r")
23     );
25     dimensionedScalar sigma
26     (
27         financialProperties.lookup("sigma")
28     );
30     dimensionedScalar sigmaSqr = sqr(sigma);
33     Info<< nl << "Reading field V" << endl;
35     volScalarField V
36     (
37         IOobject
38         (
39             "V",
40             runTime.timeName(),
41             mesh,
42             IOobject::MUST_READ,
43             IOobject::AUTO_WRITE
44         ),
45         mesh
46     );
49     surfaceVectorField Pf
50     (
51         IOobject
52         (
53             "Pf",
54             runTime.timeName(),
55             mesh,
56             IOobject::NO_READ,
57             IOobject::NO_WRITE
58         ),
59         mesh.Cf()
60     );
63     volVectorField P
64     (
65         IOobject
66         (
67             "P",
68             runTime.timeName(),
69             mesh,
70             IOobject::NO_READ,
71             IOobject::NO_WRITE
72         ),
73         mesh.C()
74     );
76 //-    V == max(strike - P.x(), dimensionedScalar("0", V.dimensions(), 0.0));
77     V == max
78     (
79         P.component(Foam::vector::X) - strike,
80         dimensionedScalar("0", V.dimensions(), 0.0)
81     );
84     volScalarField delta
85     (
86         IOobject
87         (
88             "delta",
89             runTime.timeName(),
90             mesh,
91             IOobject::NO_READ,
92             IOobject::AUTO_WRITE
93         ),
94         fvc::grad(V)().component(Foam::vector::X)
95     );