Commit Graph

37 Commits

Author SHA1 Message Date
Henry Weller
ea5401c770 GeometricField::GeometricBoundaryField -> GeometricField::Boundary
When the GeometricBoundaryField template class was originally written it
was a separate class in the Foam namespace rather than a sub-class of
GeometricField as it is now.  Without loss of clarity and simplifying
code which access the boundary field of GeometricFields it is better
that GeometricBoundaryField be renamed Boundary for consistency with the
new naming convention for the type of the dimensioned internal field:
Internal, see commit 4a57b9be2e

This is a very simple text substitution change which can be applied to
any code which compiles with the OpenFOAM-dev libraries.
2016-04-28 07:22:02 +01:00
Henry Weller
22f4ad32b1 Completed boundaryField() -> boundaryFieldRef()
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1938

Because C++ does not support overloading based on the return-type there
is a problem defining both const and non-const member functions which
are resolved based on the const-ness of the object for which they are
called rather than the intent of the programmer declared via the
const-ness of the returned type.  The issue for the "boundaryField()"
member function is that the non-const version increments the
event-counter and checks the state of the stored old-time fields in case
the returned value is altered whereas the const version has no
side-effects and simply returns the reference.  If the the non-const
function is called within the patch-loop the event-counter may overflow.
To resolve this it in necessary to avoid calling the non-const form of
"boundaryField()" if the results is not altered and cache the reference
outside the patch-loop when mutation of the patch fields is needed.

The most straight forward way of resolving this problem is to name the
const and non-const forms of the member functions differently e.g. the
non-const form could be named:

    mutableBoundaryField()
    mutBoundaryField()
    nonConstBoundaryField()
    boundaryFieldRef()

Given that in C++ a reference is non-const unless specified as const:
"T&" vs "const T&" the logical convention would be

    boundaryFieldRef()
    boundaryFieldConstRef()

and given that the const form which is more commonly used is it could
simply be named "boundaryField()" then the logical convention is

    GeometricBoundaryField& boundaryFieldRef();

    inline const GeometricBoundaryField& boundaryField() const;

This is also consistent with the new "tmp" class for which non-const
access to the stored object is obtained using the ".ref()" member function.

This new convention for non-const access to the components of
GeometricField will be applied to "dimensionedInternalField()" and "internalField()" in the
future, i.e. "dimensionedInternalFieldRef()" and "internalFieldRef()".
2016-04-25 16:16:05 +01:00
Henry Weller
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
Henry Weller
cd852be3da OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp
The deprecated non-const tmp functionality is now on the compiler switch
NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC
in the Make/options file.  However, it is recommended to upgrade all
code to the new safer tmp by using the '.ref()' member function rather
than the non-const '()' dereference operator when non-const access to
the temporary object is required.

Please report any problems on Mantis.

Henry G. Weller
CFD Direct.
2016-02-26 17:31:28 +00:00
Henry Weller
99a10ecea6 Boundary conditions: Added extrapolatedCalculatedFvPatchField
To be used instead of zeroGradientFvPatchField for temporary fields for
which zero-gradient extrapolation is use to evaluate the boundary field
but avoiding fields derived from temporary field using field algebra
inheriting the zeroGradient boundary condition by the reuse of the
temporary field storage.

zeroGradientFvPatchField should not be used as the default patch field
for any temporary fields and should be avoided for non-temporary fields
except where it is clearly appropriate;
extrapolatedCalculatedFvPatchField and calculatedFvPatchField are
generally more suitable defaults depending on the manner in which the
boundary values are specified or evaluated.

The entire OpenFOAM-dev code-base has been updated following the above
recommendations.

Henry G. Weller
CFD Direct
2016-02-20 22:44:37 +00:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
Henry Weller
9577ad2d23 reactingMultiphaseEulerFoam, multiphaseEulerFoam: Correct flux averaging for sub-cycling 2015-10-05 17:43:33 +01:00
Henry Weller
85b27f674f reactingMultiphaseEulerFoam: New Euler-Euler multiphase solver
Supporting any number of phases with heat and mass transfer, phase-change and reactions
2015-09-11 15:33:12 +01:00
Henry
b5b6791230 Update headers 2015-04-29 14:44:53 +01:00
Henry
f7e4d0a110 MULES: nLimiterIter and smoothLimiter are now user-input via the corresponding fvSolution sub-dict
nLimiterIter: Number of iterations during limiter construction
    3 (default) is sufficient for 3D simulations with a Courant number 0.5 or so
    For larger Courant numbers larger values may be needed but this is
    only relevant for IMULES and CMULES

