Commit Graph

1940 Commits

Author SHA1 Message Date
8217f0d4ac solidificationMeltingSource: Changed default for alpha1e_ to 0.0
Resolves bug-report https://bugs.openfoam.org/view.php?id=2931
2018-05-14 16:48:34 +01:00
e7a9581d79 particle: Added trackToCell function
This is equivalent to track to face, but it additionally crosses
internal faces at the end of the track to move into the next cell. This
is a common procedure when performing post-processing tracking
operations.
2018-05-14 15:16:13 +01:00
5cca0a119a EDC: Corrected documentation 2018-05-11 16:24:22 +01:00
c60fb65681 NamedEnum: Check range of names array index to avoid warning from gcc 2018-05-11 16:10:50 +01:00
1f96fbc89f mappedPatchBase: Added diagnostic message in the case the mapping fails 2018-05-11 10:33:38 +01:00
d501e87ec2 rigidBodyDynamics: Added some 0-DoF joints
The new "rigid" joint permits no motion at all, "function" specifies the
position of the joint as a function of the position of it's parent, and
"functionDot" specifies the position of the joint as a function of the
velocity of it's parent. Note that the functions are applied uniformly
to each component of the parent joint's position/motion. Example
specifications are shown below.

    joint
    {
        type    rigid;
    }

    joint
    {
        type    function;
        function table ((-1 0) (0 1) (1 0));
    }

    joint
    {
        type    functionDot;
        function table ((-1 0) (0 1) (1 0));
    }

This work was supported by Caitlin Worden Hodge, at Zyba
2018-05-09 16:03:16 +01:00
f39bf2d84d rigidBodyDynamics: Added support for 0-DoF joints
This allows for fixed joints or joints which completely constrain the
motion as a function of some other aspect of the model. The latter has
also been facilitaed by adding a reference to the rigid body model to
the base joint class.
2018-05-09 15:15:23 +01:00
3682e7ad9d Added support for gcc-8.1 2018-05-08 19:57:47 +01:00
c3be52bcd6 Corrected 'Class' entries in headers
Using script provided by Bruno Santos
See https://bugs.openfoam.org/view.php?id=2919
2018-05-07 14:18:44 +01:00
4ba4613eca regionModels: Corrected 'Class' entries in headers
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2919
2018-05-07 13:41:30 +01:00
c8562a14f2 energyJumpFvPatchScalarField.H: Removed unused #include
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2919
2018-05-07 13:37:32 +01:00
400cd4a889 wmake options files: Removed -I options referring to non-existent directories
Resolves bug-report https://bugs.openfoam.org/view.php?id=2917
2018-05-04 17:16:46 +01:00
19efd8e696 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-05-03 16:02:58 +01:00
3c000dabec wmake, wmakeLnIncludeAll: Automated the creation of the lnInclude directories based on dependency
Now lnInclude are created as required by the presence of entries in the EXE_INC
variable in the Make/options file.  This removes the need for calling
wmakeLnInclude in various Allwmake files to ensure the existence of the
lnInclude directories prior to compilation of dependent libraries.
2018-05-03 15:59:50 +01:00
bad26bee71 solidificationMeltingSource: Added support for non-isothermal phase-change
Requires the following changes to the corresponding entry in the fvOptions dictionary:

   i.  Use Tsol instead Tmelt as previously to define melting temperature in
       isothermal phase change (for pure substance or eutectic mixture -> Tsol = Tliq);

   ii. Optionally define new Tliq > Tsol to consider liquidus temperature in
       non-isothermal phase change (for miscible mixture), where previous
       defined Tsol defines solidus temperature;

   iii. optionally define also alpha1e to consider max eutectic melt
        fraction (that should be the percentage of solvent phase changed from
        initial to eutectic liquid concentration) in partially isothermal (at
        Tsol=Teutectic) and non-isothermal (from Tsol=Teutectic to Tliq) phase
        change (for solid not miscible mixture) (alpha1e=0 -> pure substance;
        alpha1e=1 -> eutectic mixture that is strictely not permitted).

