Commit Graph

70 Commits

Author SHA1 Message Date
Mark Olesen
ef44df91f2 ENH: support direct lookup of solver controls
OLD:
        pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
        pEqn.solve(mesh.solver("Yi"));

    NEW:
        pEqn.solve(p.select(piso.finalInnerIter()));
        pEqn.solve("Yi");
2023-12-07 17:42:24 +01:00
Mark Olesen
aa1e1eb15d COMP: fix inline friend declarations (gcc-4.8.5) 2021-01-27 10:33:19 +01:00
Mark Olesen
3e43edf056 ENH: unify use of dictionary method names
- previously introduced `getOrDefault` as a dictionary _get_ method,
  now complete the transition and use it everywhere instead of
  `lookupOrDefault`. This avoids mixed usage of the two methods that
  are identical in behaviour, makes for shorter names, and promotes
  the distinction between "lookup" access (ie, return a token stream,
  locate and return an entry) and "get" access (ie, the above with
  conversion to concrete types such as scalar, label etc).
2020-06-02 17:26:03 +02:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
mattijs
cad37cf603 BUG: magneticFoam: add orientation information. Fixes #1291. 2019-04-24 15:40:52 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
505b4b9c1c ENH: add guarded lookup for dimensionedSet
STYLE: use standard dimensionedSets
2019-01-02 16:53:41 +01:00
Mark Olesen
5d9e278e92 ENH: consolidate handling of mandatory/optional command arguments
- for some special cases we wish to mark command-line arguments as
  being optional, in order to do our own treatment. For example,
  when an arbitrary number of arguments should be allowed.

  Now tag this situation with argList::noMandatoryArgs().
  The argList::argsMandatory() query can then be used in any further
  logic, including the standard default argument checking.

- with the new default check, can consolidate the special-purpose

      "setRootCaseNonMandatoryArgs.H"

  into the regular

      "setRootCase.H"

- revert to a simple "setRootCase.H" and move all the listing related
  bits to a "setRootCaseLists.H" file. This leaves the information
  available for solvers, or whoever else wishes, without being
  introduced everywhere.

- add include guards and scoping to the listing files and rename to
  something less generic.

     listOptions.H -> setRootCaseListOptions.H
     listOutput.H  -> setRootCaseListOutput.H
2018-12-13 01:45:09 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
dd87c98393 ENH: add read guard for dimensionedType constructors (#762)
- deprecate dimensionedType constructors using an Istream in favour of
  versions accepting a keyword and a dictionary.

  Dictionary entries are almost the exclusive means of read
  constructing a dimensionedType. By construct from the dictionary
  entry instead of doing a lookup() first, we can detect possible
  input errors such as too many tokens as a result of a input syntax
  error.

  Constructing a dimensionedType from a dictionary entry now has
  two forms.

  1.  dimensionedType(key, dims, dict);

      This is the constructor that will normally be used.

      It accepts entries with optional leading names and/or
      dimensions. If the entry contains dimensions, they are
      verified against the expected dimensions and an IOError is
      raised if they do not correspond. On conclusion, checks the
      token stream for any trailing rubbish.

  2.  dimensionedType(key, dict);

      This constructor is used less frequently.

      Similar to the previous description, except that it is initially
      dimensionless. If entry contains dimensions, they are used
      without further verification. The constructor also includes a
      token stream check.

      This constructor is useful when the dimensions are entirely
      defined from the dictionary input, but also when handling
      transition code where the input dimensions are not obvious from
      the source.

      This constructor can also be handy when obtaining values from
      a dictionary without needing to worry about the input dimensions.
      For example,

         Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;

      This will accept a large range of inputs without hassle.

ENH: consistent handling of dimensionedType for inputs (#1083)

BUG: incorrect Omega dimensions (fixes #2084)
2018-11-20 15:14:10 +01:00
Mark Olesen
cb919a6c41 ENH: tag some options as 'advanced' (only shown with -help-full)
General:
    * -roots, -hostRoots, -fileHandler

Specific:
    * -to <coordinateSystem> -from <coordinateSystem>

- Display -help-compat when compatibility or ignored options are available

STYLE: capitalization of options text
2018-07-31 11:54:15 +02:00
Mark Olesen
2662042d49 ENH: improve controls for Time (issue #910)
- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
2018-07-02 10:20:01 +02:00
Andrew Heather
b50bbc7ef2 ENH: Added new dry-run options to solvers 2018-01-11 14:23:17 +00:00
Henry Weller
fe4752d28a ENH: ddtScheme::fvcDdtPhiCoeff: Improved formulation providing better stability/accuracy balance
Resolves problem with pressure "staggering" when running with a very Courant
number.
2018-01-08 21:35:00 +00:00
Mark Olesen
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
Mark Olesen
2f86cdc712 STYLE: more consistent use of dimensioned Zero
- when constructing dimensioned fields that are to be zero-initialized,
  it is preferrable to use a form such as

      dimensionedScalar(dims, Zero)
      dimensionedVector(dims, Zero)

  rather than

      dimensionedScalar("0", dims, 0)
      dimensionedVector("zero", dims, vector::zero)

  This reduces clutter and also avoids any suggestion that the name of
  the dimensioned quantity has any influence on the field's name.

  An even shorter version is possible. Eg,

      dimensionedScalar(dims)

  but reduces the clarity of meaning.

- NB: UniformDimensionedField is an exception to these style changes
  since it does use the name of the dimensioned type (instead of the
  regIOobject).
2018-03-16 10:24:03 +01:00
Mark Olesen
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
Andrew Heather
d8d6030ab6 INT: Integration of Mattijs' collocated parallel IO additions
Original commit message:
------------------------

Parallel IO: New collated file format

When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
mesh(es) has historically been stored in multiple files within separate
directories for each processor.  Processor directories are named 'processorN',
where N is the processor number.

This commit introduces an alternative "collated" file format where the data for
each decomposed field (and mesh) is collated into a single file, which is
written and read on the master processor.  The files are stored in a single
directory named 'processors'.

The new format produces significantly fewer files - one per field, instead of N
per field.  For large parallel cases, this avoids the restriction on the number
of open files imposed by the operating system limits.

The file writing can be threaded allowing the simulation to continue running
while the data is being written to file.  NFS (Network File System) is not
needed when using the the collated format and additionally, there is an option
to run without NFS with the original uncollated approach, known as
"masterUncollated".

The controls for the file handling are in the OptimisationSwitches of
etc/controlDict:

OptimisationSwitches
{
    ...

    //- Parallel IO file handler
    //  uncollated (default), collated or masterUncollated
    fileHandler uncollated;

    //- collated: thread buffer size for queued file writes.
    //  If set to 0 or not sufficient for the file size threading is not used.
    //  Default: 2e9
    maxThreadFileBufferSize 2e9;

    //- masterUncollated: non-blocking buffer size.
    //  If the file exceeds this buffer size scheduled transfer is used.
    //  Default: 2e9
    maxMasterFileBufferSize 2e9;
}

When using the collated file handling, memory is allocated for the data in the
thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
is allocated.  If the data exceeds this size, the write does not use threading.

When using the masterUncollated file handling, non-blocking MPI communication
requires a sufficiently large memory buffer on the master node.
maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
data exceeds this size, the system uses scheduled communication.

The installation defaults for the fileHandler choice, maxThreadFileBufferSize
and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
the case controlDict file, like other parameters.  Additionally the fileHandler
can be set by:
- the "-fileHandler" command line argument;
- a FOAM_FILEHANDLER environment variable.

A foamFormatConvert utility allows users to convert files between the collated
and uncollated formats, e.g.
    mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated

An example case demonstrating the file handling methods is provided in:
$FOAM_TUTORIALS/IO/fileHandling

The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
2017-07-07 11:39:56 +01:00
Mark Olesen
2af602c2f4 STYLE: for Istream/Ostream check() use FUNCTION_NAME in messages 2017-05-26 10:59:16 +02:00
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Henry Weller
8632583934 Removed trailing blank lines
Resolves bug-report https://bugs.openfoam.org/view.php?id=2438
2017-01-19 20:17:47 +00:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
58f905ff70 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00
Henry Weller
7dca6b6a21 applications/solvers: Added -postProcess option
See also commit cc455173ff
2016-05-09 14:08:15 +01:00
andy
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
Henry Weller
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
Henry Weller
77b03e2e0c Specialized dotInterpolate for the efficient calculation of flux fields
e.g. (fvc::interpolate(HbyA) & mesh.Sf()) -> fvc::flux(HbyA)

This removes the need to create an intermediate face-vector field when
computing fluxes which is more efficient, reduces the peak storage and
improved cache coherency in addition to providing a simpler and cleaner
API.
2016-04-06 20:20:53 +01:00
Henry Weller
fc2ce73723 Solvers: Added support for extrapolated pressure boundary conditions
The boundary conditions of HbyA are now constrained by the new "constrainHbyA"
function which applies the velocity boundary values for patches for which the
velocity cannot be modified by assignment and pressure extrapolation is
not specified via the new
"fixedFluxExtrapolatedPressureFvPatchScalarField".

The new function "constrainPressure" sets the pressure gradient
appropriately for "fixedFluxPressureFvPatchScalarField" and
"fixedFluxExtrapolatedPressureFvPatchScalarField" boundary conditions to
ensure the evaluated flux corresponds to the known velocity values at
the boundary.

The "fixedFluxPressureFvPatchScalarField" boundary condition operates
exactly as before, ensuring the correct flux at fixed-flux boundaries by
compensating for the body forces (gravity in particular) with the
pressure gradient.

The new "fixedFluxExtrapolatedPressureFvPatchScalarField" boundary
condition may be used for cases with or without body-forces to set the
pressure gradient to compensate not only for the body-force but also the
extrapolated "HbyA" which provides a second-order boundary condition for
pressure.  This is useful for a range a problems including impinging
flow, extrapolated inlet conditions with body-forces or for highly
viscous flows, pressure-induced separation etc.  To test this boundary
condition at walls in the motorBike tutorial case set

    lowerWall
    {
        type            fixedFluxExtrapolatedPressure;
    }

    motorBikeGroup
    {
        type            fixedFluxExtrapolatedPressure;
    }

Currently the new extrapolated pressure boundary condition is supported
for all incompressible and sub-sonic compressible solvers except those
providing implicit and tensorial porosity support.  The approach will be
extended to cover these solvers and options in the future.

Note: the extrapolated pressure boundary condition is experimental and
requires further testing to assess the range of applicability,
stability, accuracy etc.

Henry G. Weller
CFD Direct Ltd.
2016-02-13 17:48:26 +00:00
mattijs
9e3ce4ec7f Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus into feature-shared-file
Conflicts:
	applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
	applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C
	applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundary.C
	applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
	applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/vtkPV4Foam/vtkPV4FoamUpdateInfo.C
	applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
	applications/utilities/postProcessing/velocityField/Co/Co.C
	applications/utilities/postProcessing/velocityField/Pe/Pe.C
	applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C
	applications/utilities/preProcessing/changeDictionary/changeDictionary.C
	applications/utilities/preProcessing/setFields/setFields.C
	applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
	applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
	applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
	applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C
	src/OpenFOAM/db/IOobject/IOobject.C
	src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
	src/OpenFOAM/db/IOobjects/IOField/IOField.C
	src/OpenFOAM/db/IOobjects/IOList/IOList.C
	src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C
	src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
	src/OpenFOAM/db/Time/findInstance.C
	src/OpenFOAM/db/regIOobject/regIOobject.C
	src/OpenFOAM/db/regIOobject/regIOobjectI.H
	src/OpenFOAM/db/regIOobject/regIOobjectRead.C
	src/OpenFOAM/db/regIOobject/regIOobjectWrite.C
	src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/IOmapDistribute.C
	src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
	src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
	src/dynamicMesh/fvMeshDistribute/IOmapDistributePolyMesh.C
	src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8Data.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
	src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
	src/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
	src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
	src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.C
	src/lagrangian/basic/Cloud/CloudIO.C
	src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C
	src/postProcessing/foamCalcFunctions/basic/addSubtract/addSubtract.C
	src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C
	src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C
	src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C
	src/triSurface/triSurface/surfacePatch/surfacePatchIOList.C
2016-01-25 16:29:04 +00:00
mattijs
e424059208 ENH: glboal file handling: initial commit
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
2016-01-25 13:03:15 +00:00
Andrew Heather
8f1d043364 GIT: Resolved conflict 2015-12-09 09:32:38 +00:00
Andrew Heather
eafd5a3850 ENH: Updated Info, Warning and Error messages 2015-12-08 11:15:39 +00:00
Andrew Heather
b594d73c65 ENH: Solvers - updated group documentation 2015-12-03 22:05:55 +00:00
Henry Weller
365f9b0006 dimensioned<Type>: Added constructor from name, dimensions and dictionary
to simplify construction of dimensionedScalar properties and avoid the
duplication of the name string in the constructor call.
2015-07-21 12:57:07 +01:00
Henry Weller
0fb6a01280 fluxRequired: Added setFluxRequired function to fvSchemes class
Added calls to setFluxRequired for p, p_rgh etc. in all solvers which
avoids the need to add fluxRequired entries in fvSchemes dictionaries.
2015-07-15 21:57:16 +01:00
Henry
9cd9a9f364 ddtScheme::fvcDdtPhiCoeff: Zero ddtCorr on AMIs
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1421
2015-03-24 15:23:01 +00:00
Henry
25908eb4fc pimpleControl and pisoControl: Rationalize PISO and PIMPLE control 2015-02-10 13:47:18 +00:00
Henry
fe8c5ff636 Applications: use pimpleControl.dict() and simpleControl.dict() instead of looking-up the sub-dict 2015-02-09 22:15:26 +00:00
Henry
08baa6eda6 fixedFluxPressure BC: the snGrad is now pushed into the BC from pEqn.H rather than being evaluated in the BC 2013-09-11 00:10:00 +01:00
Henry
470553c61a Updated headers 2013-09-09 12:41:33 +01:00
Henry
51f085faa5 Rewrite of ddtPhiCorr - ddtCorr and density-weight HbyA on compressible solvers.
For DyM solvers phiAbs is replaced by Uf but this conversion is currently not complete
2013-09-09 12:41:20 +01:00
andy
912a20b7a3 ENH: Propagated caching of HbyA across solvers 2012-03-02 18:15:54 +00:00
andy
ca3ec6ebcb ENH: Updated SIMPLE solvers to new simpleControl framework 2011-10-26 14:31:57 +01:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
656bbf5308 ENH: Updated solvers to use simpleControl and pimpleControl 2011-04-14 17:45:20 +01:00
andy
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
andy
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
graham
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
Mark Olesen
c0e4586aac COMP: avoid ambiguous construct from tmp - solvers/ electomagnetics 2010-12-21 09:50:34 +01:00
Henry
eb51614780 Renamed rUA -> rAU 2010-10-11 20:10:34 +01:00