This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/finiteArea/liquidFilmFoam/createFaFields.H

159 lines
3.1 KiB
C++
Raw Normal View History

Info << "Reading field h" << endl;
areaScalarField h
(
IOobject
(
"h",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
Info << "Reading field Us" << endl;
areaVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
edgeScalarField phis
(
IOobject
(
"phis",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fac::interpolate(Us) & aMesh.Le()
);
edgeScalarField phi2s
(
IOobject
(
"phi2s",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fac::interpolate(h*Us) & aMesh.Le()
);
const areaVectorField& Ns = aMesh.faceAreaNormals();
areaVectorField Gs = g - Ns*(Ns & g);
areaScalarField Gn = mag(g - Gs);
// Mass source
areaScalarField Sm
(
IOobject
(
"Sm",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("Sm", dimLength/dimTime, 0)
);
// Mass sink
areaScalarField Sd
(
IOobject
(
"Sd",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("Sd", dimLength/dimTime, 0)
);
areaVectorField Ug
(
IOobject
(
"Sg",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedVector("Ug", dimVelocity, vector::zero)
);
// Surface pressure
areaScalarField ps
(
IOobject
(
"ps",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
rhol*Gn*h - sigma*fac::laplacian(h)
);
// Friction factor
areaScalarField dotProduct
(
aMesh.faceAreaNormals() & (g/mag(g))
);
Info<< "View factor: min = " << min(dotProduct.internalField())
<< " max = " << max(dotProduct.internalField()) << endl;
areaScalarField manningField
(
IOobject
(
"manningField",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
areaScalarField frictionFactor
(
IOobject
(
"frictionFactor",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("one", dimless, 0.01)
);
2016-06-05 18:46:41 +00:00
aMesh.schemesDict().setFluxRequired("h");