initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / electromagnetics / electrostaticFoam / createFields.H
blob64522273b81124124f141993ea46a4810f493410
1     Info<< "Reading physicalProperties\n" << endl;
3     IOdictionary physicalProperties
4     (
5         IOobject
6         (
7             "physicalProperties",
8             runTime.constant(),
9             mesh,
10             IOobject::MUST_READ,
11             IOobject::NO_WRITE
12         )
13     );
15     dimensionedScalar epsilon0
16     (
17         physicalProperties.lookup("epsilon0")
18     );
20     dimensionedScalar k
21     (
22         physicalProperties.lookup("k")
23     );
26     Info<< "Reading field phi\n" << endl;
27     volScalarField phi
28     (
29         IOobject
30         (
31             "phi",
32             runTime.timeName(),
33             mesh,
34             IOobject::MUST_READ,
35             IOobject::AUTO_WRITE
36         ),
37         mesh
38     );
41     Info<< "Reading field rho\n" << endl;
42     volScalarField rho
43     (
44         IOobject
45         (
46             "rho",
47             runTime.timeName(),
48             mesh,
49             IOobject::MUST_READ,
50             IOobject::AUTO_WRITE
51         ),
52         mesh
53     );
56     Info<< "Calculating field rhoFlux\n" << endl;
57     surfaceScalarField rhoFlux
58     (
59         IOobject
60         (
61             "rhoFlux",
62             runTime.timeName(),
63             mesh,
64             IOobject::NO_READ,
65             IOobject::NO_WRITE
66         ),
67         -k*mesh.magSf()*fvc::snGrad(phi)
68     );