Description
    This source is designed to model the effect of solidification and melting
    processes, e.g. windhield defrosting.

    The isotherm phase change occurs at the melting temperature, \c Tsol (= \c
    Tliq). The not isotherm phase change occurs between solidus and liquidus
    temperature, \c Tsol < \c Tliq respectively, as long as the melt fraction is
    greater than the max eutectic melt fraction, \c alpha1e (0 =
    pure_substance, 1 = eutectic_mixture is not permitted) , i.e. eutectic to
    initial solvent concentration difference, where a linear eutectic melt
    fraction to temperature relation is considered - lever rule.

    The presence of the solid phase in the flow field is incorporated into the
    model as a momentum porosity contribution; the energy associated with the
    phase change is added as an enthalpy contribution.

    References:
    \verbatim
        Voller, V. R., & Prakash, C. (1987).
        A fixed grid numerical modelling methodology for convection-diffusion
        mushy region phase-change problems.
        International Journal of Heat and Mass Transfer, 30(8), 1709-1719.

        Swaminathan, C. R., & Voller, V. R. (1992).
        A general enthalpy method for modeling solidification processes.
        Metallurgical transactions B, 23(5), 651-664.
    \endverbatim

    The model generates the field \c \<name\>:alpha1 which can be visualised to
    to show the melt distribution as a fraction [0-1].