smoothLimiter: Coefficient to smooth the limiter to avoid "diamond"
    staggering patters seen in regions of low particle phase-fraction in
    fluidised-bed simulations.

    The default is 0 as it is not needed for all simulations.
    A value of 0.1 is appropriate for fluidised-bed simulations.
    The useful range is 0 -> 0.5.
    Values larger than 0.5 may cause excessive smearing of the solution.
2015-04-29 14:37:41 +01:00
Henry
f0cec33f88 Update headers 2014-01-27 13:00:48 +00:00
Henry
bee3508b38 Adding names to temporaries to avoid duplicate registrations 2014-01-27 12:59:58 +00:00
Henry
16a89a6fce MULES: Consolidated support for LTS 2013-10-25 15:08:33 +01:00
Henry
f76a715155 multiphaseEulerFoam/multiphaseSystem/multiphaseSystem: Updated the inlet BC flux correction 2013-10-04 15:07:17 +01:00
Henry
9e79d990f3 multiphaseEulerFoam: Ensure that the flux at inflow BCs is preserved 2013-08-20 12:30:44 +01:00
Henry
313547796e transportModel: Constructor does not need any arguments 2013-07-14 23:17:55 +01:00
Henry
72ea7b4680 transportModel: remove IOdictionary base-class so that it is entirely abstract 2013-07-07 22:54:33 +01:00
Henry
052d81785a multiphase: move alpha solution controls into the appropriate sub-dictionary of fvSolution:solvers 2013-06-20 16:32:39 +01:00
Henry
d13c9810e8 VoF Solvers: Relocate the correction, sub-cycling and compressions controls from PIMPLE to the alpha1 sub-dict
MULES: Add support for explicit correction
interPhaseChangeFoam: Add option for explicit MULES or as correction to an upwind solution
Deprecate implicit form of MULES
2013-05-03 15:46:29 +01:00
Henry
473cf07dde MULES: Split files to separate the explicit and implicit forms
IMULES: MULES for implicit solution
2013-05-01 15:32:36 +01:00
Henry
e08e4b0b5c multiphaseEulerFoam: Check consistency of surface tension and interface compression coefficients 2013-04-05 15:27:26 +01:00
Henry
dfd24f5e98 multiphaseSystem: removed phaseModelTable
phaseModelTable superseded by PtrDictionary
2012-08-28 23:25:04 +01:00
Henry
23ad7a11fe multiphaseEulerFoam: Completed support for surface tension and contact angle.
Also improved the efficiency of the handling of the models by evaluating only those specified.
2012-06-25 11:34:46 +01:00
Henry
93355167ec multiphaseEulerFoam: Completed support for surface tension 2012-06-22 11:55:10 +01:00
Henry
9d7cb91af1 Update headers 2012-03-22 11:48:29 +00:00
Henry
1ebe55d95b multiphase solvers: remove lift and drag at fixed-flux BCs, i.e. inlets 2012-03-22 11:48:09 +00:00
Henry
29d4f2ff33 multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C: updated drag pre-factor 2011-12-21 10:27:09 +00:00
Henry
a5eaa2bafd multiphaseEulerFoam: Change the specification of the residual drag and smooth the drag phase-fraction pre-factor
* The residual drag is now specified in terms of a residual phase-fraction and slip-velocity.
* The drag phase-fraction pre-factor is smoothed so that the computational molecule matches that
  of the transport terms.
2011-12-05 10:17:15 +00:00
Henry
50322c3f4c Corrected line length 2011-10-26 14:32:01 +01:00
Henry
a5ba2cc9cd multiphaseEulerFoam: Work in progress 2011-10-26 14:30:06 +01:00
andy
b6fafa7284 BUG: Partial revert of commit 8ae9569 2011-09-12 17:41:46 +01:00
andy
8ae9569085 ENH: Multiple commits - lumped due to git index file corruption
- Re-located mapped point patches
- Updated mapped patch write
- deprecated directMapped in favour of mapped
- updated resulting dependancies - apps/libs/tuts
2011-09-09 12:05:12 +01:00
Henry
531b721d4b Corrected line length 2011-09-09 10:46:40 +01:00
Henry
4ff31e73ef multiphaseEulerFoam: Added support for MRF and different schemes for each phase-fraction
Corrected tutorials
2011-09-09 10:45:07 +01:00
Henry
89554ace7f Corrected formatting 2011-09-05 19:23:59 +01:00
Henry
85d1a92cf2 Corrected formatting 2011-09-05 19:21:53 +01:00
Henry
2c335d360b multiphaseEulerFoam: new solver
including two simple tutorial cases
2011-09-05 19:06:38 +01:00