FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

createFields.H

Go to the documentation of this file.
00001     Info<< "Reading financial properties\n" << endl;
00002 
00003     IOdictionary financialProperties
00004     (
00005         IOobject
00006         (
00007             "financialProperties",
00008             runTime.constant(),
00009             mesh,
00010             IOobject::MUST_READ,
00011             IOobject::NO_WRITE
00012         )
00013     );
00014 
00015     dimensionedScalar strike
00016     (
00017         financialProperties.lookup("strike")
00018     );
00019 
00020     dimensionedScalar r
00021     (
00022         financialProperties.lookup("r")
00023     );
00024 
00025     dimensionedScalar sigma
00026     (
00027         financialProperties.lookup("sigma")
00028     );
00029 
00030     dimensionedScalar sigmaSqr = sqr(sigma);
00031 
00032 
00033     Info<< nl << "Reading field V" << endl;
00034 
00035     volScalarField V
00036     (
00037         IOobject
00038         (
00039             "V",
00040             runTime.timeName(),
00041             mesh,
00042             IOobject::MUST_READ,
00043             IOobject::AUTO_WRITE
00044         ),
00045         mesh
00046     );
00047 
00048 
00049     surfaceVectorField Pf
00050     (
00051         IOobject
00052         (
00053             "Pf",
00054             runTime.timeName(),
00055             mesh,
00056             IOobject::NO_READ,
00057             IOobject::NO_WRITE
00058         ),
00059         mesh.Cf()
00060     );
00061 
00062 
00063     volVectorField P
00064     (
00065         IOobject
00066         (
00067             "P",
00068             runTime.timeName(),
00069             mesh,
00070             IOobject::NO_READ,
00071             IOobject::NO_WRITE
00072         ),
00073         mesh.C()
00074     );
00075 
00076 //-    V == max(strike - P.x(), dimensionedScalar("0", V.dimensions(), 0.0));
00077     V == max
00078     (
00079         P.component(Foam::vector::X) - strike,
00080         dimensionedScalar("0", V.dimensions(), 0.0)
00081     );
00082 
00083 
00084     volScalarField delta
00085     (
00086         IOobject
00087         (
00088             "delta",
00089             runTime.timeName(),
00090             mesh,
00091             IOobject::NO_READ,
00092             IOobject::AUTO_WRITE
00093         ),
00094         fvc::grad(V)().component(Foam::vector::X)
00095     );
00096 
00097 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines