Commit Graph

43 Commits

Author SHA1 Message Date
56bfc75949 Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
2017-06-22 14:32:18 +01:00
6a0a8b99b3 STYLE: use ""_deg user-literal for degrees to radians conversion
ENH: add degToRad() multiplier (useful for scalar fields)

- use degToRad() functions throughout instead of scattered local solutions
2017-07-04 15:36:46 +02:00
9a864bdd85 GIT: Resolved merge conflict when merging develop branch 2017-05-24 12:30:09 +01:00
b5ed93a40a ENH: orientedFields - refectored and simplified usage 2017-05-24 12:26:12 +01:00
b9379426c9 ENH: Oriented fields - updated dependent code 2017-04-27 14:47:48 +01:00
1c2093c8b3 Multi-phase solvers: Improved handling of inflow/outflow BCs in MULES
Avoids slight phase-fraction unboundedness at entertainment BCs and improved
robustness.

Additionally the phase-fractions in the multi-phase (rather than two-phase)
solvers are adjusted to avoid the slow growth of inconsistency ("drift") caused
by solving for all of the phase-fractions rather than deriving one from the
others.
2017-01-17 22:43:47 +00:00
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
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
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
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
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
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
9577ad2d23 reactingMultiphaseEulerFoam, multiphaseEulerFoam: Correct flux averaging for sub-cycling 2015-10-05 17:43:33 +01:00
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
b5b6791230 Update headers 2015-04-29 14:44:53 +01:00
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
f0cec33f88 Update headers 2014-01-27 13:00:48 +00:00
bee3508b38 Adding names to temporaries to avoid duplicate registrations 2014-01-27 12:59:58 +00:00
16a89a6fce MULES: Consolidated support for LTS 2013-10-25 15:08:33 +01:00
f76a715155 multiphaseEulerFoam/multiphaseSystem/multiphaseSystem: Updated the inlet BC flux correction 2013-10-04 15:07:17 +01:00
9e79d990f3 multiphaseEulerFoam: Ensure that the flux at inflow BCs is preserved 2013-08-20 12:30:44 +01:00
313547796e transportModel: Constructor does not need any arguments 2013-07-14 23:17:55 +01:00
72ea7b4680 transportModel: remove IOdictionary base-class so that it is entirely abstract 2013-07-07 22:54:33 +01:00
052d81785a multiphase: move alpha solution controls into the appropriate sub-dictionary of fvSolution:solvers 2013-06-20 16:32:39 +01:00
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
473cf07dde MULES: Split files to separate the explicit and implicit forms
IMULES: MULES for implicit solution
2013-05-01 15:32:36 +01:00
e08e4b0b5c multiphaseEulerFoam: Check consistency of surface tension and interface compression coefficients 2013-04-05 15:27:26 +01:00
dfd24f5e98 multiphaseSystem: removed phaseModelTable
phaseModelTable superseded by PtrDictionary
2012-08-28 23:25:04 +01:00
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
93355167ec multiphaseEulerFoam: Completed support for surface tension 2012-06-22 11:55:10 +01:00
9d7cb91af1 Update headers 2012-03-22 11:48:29 +00:00
1ebe55d95b multiphase solvers: remove lift and drag at fixed-flux BCs, i.e. inlets 2012-03-22 11:48:09 +00:00
29d4f2ff33 multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C: updated drag pre-factor 2011-12-21 10:27:09 +00:00
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
50322c3f4c Corrected line length 2011-10-26 14:32:01 +01:00
a5ba2cc9cd multiphaseEulerFoam: Work in progress 2011-10-26 14:30:06 +01:00
b6fafa7284 BUG: Partial revert of commit 8ae9569 2011-09-12 17:41:46 +01:00
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
531b721d4b Corrected line length 2011-09-09 10:46:40 +01:00
4ff31e73ef multiphaseEulerFoam: Added support for MRF and different schemes for each phase-fraction
Corrected tutorials
2011-09-09 10:45:07 +01:00
89554ace7f Corrected formatting 2011-09-05 19:23:59 +01:00
85d1a92cf2 Corrected formatting 2011-09-05 19:21:53 +01:00
2c335d360b multiphaseEulerFoam: new solver
including two simple tutorial cases
2011-09-05 19:06:38 +01:00