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/multiphase/porousInterFoam/createPorousZones.H

34 lines
716 B
C
Raw Normal View History

2012-04-25 22:55:05 +00:00
porousZones pZones(mesh);
// Creates the porosity field for MULES
volScalarField porosity
(
IOobject
(
"porosity",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("NULL", dimless, 1.0),
"zeroGradient"
);
forAll( pZones, zoneI )
{
const label & zoneId( pZones[zoneI].zoneId() );
const labelList & cells(mesh.cellZones()[zoneId]);
const scalar & zonePorosity( pZones[zoneI].porosity() );
forAll( cells, cellI )
{
porosity[cells[cellI]] = zonePorosity;
}
}
porosity.write();