financialFoam.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "fvCFD.H"
00034 #include "writeCellGraph.H"
00035 #include "OSspecific.H"
00036
00037
00038
00039 int main(int argc, char *argv[])
00040 {
00041 #include "setRootCase.H"
00042
00043 #include "createTime.H"
00044 #include "createMesh.H"
00045 #include "createFields.H"
00046
00047
00048
00049 Info<< nl << "Calculating value(price of comodities)" << endl;
00050
00051 surfaceScalarField phi("phi", (sigmaSqr - r)*(Pf & mesh.Sf()));
00052
00053 volScalarField DV("DV", 0.5*sigmaSqr*sqr(P.component(Foam::vector::X)));
00054
00055 Info<< "Starting time loop\n" << endl;
00056
00057 while (runTime.loop())
00058 {
00059 delta == fvc::grad(V)().component(Foam::vector::X);
00060
00061 solve
00062 (
00063 fvm::ddt(V)
00064 + fvm::div(phi, V)
00065 - fvm::Sp(fvc::div(phi), V)
00066 - fvm::laplacian(DV, V)
00067 ==
00068 - fvm::Sp(r, V)
00069 );
00070
00071 runTime.write();
00072
00073 if (runTime.outputTime())
00074 {
00075 writeCellGraph(V, runTime.graphFormat());
00076 writeCellGraph(delta, runTime.graphFormat());
00077 }
00078
00079 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00080 << " ClockTime = " << runTime.elapsedClockTime() << " s"
00081 << nl << endl;
00082 }
00083
00084 Info<< "End\n" << endl;
00085
00086 return 0;
00087 }
00088
00089
00090
Copyright © 2000-2009 OpenCFD Ltd