Commit Graph

7 Commits

Author SHA1 Message Date
ea3e891dab tutorials/mesh/snappyHexMesh/pipe: Calculate closeness from the pipe wall only 2020-01-27 15:14:11 +00:00
509f15a0c5 snappyHexMesh: Added new experimental region refinement strategy based on the local span
In the new tutorial mesh/snappyHexMesh/pipe the pipe diameter changes by a factor
of 2 but the number of cells across the pipe is specified to be constant along
the length using the new "span" refinement mode in which the number of cells
across the span is set to be at least 40:

    refinementRegions
    {
        pipe
        {
            mode span;
            levels ((1000 2));  // Maximum distance and maximum level
            cellsAcrossSpan 40;
        }
    }

This operates in conjunction with the "pointCloseness" option in surfaceFeatures
which writes a surfacePointScalarField of the local span of the domain.  Note
that the behaviour of this option is critically dependent on the quality of this
field and the surface may need to be re-triangulated more isotropically to
ensure the "pointCloseness" is accurate and representative of the domain and the
required mesh distribution.
2020-01-24 15:19:38 +00:00
76ba65be69 tutorials: Clean up geometry resources
A surface geometry file should be stored in
$FOAM_TUTORIALS/resources/geometry if it is used in multiple cases,
otherwise it should be stored locally to the case. This change enforces
that across all tutorials.
2019-11-01 12:32:33 +00:00
bcc86701bc specieTransfer: Added adsorption boundary condition
An adsorption condition has been added for species mass fraction. This
models a surface on which one or more species deposit at a rate
proportional to the quantity of that specie present. The property that
the rate is assumed proportional to can be chosen to be mass fraction,
mole fraction, molar concentration, or partial pressure.

Example specification in 0/CH4, 0/O2, etc...:

    <patchName>
    {
        type            adsorptionMassFraction;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }

"c" is the constant of proportionality between the property value and
the mass transfer rate. If a specie does not adsorb, this should be set
to zero, or be omitted entirely.

This condition must be supplied for all species, and corresponding
specie transfer boundary conditions must also be applied to velocity and
temperature.

Example specification in 0/U and 0/T:

    <patchName>
    {
        type            specieTransferVelocity;
        value           $internalField;
    }

    <patchName>
    {
        type            specieTransferTemperature;
        value           $internalField;
    }

In addition, the semi-permeable baffle conditions have been refactored
to share functionality with the new adsorption conditions. They can now
also be used with the species-transfer temperature condition, which
corrects an energy error that was present previously. The parameter
"input" has been renamed "property", consistently with the adsorption
entries listed above. Molar concentration has also been added as an
option for the property driving the transfer, so the available controls
are the same as for adsorption.

Example specification in 0/CH4, 0/O2, etc...:

    <patchName>
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     <neighbourPatchName>;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }
    <neighbourPatchName>
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     <patchName>;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }

Velocity and temperature conditions should be set in the same way as for
adsorption.

In order for the temperature condition to function satisfactorily and
not introduce unphysical variations in temperature as a result of the
linearisation to an energy boundary condition, two new base classes for
temperature conditions which explicitly set the parameters of either
gradient or mixed energy conditions have been added. The mixed condition
forms the base of the specieTransferTemperature condition.

As a result of its generalisation, the library has been renamed from
"libsemiPermeableBaffle.so" to "libspecieTransfer.so".
2019-10-31 16:45:14 +00:00
a95c904390 tutorials/propeller: Mesh AMI-s as a face-zone, rather than patches
snappyHexMesh now generates a face-zone for the AMI-s, and createBaffles
and mergeOrSplitPoints -split are used to create the patches. Before,
snappy generated AMI patches directly, which were then converted to
AMI-s with createPatch.

This way, the AMI-s match exactly at the start of the simulation. For
more complicated cases that may be derived from this tutorial, this
could be important.
2018-08-07 13:12:53 +01:00
3055587a5c semiPermeableBaffle: Added two new boundary conditions and a tutorial
Two boundary conditions for the modelling of semi-permeable baffles have
been added. These baffles are permeable to a number of species within
the flow, and are impermeable to others. The flux of a given species is
calculated as a constant multipled by the drop in mass fraction across
the baffle.

The species mass-fraction condition requires the transfer constant and
the name of the patch on the other side of the baffle:

boundaryField
{
    // ...

    membraneA
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     membranePipe;
        c               0.1;
        value           uniform 0;
    }
    membraneB
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     membraneSleeve;
        c               0.1;
        value           uniform 1;
    }
}

If the value of c is omitted, or set to zero, then the patch is
considered impermeable to the species in question. The samplePatch entry
can also be omitted in this case.

The velocity condition does not require any special input:

boundaryField
{
    // ...

    membraneA
    {
        type            semiPermeableBaffleVelocity;
        value           uniform (0 0 0);
    }
    membraneB
    {
        type            semiPermeableBaffleVelocity;
        value           uniform (0 0 0);
    }
}

These two boundary conditions must be used in conjunction, and the
mass-fraction condition must be applied to all species in the
simulation. The calculation will fail with an error message if either is
used in isolation.

A tutorial, combustion/reactingFoam/RAS/membrane, has been added which
demonstrates this transfer process.

This work was done with support from Stefan Lipp, at BASF.
2017-10-19 11:51:38 +01:00
446e5777f0 Add the OpenFOAM source tree 2014-12-10 22:40:10 +00:00