Usage
    Example usage:
    \verbatim
    solidificationMeltingSource1
    {
        type            solidificationMeltingSource;
        active          yes;

        selectionMode   cellZone;
        cellZone        iceZone;

        Tsol            273;
        L               334000;
        thermoMode      thermo;
        beta            50e-6;
        rhoRef          800;
    }
    \endverbatim

    Where:
    \table
        Property   | Description                     | Required | Default value
        Tsol       | Solidus temperature [K]             | yes      |
        Tliq       | Liquidus temperature [K]            | no       | Tsol
        alpha1e    | Max eutectic melt fraction [0-1[    | no       | 0
        L          | Latent heat of fusion [J/kg]        | yes      |
        relax      | Relaxation coefficient [0-1]        | no       | 0.9
        thermoMode | Thermo mode [thermo|lookup]         | yes      |
        rhoRef     | Reference (solid) density [kg/m^3]  | yes      |
        rho        | Name of density field               | no       | rho
        T          | Name of temperature field           | no       | T
        Cp         | Name of specific heat field         | no       | Cp
        U          | Name of velocity field              | no       | U
        phi        | Name of flux field                  | no       | phi
        Cu         | Model coefficient [1/s]             | no       | 100000
        q          | Model coefficient                   | no       | 0.001
        beta       | Thermal expansion coefficient [1/K] | yes      |
        g          | Accelerartion due to gravity        | no       |
    \endtable

Patch contributed by Lorenzo Trevisan and integrated by CFD Direct.

Resolves patch request https://bugs.openfoam.org/view.php?id=2907
2018-05-01 15:59:00 +01:00
0670d6b168 solidificationMeltingSource: Temporarily removed to commit new version 2018-05-01 15:58:04 +01:00
06ade28f93 blockMesh: Stabilised arc-cosine argument for 180 degree arcs 2018-05-01 13:06:10 +01:00
87e32ab499 Code style: Updated line comments to start with a space
//This is a comment   ->   // This is a comment
2018-05-01 11:57:50 +01:00
826e009c2e cycicACMI: Removed duplicate code in fv and fvs patches and fields 2018-04-30 14:33:15 +01:00
785a7d9e3f cyclicRepeatAMI: New constraint patch type
A new constraint patch has been added which permits AMI coupling in
cyclic geometries. The coupling is repeated with different multiples of
the cyclic transformation in order to achieve a full correspondence.
This allows, for example, a cylindrical AMI interface to be used in a
sector of a rotational geometry.

The patch is used in a similar manner to cyclicAMI, except that it has
an additional entry, "transformPatch". This entry must name a coupled
patch. The transformation used to repeat the AMI coupling is taken from
this patch. For example, in system/blockMeshDict:

boundary
(
    cyclic1
    {
        type cyclic;
        neighbourPatch cyclic2;
        faces ( ... );
    }

    cyclic2
    {
        type cyclic;
        neighbourPatch cyclic1;
        faces ( ... );
    }

    cyclicRepeatAMI1
    {
        type cyclicRepeatAMI;
        neighbourPatch cyclicRepeatAM2;
        transformPatch cyclic1;
        faces ( ... );
    }

    cyclicRepeatAMI2
    {
        type cyclicRepeatAMI;
        neighbourPatch cyclicRepeatAMI1;
        transformPatch cyclic1;
        faces ( ... );
    }

    // other patches ...
);

In this example, the transformation between cyclic1 and cyclic2 is used
to define the repetition used by the two cyclicRepeatAMI patches.
Whether cyclic1 or cyclic2 is listed as the transform patch is not
important.

A tutorial, incompressible/pimpleFoam/RAS/impeller, has been added to
demonstrate the functionality. This contains two repeating AMI pairs;
one cylindrical and one planar.

A significant amount of maintenance has been carried out on the AMI and
ACMI patches as part of this work. The AMI methods now return
dimensionless weights by default, which prevents ambiguity over the
units of the weight field during construction. Large amounts of
duplicate code have also been removed by deriving ACMI classes from
their AMI equivalents. The reporting and writing of AMI weights has also
been unified.

This work was supported by Dr Victoria Suponitsky, at General Fusion
2018-04-30 09:23:52 +01:00
c1b380c867 solutionControl: Fixed failure to reset some solution indices
This resolves bug report https://bugs.openfoam.org/view.php?id=2913
2018-04-26 15:36:50 +01:00
b7d5bc98de solutionControl: Fix repeat-write when converged at a write time
Solution controls now detect when convergence occurs at a write time and
avoid writing the final directory twice. This also resolves the issue
whereby a purgeWrite setting would remove an extra directory.

This resolves bug report https://bugs.openfoam.org/view.php?id=2904
2018-04-25 12:35:34 +01:00
4e0081d231 Time: Allow the adjustDeltaT function to increase the time-step up to 1%
when adjusting the time-step to conform to the write time to avoid rapid
fluctuations in the time-step and round-off comparison issues.
2018-04-24 12:10:34 +01:00
f12cb590b2 forceCoeffs: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=2909
2018-04-24 10:11:07 +01:00
b2b2b38a1c reactingEulerFoam: Corrected blending for two-resistance models 2018-04-23 14:11:21 +01:00
af88b75e2c wallShearStress: Removed reference to non-existent pressureTools functionObject 2018-04-20 23:21:31 +01:00
aaed6290d0 surfaceFeatures: New version of surfaceFeatureExtract with simplied controls
Surfaces are specified as a list and the controls applied to each, e.g. in the
rhoPimpleFoam/RAS/annularThermalMixer tutorial:

    surfaces
    (
        "AMI.obj"
        "shaft.obj"
        "wall.obj"
        "statorBlades.obj"
        "rotorBlades.obj"
    );

    includedAngle   150;  // Identifes a feature when angle
                      // between faces < includedAngle
    trimFeatures
    {
        minElem         10;   // minimum edges within a feature
    }

    writeObj        yes;  // writes out _edgeMesh.obj files to view features

If different controls are required for different surfaces multiple
sub-dictionaries can be used:

    AMIsurfaces
    {
        surfaces
        (
            "AMI.obj"
        );

        includedAngle   140;  // Identifes a feature when angle
                          // between faces < includedAngle
        trimFeatures
        {
            minElem         8;   // minimum edges within a feature
        }

        writeObj        yes;  // writes out _edgeMesh.obj files to view features
    }

    otherSurfaces
    {
        surfaces
        (
            "shaft.obj"
            "wall.obj"
            "statorBlades.obj"
            "rotorBlades.obj"
        );

        includedAngle   150;  // Identifes a feature when angle
                          // between faces < includedAngle
        trimFeatures
        {
            minElem         10;   // minimum edges within a feature
        }

        writeObj        yes;  // writes out _edgeMesh.obj files to view features
    }

Existing feature edge files corresponding to particular surfaces can be specified using
the "files" association list:

    surfaces
    (
        "AMI.obj"
        "shaft.obj"
        "wall.obj"
        "statorBlades.obj"
        "rotorBlades.obj"
    );

    files
    (
        "AMI.obj" "constant/triSurface/AMI.obj.eMesh";
    );

    includedAngle   150;  // Identifes a feature when angle
                      // between faces < includedAngle
    trimFeatures
    {
        minElem         10;   // minimum edges within a feature
    }

    writeObj        yes;  // writes out _edgeMesh.obj files to view features
2018-04-20 15:23:28 +01:00
8144cfb516 waves: Control additions
An "inletOutlet" switch has been added to the wave velocity boundary
condition to allow the boundary to be fixed, as is possible for the
corresponding alpha condition.

A "heightAboveWave" option has been added to the wave superposition
class to calculate velocity based on the height above the wave, rather
than above the origin. This may improve initialisation but it may also
generate divergence in the initial velocity field.

The alpha condition has also been completed so that it applies a
modelled gradient when the flow points out and a wave pressure condition
is in use.
2018-04-19 10:51:28 +01:00
a0a19c7f38 fvcAverage and fvcReconstruct: Return zero for 0-D cases
fvcAverage and fvcReconstruct both do divisions or inverses of surface
summed fields. A single-cell zero-dimension case, has no genuine faces
on which to sum, so surface sums are identically zero. This change
detects this situation and returns a zero value instead of failing due
to a divide by zero.

This allows the multiphase test cases to be reduced to just one cell.
2018-04-19 09:05:29 +01:00
32d44d3322 VectorSpace: Added normalised function
This is useful for creating const unit vectors
2018-04-18 09:56:38 +01:00
ab81dffe4e vectorTensorTransform: Primitive transformations 2018-04-18 09:51:44 +01:00
1b0e09faf0 surfaceFeatureExtract: Moved feature edge editing functions to the surfaceFeatures class 2018-04-17 20:38:15 +01:00
2730fbad5c surfaceFeatureExtract: Further refactoring to move the extract surface closeness functionality
to triSurfaceMesh
2018-04-17 00:16:12 +01:00
40600b3cd5 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-04-14 11:05:24 +01:00
06adb18299 thermophysicalModels::liquidProperties: Added initial write-to-dict functionality
Needs further work to make read and write of dictionary consistent.
2018-04-14 11:04:12 +01:00
a1cc703bf8 Cloud: Removed unused data 2018-04-13 14:25:28 +01:00
c2b169c8dd vectorTensorTransform: Inverse and tensor field transforms 2018-04-13 14:04:49 +01:00
00645cdc1a functionObjects: Corrected namespace for NamedEnum
Resolves bug-report https://bugs.openfoam.org/view.php?id=2901
2018-04-13 01:11:20 +01:00
3e1ab675f6 surfaceFeatureExtract: Refactored pointIndexHitList functionality into corresponding core classes 2018-04-10 23:08:56 +01:00
388b3107c8 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-04-10 21:53:30 +01:00
a908847b9c surfaceFeatureExtract: Refactored core line and edge functions corresponding classes 2018-04-10 21:52:44 +01:00
8dcfc9e9f8 streamLine: Added option to track in both directions
Streamlines can now be tracked in both directions from the set of
initial locations. The keyword controlling this behaviour is
"direction", which can be set to "forward", "backward" or "both".

This new keyword superseeds the "trackForward" entry, which has been
retained for backwards compatibility.
2018-04-09 08:36:16 +01:00
7ea428af52 cyclics: Removed unnecessary virtual inheritance of LduInterface classes 2018-04-09 08:36:16 +01:00
21d5267b6f surfaceFeatureExtract: Refactor core functionality into core classes and libraries 2018-04-06 20:15:28 +01:00
aeb8d73020 particle: Removed the oldNormal function which is no longer needed 2018-04-06 14:32:04 +01:00
43b35a5173 triangle, triFace, face: Rationalized normal for consistency with the rest of OpenFOAM
For compatibility with all the mesh and related classes in OpenFOAM The 'normal'
function of the 'triangle', 'triFace' and 'face' classes now returns the unit
normal vector rather than the vector area which is now provided by the 'area'
function.
2018-04-06 13:57:36 +01:00
a0399d619d fixedMeanOutletInletFvPatchField: New outlet/inlet boundary condition which fixes the outlet mean
Description
    This boundary condition extrapolates field to the patch using the near-cell
    values and adjusts the distribution to match the specified, optionally
    time-varying, mean value.  This extrapolated field is applied as a
    fixedValue for outflow faces but zeroGradient is applied to inflow faces.

    This boundary condition can be applied to pressure when inletOutlet is
    applied to the velocity so that a zeroGradient condition is applied to the
    pressure at inflow faces where the velocity is specified to avoid an
    unphysical over-specification of the set of boundary conditions.

Usage
    \table
        Property     | Description             | Required    | Default value
        meanValue    | mean value Function1    | yes         |
        phi          | Flux field name         | no          | phi
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            fixedMeanOutletInlet;
        meanValue       1.0;
    }
    \endverbatim

See also
    Foam::fixedMeanFvPatchField
    Foam::outletInletFvPatchField
    Foam::Function1Types
2018-04-04 22:04:25 +01:00
7143bbcc1d uniformDensityHydrostaticPressureFvPatchScalarField: pRefPoint now optional
If pRefPoint is not specified hRef is used.  This provides compatibility with
the original prghUniformDensityHydrostaticPressureFvPatchScalarField BC.
2018-04-04 16:44:22 +01:00
49cf7f8d19 uniformDensityHydrostaticPressureFvPatchScalarField: Removed optional "true" argument 2018-04-04 13:37:53 +01:00
53e9706f7e uniformDensityHydrostaticPressureFvPatchScalarField: Require value entry for post-processing 2018-04-04 13:10:28 +01:00