Compare commits

...

85 commits

Author SHA1 Message Date
Yeongdo Park
01b0b1396b Update .gitlab-ci.yml 2018-10-31 15:46:39 +00:00
Yeongdo Park
9f1a9c60d1 Update .gitlab-ci.yml 2018-10-31 14:27:04 +00:00
Yeongdo Park
75c8f48c51 update CI Lint for new GitLab Runner 2018-10-25 07:31:35 -04:00
ignis
b5bebc52ec New methods for all species Cp and Cv 2018-07-10 15:24:03 +09:00
ignis
6b3e8c972b Qc and Qc2 field calculation dimension correctly set 2018-07-10 14:59:50 +09:00
ignis
8670f39b9f specie and specieMixtures feature for electrical property calculation 2018-04-25 14:56:01 +09:00
ignis
c06d324891 mixture got specific charge field calculation 2018-04-19 13:39:45 +09:00
ignis
3efddbac8a new attr nCharges_ and related methods of specie and chemkinReader mod for cation name 2018-04-18 11:09:25 +09:00
Yeongdo Park
ad1db37d45 Merge branch 'EvaporationModels' into 'trunk'
added convection-diffusion-controlled liquid evaporation model

See merge request combustion-postech/OpenFOAM-4.x!10
2018-01-20 21:42:17 +00:00
Dohyun Kim
408cd2c2d3 Evaporation models 2018-01-20 21:40:15 +00:00
Combustion Lab
0da86b7edd Merge branch 'main' into 'trunk'
GitLab CI setup

See merge request combustion-postech/OpenFOAM-4.x!8
2018-01-16 14:54:16 +00:00
Combustion Lab
554e8d0fb0 GitLab CI setup 2018-01-16 14:49:03 +00:00
Henry Weller
d214c8dfd5 chtMultiRegionFoam: Added support for single solid region post-processing
Patch contributed by Bruno Santos

Resolves patch request https://bugs.openfoam.org/view.php?id=2684
2017-09-04 17:17:13 +01:00
Henry Weller
03c63bf7a5 MULES: Improve handling of very small geometries 2017-07-24 10:35:00 +01:00
Henry Weller
4cfa55f2ea Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-4.x 2017-07-10 12:09:15 +01:00
Henry Weller
c989277b5e thermoSingleLayer::q: Use a local "alpha" without hydrophilic/phobic adjustment
Resolves bug-report https://bugs.openfoam.org/view.php?id=2605
2017-07-10 12:08:28 +01:00
Will Bainbridge
53b4b3fc2d foamyMesh: Fixed compilation failures
Resolves bug reports https://bugs.openfoam.org/view.php?id=2601 and
https://bugs.openfoam.org/view.php?id=2602
2017-07-05 17:24:34 +01:00
Henry Weller
b5331fdc86 foamyHexMesh: do not compile by default
Resolves bug-report https://bugs.openfoam.org/view.php?id=2588
2017-06-29 19:16:04 +01:00
Henry Weller
7b7f43754d tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater: Corrected Allclean
Resolves bug-report https://bugs.openfoam.org/view.php?id=2597
2017-06-29 16:52:53 +01:00
Henry Weller
8dd02db3b8 foamDebugSwitches: Updated
Resolves bug-report https://bugs.openfoam.org/view.php?id=2590
2017-06-23 08:59:18 +01:00
Henry Weller
f71eecf0cc DimensionedField: Correct database registration of fields created with new names 2017-06-18 20:36:15 +01:00
Henry Weller
bf3559e6be fixedShearStressFvPatchVectorField: Removed duplicate "value" entry
Resolves bug-report https://bugs.openfoam.org/view.php?id=2556
2017-05-18 19:58:03 +01:00
Henry Weller
783d6cf640 Updated header 2017-05-18 19:57:52 +01:00
Henry Weller
bb1309bee1 kqRWallFunctionFvPatchField: Corrected scope 2017-05-18 19:57:16 +01:00
Henry Weller
e4bbb06941 sixDoFRigidBodyMotion: Corrected handling of acceleration update in first time-step
Resolves bug-report https://bugs.openfoam.org/view.php?id=2551
2017-05-18 16:31:47 +01:00
Henry Weller
748858b28d Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-4.x 2017-05-14 15:42:25 +01:00
Henry Weller
14927bb3d0 Reinstated operation of "-doc" and "-srcDoc"
Changed Doxyfile to generate descriptive names for the HTML files.
Added "-file" option to firefox to read the HTML file name from the command line.
2017-05-14 15:41:46 +01:00
Will Bainbridge
cf5b0901ea Euler-Euler: turbulentDispersionModels: Burns: Minor re-formulation to
improve stability.

Resolves bug report <https://bugs.openfoam.org/view.php?id=2544>
2017-05-09 10:01:15 +01:00
Henry Weller
b4861ec0ad COPYING: Updated date and contact details 2017-05-05 09:05:49 +01:00
Henry Weller
ecc796de76 thermophysicalModels: Corrected alphah to be enthalpy based
in

solidSpecie/transport/const/constAnIsoSolidTransport
solidSpecie/transport/const/constIsoSolidTransport
solidSpecie/transport/exponential/exponentialSolidTransport
solidSpecie/transport/polynomial/polynomialSolidTransport
specie/transport/logPolynomial/logPolynomialTransport
specie/transport/polynomial/polynomialTransport
specie/transport/sutherland/sutherlandTransport

Resolves bug-report https://bugs.openfoam.org/view.php?id=2532
2017-05-04 12:01:57 +01:00
Henry Weller
f10cfe3fb0 functionObjects::fieldAverage: Initialize totalTime_ for new fields following restart
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=2510
2017-05-03 18:44:17 +01:00
Henry Weller
56a4152a93 faceOnlySet, uniformSet: Reset mesh.moving before returning
Resolves bug-report https://bugs.openfoam.org/view.php?id=2514
2017-03-29 23:17:46 +01:00
Henry Weller
1e24adef1f Updated header 2017-03-22 19:11:10 +00:00
Henry Weller
ec0c14f527 functionObjects::wallShearStress: Corrected dimensions for compressible cases 2017-03-22 19:10:21 +00:00
Henry Weller
7af84c144d applyBoundaryLayer: Ensure nut is up-to-date with the current turbulence fields
Resolves bug-report https://bugs.openfoam.org/view.php?id=2511
2017-03-22 12:07:15 +00:00
Henry Weller
d7ffce4f5d applyBoundaryLayer: Provide non-const access to nut, k and epsilon 2017-03-21 15:11:00 +00:00
Henry Weller
38af843e10 functionObjects::functionObjects: Corrected initial totalTime for cases with variable time-step
Resolves bug-report https://bugs.openfoam.org/view.php?id=2459
2017-03-20 17:24:13 +00:00
Henry Weller
17013e6f44 functionObjects::systemCall: Removed redundant Make directory 2017-03-17 09:01:59 +00:00
Henry Weller
dbcc59da2f functionObjects::systemCall: Removed unused entry from Make/files
Resolves bug-report https://bugs.openfoam.org/view.php?id=2503
2017-03-17 08:58:41 +00:00
Henry Weller
6f7aaecc58 postProcess: Added support for dsmcFields
e.g. postProcess -time 0.001 -func dsmcFields

Resolves bug-report https://bugs.openfoam.org/view.php?id=2499
2017-03-14 15:24:44 +00:00
Henry Weller
7d5fe2f3d9 turbulenceModels::RAS: Corrected sign of "C3" dilatation term
Set default value of C3 to 0
Set C3 to -0.33 in the engineFoam/kivaTest tutorial.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2496
2017-03-13 17:59:24 +00:00
Henry Weller
16dbac4c03 Updated header 2017-03-10 11:07:01 +00:00
Henry Weller
71161ef0b8 CrankNicolsonDdtScheme: Corrected fvcDdtUfCorr for compressible flow
Resolves bug-report https://bugs.openfoam.org/view.php?id=2491
2017-03-10 11:06:00 +00:00
Henry Weller
efa306a033 turbulenceModels::LES::dynamicLagrangian: Converted advection to compressible convection form
Formally this is equivalent to the previous formulation but more convenient to
use given that for compressible flow the mass flux rather than the volume flux
is available.
2017-03-10 11:03:42 +00:00
Henry Weller
fc009a4fa2 LES::dynamicLagrangian: Corrected access to the volumetric flux for compressible flow
Resolves bug-report https://bugs.openfoam.org/view.php?id=2489
2017-03-09 09:39:41 +00:00
Henry Weller
ca7db4558d verticalChannel tutorial, compressibleInflowOutflow template: removed 'bounded' from the 'div(phid,p)' scheme 2017-03-08 11:35:42 +00:00
Henry Weller
6804c6cf49 GeometricField: corrected assignment to tmp which wraps a non-tmp 2017-02-22 13:18:33 +00:00
Henry Weller
89a346ec52 functionObjects::fieldCoordinateSystemTransform: added coordinateSystem sub-dict and updated the description
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2454
2017-02-22 13:15:00 +00:00
Henry Weller
e964d879e2 csvSetWriter: Corrected axis header
Resolves bug-report https://bugs.openfoam.org/view.php?id=2455
2017-02-09 17:44:48 +00:00
Henry Weller
1decf44db0 functionObjects::scalarTransport: Corrected FatalError 2017-02-08 16:56:30 +00:00
Henry Weller
7c251b6e92 tutorials/multiphase/interDyMFoam/ras/DTCHull: improved boundedness and stability 2017-02-06 22:54:31 +00:00
Henry Weller
8f3169652e functionObjects::streamLine: Reinstated default "U" 2017-02-03 21:55:03 +00:00
Henry Weller
7c8d3866cb PBiCG: Suggest changing to the more robust PBiCGStab solver
if convergence is not achieved within the maximum number of iterations.

Sometimes, particularly running in parallel, PBiCG fails to converge or diverges
without warning or obvious cause leaving a solution field containing significant
errors which can cause divergence of the application.  PBiCGStab is more robust
and does not suffer from the problems encountered with PBiCG.
2017-02-03 21:53:53 +00:00
Henry Weller
a1a70270f0 functionObjects::streamLine,wallBoundedStreamLine: Removed outdated check for 'UName'
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2444
2017-01-28 18:05:41 +00:00
Henry Weller
54efb46f26 codedFunctionObject: Updated documentation
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2441
2017-01-28 18:05:11 +00:00
Henry Weller
8ff56d46b9 meshSearch: Add support for cell decomposition mode CELL_TETS
Resolves bug-report https://bugs.openfoam.org/view.php?id=2428
2017-01-20 10:44:51 +00:00
Henry Weller
98113110d8 setsToZones: Add support for multi-region cases
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2437
2017-01-19 08:19:36 +00:00
Henry Weller
100d9a9dd1 eConstThermo: Corrected entropy function
Resolves bug-report https://bugs.openfoam.org/view.php?id=2436
2017-01-18 10:14:07 +00:00
Henry Weller
d5dd04e0a6 stressComponents, wallGradU: Additional backward-compatibility info scripts
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2423
2017-01-09 14:31:05 +00:00
Henry Weller
42cc7646e0 Make/options: Added -lscotchDecomp where appropriate
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2410
2016-12-27 15:29:12 +00:00
Henry Weller
a8ccb13d48 Documentation updates
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2409
2016-12-27 15:10:04 +00:00
Henry Weller
a7c2bd6cac functionObjects::volRegion: Improved parallel efficiency
Patch contributed by Kevin Nordin-Bates
Resolves bug-report https://bugs.openfoam.org/view.php?id=2401
2016-12-19 16:18:34 +00:00
Chris Greenshields
4fc4bc5d35 Template function objects: added read rhoInf entry 2016-12-14 15:30:06 +00:00
Chris Greenshields
930eb454e4 Template function objects: forces and forceCoeffs correction/tidy 2016-12-14 14:38:12 +00:00
Chris Greenshields
750b0402a6 Template function objects: corrected forces and forceCoeffs for code correction
See bug-report https://bugs.openfoam.org/view.php?id=2387
2016-12-14 14:17:45 +00:00
Henry Weller
fb57ecbfdf functionObjects::forceCoeffs: Corrected setting of rhoRef for compressible flow
Resolves bug-report https://bugs.openfoam.org/view.php?id=2387
2016-12-14 10:42:49 +00:00
Henry Weller
3d754f4a12 PBiCGStab: Corrected to support processorAgglomerator
Patch contributed by Battijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2383
2016-12-09 17:00:50 +00:00
Henry Weller
2fedcfd00c tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun: Removed spurious '-parallel' option
Resolves bug-report http://bugs.openfoam.org/view.php?id=2378
2016-12-07 15:36:15 +00:00
Henry Weller
7209ceb306 metisDecomp: Corrected return from metisDecomp::decompose
Resolves bug-report http://bugs.openfoam.org/view.php?id=2370
2016-12-03 19:27:24 +00:00
Henry Weller
daa4d54a49 processorMeshes::read destruct before de-register
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2368
2016-12-01 22:06:35 +00:00
Henry Weller
0b3c8e6fb4 meshToMesh0: fixed segmentation fault
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2363
2016-12-01 19:57:00 +00:00
Henry Weller
0e18bbaa12 functionObjects::grad: Avoid cache conflict with 'postProcess' utility
Resolves bug-report http://bugs.openfoam.org/view.php?id=2350
2016-12-01 15:53:38 +00:00
Henry Weller
422f1770e0 tensor::eigenValues: Test the magnitude of 'QQ' before dividing by it.
Resolves bug-report http://bugs.openfoam.org/view.php?id=2351
2016-11-26 20:53:19 +00:00
Henry Weller
fcb789a267 functionObject.H: Updated documentation
Patch contributed by Bruno Santos
Resolves patch request http://bugs.openfoam.org/view.php?id=2355
2016-11-26 19:47:45 +00:00
Henry Weller
769940a61b functionObjects::yPlus: Removed the AUTO_WRITE option on yPlus
Writing is controlled directly by the functionObject
2016-11-26 17:35:17 +00:00
Henry Weller
35f4d2da07 functionObjects::fieldExpression: Correct and improve warning messages
postProcess -func MachNo

previously generated the warning

Executing functionObjects
--> FOAM Warning :     functionObjects::MachNo MachNo cannot find required field U

which is incorrect; the field 'U' is available but the
thermophysicalProperties is not.  Now 'postProcess' generates the
warning:

Executing functionObjects
--> FOAM Warning :     functionObjects::MachNo MachNo cannot find required object thermophysicalProperties of type fluidThermo
--> FOAM Warning :     functionObjects::MachNo MachNo failed to execute.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2352
2016-11-25 21:49:56 +00:00
Henry Weller
acc2a7707e functionObjects::yPlus: Call read() in constructor to set base-class controls
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2320
2016-11-06 10:33:18 +00:00
Henry Weller
c4b8d5e443 kOmegaSSTBase: Corrected read() to re-read the base-class settings
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2318
2016-11-05 23:27:19 +00:00
Henry Weller
61195404f7 Cloud: Added 'td.switchProcessor' check to processor transfer logic
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2315
2016-11-05 21:20:18 +00:00
Henry Weller
8e01ae0462 driftFluxFoam: Corrected Udm BCs
Added 'READ_IF_PRESENT' option to support overriding of the default BCs
for complex problems requiring special treatment of Udm at boundaries.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2317
2016-11-05 20:53:31 +00:00
Henry Weller
423ac54eab etc/bashrc: Added support for sourcing etc/bashrc with relative path
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2310
2016-11-04 13:09:18 +00:00
Henry Weller
c590630ab0 etc/config.csh/paraview: avoid ParaView_DIR: Undefined variable.
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2309
2016-10-30 10:44:38 +00:00
Henry Weller
579268eb16 etc/cshrc: Removed echo $FOAM_INST_DIR 2016-10-30 09:39:25 +00:00
Henry Weller
a6a964b265 foamCleanPath: Changed sed delimiter from '@' to '|' to allow Email addresses
Patch contributed by Bruno Santos
http://bugs.openfoam.org/view.php?id=2306
2016-10-25 17:12:37 +01:00
Henry Weller
c326278adb Revert "Set version for the 4.1 release"
This reverts commit 21991d73a3.
2016-10-16 15:11:57 +01:00
142 changed files with 1654 additions and 923 deletions

23
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,23 @@
allmake:
image: park0d/of4builder
tags:
- openfoam4
before_script:
- "[[ -d ../ThirdParty-4.x ]] || git clone https://github.com/OpenFOAM/ThirdParty-4.x.git ../ThirdParty-4.x"
- source etc/bashrc
- rm -rf platforms
- wclean all
script:
- ./Allwmake -j
artifacts:
paths:
- ./
cantera:
image: park0d/of4builder
tags:
- openfoam4
script:
- whereis libcantera

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
OpenFOAM(R) is Copyright (C) 2011 OpenFOAM Foundation OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation
Contact: OpenFOAM Foundation (OpenFOAM.Foundation@gmail.com) Contact: OpenFOAM Foundation, http://openfoam.org/contact
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
of GNU General Public License version 3, which is displayed below, or of GNU General Public License version 3, which is displayed below, or

View file

@ -1,9 +1,9 @@
#include "createMeshes.H" #include "createMeshes.H"
if (!fluidRegions.size()) if (!fluidRegions.size() && !solidRegions.size())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "No fluid meshes present" << exit(FatalError); << "No region meshes present" << exit(FatalError);
} }
fvMesh& mesh = fluidRegions[0]; fvMesh& mesh = fluidRegions.size() ? fluidRegions[0] : solidRegions[0];

View file

@ -24,6 +24,9 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "relativeVelocityModel.H" #include "relativeVelocityModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "partialSlipFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,6 +36,34 @@ namespace Foam
defineRunTimeSelectionTable(relativeVelocityModel, dictionary); defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
{
const volVectorField& U = mixture_.U();
wordList UdmTypes
(
U.boundaryField().size(),
calculatedFvPatchScalarField::typeName
);
forAll(U.boundaryField(), i)
{
if
(
isA<fixedValueFvPatchVectorField>(U.boundaryField()[i])
|| isA<slipFvPatchVectorField>(U.boundaryField()[i])
|| isA<partialSlipFvPatchVectorField>(U.boundaryField()[i])
)
{
UdmTypes[i] = fixedValueFvPatchVectorField::typeName;
}
}
return UdmTypes;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel
"Udm", "Udm",
alphac_.time().timeName(), alphac_.time().timeName(),
alphac_.mesh(), alphac_.mesh(),
IOobject::NO_READ, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
alphac_.mesh(), alphac_.mesh(),
dimensionedVector("Udm", dimVelocity, Zero) dimensionedVector("Udm", dimVelocity, Zero),
UdmPatchFieldTypes()
) )
{} {}

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,12 +52,16 @@ class relativeVelocityModel
{ {
// Private Member Functions // Private Member Functions
//- Return the list of patchFieldTypes for Udm derived from U
wordList UdmPatchFieldTypes() const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
relativeVelocityModel(const relativeVelocityModel&); relativeVelocityModel(const relativeVelocityModel&);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const relativeVelocityModel&); void operator=(const relativeVelocityModel&);
protected: protected:
// Protected data // Protected data

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -101,7 +101,11 @@ Foam::turbulentDispersionModels::Burns::D() const
*sqr(pair_.dispersed().d()) *sqr(pair_.dispersed().d())
) )
*pair_.continuous().rho() *pair_.continuous().rho()
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_)); *pair_.dispersed()
*(
1.0/max(pair_.dispersed(), residualAlpha_)
+ 1.0/max(pair_.continuous(), residualAlpha_)
);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -101,7 +101,11 @@ Foam::turbulentDispersionModels::Burns::D() const
*sqr(pair_.dispersed().d()) *sqr(pair_.dispersed().d())
) )
*pair_.continuous().rho() *pair_.continuous().rho()
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_)); *pair_.dispersed()
*(
1.0/max(pair_.dispersed(), residualAlpha_)
+ 1.0/max(pair_.continuous(), residualAlpha_)
);
} }

View file

@ -31,7 +31,7 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
-ledgeMesh \ -ledgeMesh \
-ltriSurface \ -ltriSurface \
-ldynamicMesh \ -ldynamicMesh \

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,7 +62,7 @@ Foam::tmp<Foam::Field<Type>> filterFarPoints
) )
{ {
tmp<Field<Type>> tNewField(new Field<Type>(field.size())); tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
Field<Type>& newField = tNewField(); Field<Type>& newField = tNewField.ref();
label added = 0; label added = 0;
label count = 0; label count = 0;
@ -160,7 +160,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
( (
new triadField(mesh.vertexCount(), triad::unset) new triadField(mesh.vertexCount(), triad::unset)
); );
triadField& alignments = tAlignments(); triadField& alignments = tAlignments.ref();
for for
( (
@ -188,7 +188,7 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
( (
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT)) new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
); );
pointField& points = tPoints(); pointField& points = tPoints.ref();
for for
( (

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,6 +30,7 @@ License
#include "scalarIOField.H" #include "scalarIOField.H"
#include "labelIOField.H" #include "labelIOField.H"
#include "pointConversion.H" #include "pointConversion.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -30,7 +30,7 @@ EXE_LIBS = \
-lconformalVoronoiMesh \ -lconformalVoronoiMesh \
-lmeshTools \ -lmeshTools \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
-ledgeMesh \ -ledgeMesh \
-lfileFormats \ -lfileFormats \
-ltriSurface \ -ltriSurface \

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -311,7 +311,7 @@ tmp<scalarField> signedDistance
) )
{ {
tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT))); tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
scalarField& fld = tfld(); scalarField& fld = tfld.ref();
// Find nearest // Find nearest
List<pointIndexHit> nearest; List<pointIndexHit> nearest;
@ -647,7 +647,8 @@ int main(int argc, char *argv[])
forAll(fvm.C().boundaryField(), patchi) forAll(fvm.C().boundaryField(), patchi)
{ {
const pointField& cc = fvm.C().boundaryField()[patchi]; const pointField& cc = fvm.C().boundaryField()[patchi];
fvPatchScalarField& fld = cellDistance.boundaryField()[patchi]; fvPatchScalarField& fld =
cellDistance.boundaryFieldRef()[patchi];
scalarField patchDistSqr scalarField patchDistSqr
( (
fld.patch().patchInternalField(distSqr) fld.patch().patchInternalField(distSqr)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "CGAL/number_utils.h"
#include "CGAL/Delaunay_triangulation_2.h" #include "CGAL/Delaunay_triangulation_2.h"
#ifdef CGAL_INEXACT #ifdef CGAL_INEXACT

View file

@ -35,6 +35,6 @@ EXE_LIBS = \
-ltriSurface \ -ltriSurface \
-ldynamicMesh \ -ldynamicMesh \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
-lsampling \ -lsampling \
-lfileFormats -lfileFormats

View file

@ -15,4 +15,5 @@ EXE_LIBS = \
-lgenericPatchFields \ -lgenericPatchFields \
-lrenumberMethods \ -lrenumberMethods \
$(LINK_FLAGS) \ $(LINK_FLAGS) \
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,10 +84,12 @@ int main(int argc, char *argv[])
#include "createNamedPolyMesh.H" #include "createNamedPolyMesh.H"
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
// Search for list of objects for the time of the mesh // Search for list of objects for the time of the mesh
word setsInstance = runTime.findInstance word setsInstance = runTime.findInstance
( (
polyMesh::meshSubDir/"sets", setsSubPath,
word::null, word::null,
IOobject::MUST_READ, IOobject::MUST_READ,
mesh.facesInstance() mesh.facesInstance()
@ -95,7 +97,7 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets"); IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets" Info<< "Searched : " << setsInstance/setsSubPath
<< nl << nl
<< "Found : " << objects.names() << nl << "Found : " << objects.names() << nl
<< endl; << endl;

View file

@ -8,6 +8,6 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,7 +42,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// turbulence constants - file-scope // Turbulence constants - file-scope
static const scalar Cmu(0.09); static const scalar Cmu(0.09);
static const scalar kappa(0.41); static const scalar kappa(0.41);
@ -130,14 +130,14 @@ int main(int argc, char *argv[])
if (isA<incompressible::RASModel>(turbulence())) if (isA<incompressible::RASModel>(turbulence()))
{ {
// Calculate nut - reference nut is calculated by the turbulence model // Calculate nut
// on its construction turbulence->validate();
tmp<volScalarField> tnut = turbulence->nut(); tmp<volScalarField> tnut = turbulence->nut();
volScalarField& nut = tnut.ref(); volScalarField& nut = const_cast<volScalarField&>(tnut());
volScalarField S(mag(dev(symm(fvc::grad(U))))); volScalarField S(mag(dev(symm(fvc::grad(U)))));
nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S; nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S;
// do not correct BC - wall functions will 'undo' manipulation above // Do not correct BC - wall functions will 'undo' manipulation above
// by using nut from turbulence model // by using nut from turbulence model
if (args.optionFound("writenut")) if (args.optionFound("writenut"))
@ -151,11 +151,11 @@ int main(int argc, char *argv[])
// Turbulence k // Turbulence k
tmp<volScalarField> tk = turbulence->k(); tmp<volScalarField> tk = turbulence->k();
volScalarField& k = tk.ref(); volScalarField& k = const_cast<volScalarField&>(tk());
scalar ck0 = pow025(Cmu)*kappa; scalar ck0 = pow025(Cmu)*kappa;
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl))); k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl)));
// do not correct BC - operation may use inconsistent fields wrt these // Do not correct BC - operation may use inconsistent fields wrt these
// local manipulations // local manipulations
// k.correctBoundaryConditions(); // k.correctBoundaryConditions();
@ -165,11 +165,11 @@ int main(int argc, char *argv[])
// Turbulence epsilon // Turbulence epsilon
tmp<volScalarField> tepsilon = turbulence->epsilon(); tmp<volScalarField> tepsilon = turbulence->epsilon();
volScalarField& epsilon = tepsilon.ref(); volScalarField& epsilon = const_cast<volScalarField&>(tepsilon());
scalar ce0 = ::pow(Cmu, 0.75)/kappa; scalar ce0 = ::pow(Cmu, 0.75)/kappa;
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl); epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl);
// do not correct BC - wall functions will use non-updated k from // Do not correct BC - wall functions will use non-updated k from
// turbulence model // turbulence model
// epsilon.correctBoundaryConditions(); // epsilon.correctBoundaryConditions();
@ -193,7 +193,7 @@ int main(int argc, char *argv[])
dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL); dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL);
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0); omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0);
// do not correct BC - wall functions will use non-updated k from // Do not correct BC - wall functions will use non-updated k from
// turbulence model // turbulence model
// omega.correctBoundaryConditions(); // omega.correctBoundaryConditions();
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
volScalarField nuTilda(nuTildaHeader, mesh); volScalarField nuTilda(nuTildaHeader, mesh);
nuTilda = nut; nuTilda = nut;
// do not correct BC // Do not correct BC
// nuTilda.correctBoundaryConditions(); // nuTilda.correctBoundaryConditions();
Info<< "Writing nuTilda\n" << endl; Info<< "Writing nuTilda\n" << endl;

View file

@ -107,7 +107,7 @@ do
##DEBUG echo "remove>$wildcard<" 1>&2 ##DEBUG echo "remove>$wildcard<" 1>&2
if [ -n "$wildcard" ] if [ -n "$wildcard" ]
then then
dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g") dirList=$(echo "$dirList:" | sed -e "s|${wildcard}[^:]*:||g")
fi fi
done done

View file

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -32,6 +32,6 @@
Script=${0##*/} Script=${0##*/}
echo $Script "has been superceded by the foamList utility:" echo $Script "has been superceded by the foamList utility:"
echo "foamList -debug" echo "foamList -switches"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

39
bin/stressComponents Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# stressComponents
#
# Description
# Script to suggest using the new "-postProcess" solver option.
#
#------------------------------------------------------------------------------
Script=${0##*/}
echo $Script "has been superceded by the -postProcess solver option:"
echo "<solverName> -funcs '(R components(turbulenceProperties:R))'"
echo "e.g."
echo "simpleFoam -postProcess -funcs '(R components(turbulenceProperties:R))'"
#------------------------------------------------------------------------------

37
bin/wallGradU Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# wallGradU
#
# Description
# Script to suggest using the new "postProcess" utility.
#
#------------------------------------------------------------------------------
Script=${0##*/}
echo $Script "has been superceded by the postProcess utility:"
echo " postProcess -func 'grad(U)'"
#------------------------------------------------------------------------------

View file

@ -168,7 +168,7 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM. # support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO. # The default value is: NO.
SHORT_NAMES = YES SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief # first line (until the first dot) of a Javadoc-style comment as the brief

View file

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -32,7 +32,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=4.1 export WM_PROJECT_VERSION=4.x
################################################################################ ################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade # USER EDITABLE PART: Changes made here may be lost with the next upgrade
@ -43,15 +43,12 @@ export WM_PROJECT_VERSION=4.1
# Please set to the appropriate path if the default is not correct. # Please set to the appropriate path if the default is not correct.
# #
[ $BASH_SOURCE ] && \ [ $BASH_SOURCE ] && \
export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \ export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
export FOAM_INST_DIR=$HOME/$WM_PROJECT export FOAM_INST_DIR=$HOME/$WM_PROJECT
# export FOAM_INST_DIR=~$WM_PROJECT # export FOAM_INST_DIR=~$WM_PROJECT
# export FOAM_INST_DIR=/opt/$WM_PROJECT # export FOAM_INST_DIR=/opt/$WM_PROJECT
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT # export FOAM_INST_DIR=/usr/local/$WM_PROJECT
# #
# Build foamyHexMesh
export FOAMY_HEX_MESH=yes
#
# END OF (NORMAL) USER EDITABLE PART # END OF (NORMAL) USER EDITABLE PART
################################################################################ ################################################################################

View file

@ -9,6 +9,5 @@
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
type forceCoeffs; type forceCoeffs;
rhoInf 1; // Redundant for incompressible
// ************************************************************************* // // ************************************************************************* //

View file

@ -25,6 +25,6 @@ dragDir (1 0 0);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsCompressible.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -24,6 +24,6 @@ dragDir (1 0 0);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -8,4 +8,7 @@
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
rho rhoInf;
rhoInf 1; // Redundant, but currently read in
// ************************************************************************* // // ************************************************************************* //

View file

@ -12,7 +12,6 @@ libs ("libforces.so");
writeControl timeStep; writeControl timeStep;
writeInterval 1; writeInterval 1;
rho rhoInf; // Incompressible solver
log off; log off;
// ************************************************************************* // // ************************************************************************* //

View file

@ -16,6 +16,6 @@ patches (patch1 patch2);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forcesCompressible.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg"
rhoInf 1.225; // Fluid density rhoInf 1.225; // Fluid density
patches (patch1 patch2); patches (patch1 patch2);

View file

@ -8,6 +8,6 @@
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
rhoInf 1; // Redundant rho rhoInf;
// ************************************************************************* // // ************************************************************************* //

View file

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Calculate intensive fields:
- UMean
- translationalT
- internalT
- overallT
from averaged extensive fields from a DSMC calculation.
\*---------------------------------------------------------------------------*/
type dsmcFields;
libs ("liblagrangianFunctionObjects.so");
fields (rhoNMean rhoMMean momentumMean linearKEMean internalEMean
iDofMean fDMean);
executeControl writeTime;
writeControl writeTime;
// ************************************************************************* //

View file

@ -34,6 +34,8 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
# Clean the PATH # Clean the PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"` set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) setenv PATH $cleaned if ( $status == 0 ) setenv PATH $cleaned

View file

@ -18,7 +18,7 @@ FoamFile
Documentation Documentation
{ {
docBrowser "firefox %f"; docBrowser "firefox -file %f";
doxyDocDirs doxyDocDirs
( (
"$WM_PROJECT_USER_DIR/html" "$WM_PROJECT_USER_DIR/html"

View file

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -31,7 +31,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM setenv WM_PROJECT OpenFOAM
setenv WM_PROJECT_VERSION 4.1 setenv WM_PROJECT_VERSION 4.x
################################################################################ ################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade # USER EDITABLE PART: Changes made here may be lost with the next upgrade
@ -43,15 +43,11 @@ setenv WM_PROJECT_VERSION 4.1
# #
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'` sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'`
echo $FOAM_INST_DIR
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT # setenv FOAM_INST_DIR $HOME/$WM_PROJECT
# setenv FOAM_INST_DIR ~$WM_PROJECT # setenv FOAM_INST_DIR ~$WM_PROJECT
# setenv FOAM_INST_DIR /opt/$WM_PROJECT # setenv FOAM_INST_DIR /opt/$WM_PROJECT
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT # setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
# #
# Build foamyHexMesh
setenv FOAMY_HEX_MESH yes
#
# END OF (NORMAL) USER EDITABLE PART # END OF (NORMAL) USER EDITABLE PART
################################################################################ ################################################################################

View file

@ -46,7 +46,7 @@ divSchemes
div(phi,K) $turbulence; div(phi,K) $turbulence;
div(phi,Ekp) $turbulence; div(phi,Ekp) $turbulence;
div(phid,p) bounded Gauss upwind; div(phid,p) Gauss upwind;
div((phi|interpolate(rho)),p) bounded Gauss upwind; div((phi|interpolate(rho)),p) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;

View file

@ -64,23 +64,24 @@ Description
libs | Libraries containing implementation | yes | libs | Libraries containing implementation | yes |
region | Name of region for multi-region cases | no | region | Name of region for multi-region cases | no |
enabled | On/off switch | no | yes enabled | On/off switch | no | yes
log | Log information to standard output | no | yes
timeStart| Start time | no | timeStart| Start time | no |
timeEnd | End time | no | timeEnd | End time | no |
evaluateControl | See time controls below | no | timeStep executeControl | See time controls below | no | timeStep
evaluateInterval | Steps between output | no | executeInterval | Steps between each execute phase | no |
writeControl | See time controls below | no | timeStep writeControl | See time controls below | no | timeStep
writeInterval | Steps between output | no | writeInterval | Steps between each write phase | no |
\endtable \endtable
Time controls: Time controls:
\table \table
Option | Description Option | Description
timeStep | Execute/write every 'writeInterval' time-steps timeStep | Execute/write every 'Interval' time-steps
writeTime | Execute/write every 'writeInterval' output times writeTime | Execute/write every 'Interval' output times
adjustableRunTime | Execute/write every 'writeInterval' run time period adjustableRunTime | Execute/write every 'Interval' run time period
runTime | Execute/write every 'writeInterval' run time period runTime | Execute/write every 'Interval' run time period
clockTime | Execute/write every 'writeInterval' clock time period clockTime | Execute/write every 'Interval' clock time period
cpuTime | Execute/write every 'writeInterval' CPU time period cpuTime | Execute/write every 'Interval' CPU time period
none | Execute/write every time-step none | Execute/write every time-step
\endtable \endtable
@ -91,6 +92,14 @@ Description
libraries and the \c libs entry is used to specify which library should be libraries and the \c libs entry is used to specify which library should be
loaded. loaded.
Each function object has two separate run phases:
- The \c execute phase is meant to be used for updating calculations
or for management tasks.
- The \c write phase is meant for writing the calculated data to disk.
For each phase the respective time controls are provided, as listed above.
Class Class
Foam::functionObject Foam::functionObject

View file

@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store
if (cacheable && fieldName == tfield().name()) if (cacheable && fieldName == tfield().name())
{ {
WarningInFunction WarningInFunction
<< "Cannot store cache-able field with the named used in the cache." << "Cannot store cache-able field with the name used in the cache."
<< nl << nl
<< " Either choose a different name or cache the field" << " Either choose a different name or cache the field"
<< " and use the 'writeObjects' functionObject." << " and use the 'writeObjects' functionObject."

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -211,7 +211,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
const DimensionedField<Type, GeoMesh>& df const DimensionedField<Type, GeoMesh>& df
) )
: :
regIOobject(newName, df, newName == df.name()), regIOobject(newName, df, newName != df.name()),
Field<Type>(df), Field<Type>(df),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1164,11 +1164,18 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
this->dimensions() = gf.dimensions(); this->dimensions() = gf.dimensions();
if (tgf.isTmp())
{
// Transfer the storage from the tmp // Transfer the storage from the tmp
primitiveFieldRef().transfer primitiveFieldRef().transfer
( (
const_cast<Field<Type>&>(gf.primitiveField()) const_cast<Field<Type>&>(gf.primitiveField())
); );
}
else
{
primitiveFieldRef() = gf.primitiveField();
}
boundaryFieldRef() = gf.boundaryField(); boundaryFieldRef() = gf.boundaryField();

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,9 @@ namespace Foam
} }
const Foam::label Foam::lduMatrix::solver::defaultMaxIter_ = 1000;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::lduMatrix::lduMatrix(const lduMesh& mesh) Foam::lduMatrix::lduMatrix(const lduMesh& mesh)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,6 +106,9 @@ public:
//- Dictionary of controls //- Dictionary of controls
dictionary controlDict_; dictionary controlDict_;
//- Default maximum number of iterations in the solver
static const label defaultMaxIter_;
//- Maximum number of iterations in the solver //- Maximum number of iterations in the solver
label maxIter_; label maxIter_;

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -157,7 +157,7 @@ Foam::lduMatrix::solver::solver
void Foam::lduMatrix::solver::readControls() void Foam::lduMatrix::solver::readControls()
{ {
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", 1000); maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", defaultMaxIter_);
minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0); minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0);
tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6); tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6);
relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0); relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -204,6 +204,16 @@ Foam::solverPerformance Foam::PBiCG::solve
); );
} }
// Recommend PBiCGStab if PBiCG fails to converge
if (solverPerf.nIterations() > max(defaultMaxIter_, maxIter_))
{
FatalErrorInFunction
<< "PBiCG has failed to converge within the maximum number"
" of iterations " << max(defaultMaxIter_, maxIter_) << nl
<< " Please try the more robust PBiCGStab solver."
<< exit(FatalError);
}
return solverPerf; return solverPerf;
} }

View file

@ -223,7 +223,7 @@ Foam::solverPerformance Foam::PBiCGStab::solve
// --- Calculate omega from tA and sA // --- Calculate omega from tA and sA
// (cheaper than using zA with preconditioned tA) // (cheaper than using zA with preconditioned tA)
omega = gSumProd(tA, sA)/tAtA; omega = gSumProd(tA, sA, matrix().mesh().comm())/tAtA;
// --- Update solution and residual // --- Update solution and residual
for (label cell=0; cell<nCells; cell++) for (label cell=0; cell<nCells; cell++)

View file

@ -123,7 +123,7 @@ Foam::vector Foam::eigenValues(const tensor& t)
} }
// Two identical roots and one distinct root // Two identical roots and one distinct root
else if (mag(PPP/QQ - 1) < SMALL) else if (mag(QQ) > SMALL && mag(PPP/QQ - 1) < SMALL)
{ {
scalar sqrtP = sqrt(P); scalar sqrtP = sqrt(P);
scalar signQ = sign(Q); scalar signQ = sign(Q);

View file

@ -27,17 +27,19 @@ Class
Description Description
Polynomial templated on size (order): Polynomial templated on size (order):
poly = sum(coeff_[i]*x^i) logCoeff*log(x) \verbatim
poly = sum(coeffs[i]*x^i) + logCoeff*log(x)
\endverbatim
where 0 \<= i \<= N where <tt> 0 <= i <= N </tt>
- integer powers, starting at zero - integer powers, starting at zero
- value(x) to evaluate the poly for a given value - \c value(x) to evaluate the poly for a given value
- derivative(x) returns derivative at value - \c derivative(x) returns derivative at value
- integral(x1, x2) returns integral between two scalar values - \c integral(x1, x2) returns integral between two scalar values
- integral() to return a new, integral coeff polynomial - \c integral() to return a new, integral coeff polynomial
- increases the size (order) - increases the size (order)
- integralMinus1() to return a new, integral coeff polynomial where - \c integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1 the base poly starts at order -1
SourceFiles SourceFiles

View file

@ -27,16 +27,18 @@ Class
Description Description
Polynomial function representation Polynomial function representation
poly = logCoeff*log(x) + sum(coeff_[i]*x^i) \verbatim
poly = logCoeff*log(x) + sum(coeffs[i]*x^i)
\endverbatim
where 0 \<= i \<= N where <tt> 0 <= i <= N </tt>
- integer powers, starting at zero - integer powers, starting at zero
- value(x) to evaluate the poly for a given value - \c value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values - \c integrate(x1, x2) between two scalar values
- integral() to return a new, integral coeff polynomial - \c integral() to return a new, integral coeff polynomial
- increases the size (order) - increases the size (order)
- integralMinus1() to return a new, integral coeff polynomial where - \c integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1 the base poly starts at order -1
See also See also

View file

@ -376,7 +376,7 @@ kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::kOmegaSST
template<class TurbulenceModel, class BasicTurbulenceModel> template<class TurbulenceModel, class BasicTurbulenceModel>
bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read() bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read()
{ {
if (BasicTurbulenceModel::read()) if (TurbulenceModel::read())
{ {
alphaK1_.readIfPresent(this->coeffDict()); alphaK1_.readIfPresent(this->coeffDict());
alphaK2_.readIfPresent(this->coeffDict()); alphaK2_.readIfPresent(this->coeffDict());

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,7 @@ namespace Foam
namespace LESModels namespace LESModels
{ {
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
void dynamicLagrangian<BasicTurbulenceModel>::correctNut void dynamicLagrangian<BasicTurbulenceModel>::correctNut
@ -159,7 +159,9 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
} }
// Local references // Local references
const surfaceScalarField& phi = this->phi_; const alphaField& alpha = this->alpha_;
const rhoField& rho = this->rho_;
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
const volVectorField& U = this->U_; const volVectorField& U = this->U_;
fv::options& fvOptions(fv::options::New(this->mesh_)); fv::options& fvOptions(fv::options::New(this->mesh_));
@ -183,19 +185,19 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
volScalarField invT volScalarField invT
( (
(1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0) alpha*rho*(1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0)
); );
volScalarField LM(L && M); volScalarField LM(L && M);
fvScalarMatrix flmEqn fvScalarMatrix flmEqn
( (
fvm::ddt(flm_) fvm::ddt(alpha, rho, flm_)
+ fvm::div(phi, flm_) + fvm::div(alphaRhoPhi, flm_)
== ==
invT*LM invT*LM
- fvm::Sp(invT, flm_) - fvm::Sp(invT, flm_)
+ fvOptions(flm_) + fvOptions(alpha, rho, flm_)
); );
flmEqn.relax(); flmEqn.relax();
@ -208,12 +210,12 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
fvScalarMatrix fmmEqn fvScalarMatrix fmmEqn
( (
fvm::ddt(fmm_) fvm::ddt(alpha, rho, fmm_)
+ fvm::div(phi, fmm_) + fvm::div(alphaRhoPhi, fmm_)
== ==
invT*MM invT*MM
- fvm::Sp(invT, fmm_) - fvm::Sp(invT, fmm_)
+ fvOptions(fmm_) + fvOptions(alpha, rho, fmm_)
); );
fmmEqn.relax(); fmmEqn.relax();

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ LaunderSharmaKE<BasicTurbulenceModel>::LaunderSharmaKE
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
-0.33 0
) )
), ),
sigmak_ sigmak_
@ -273,7 +273,7 @@ void LaunderSharmaKE<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
C1_*alpha*rho*G*epsilon_/k_ C1_*alpha*rho*G*epsilon_/k_
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_) - fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha*rho*divU, epsilon_)
- fvm::Sp(C2_*f2()*alpha*rho*epsilon_/k_, epsilon_) - fvm::Sp(C2_*f2()*alpha*rho*epsilon_/k_, epsilon_)
+ alpha*rho*E + alpha*rho*E
+ epsilonSource() + epsilonSource()

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ RNGkEpsilon<BasicTurbulenceModel>::RNGkEpsilon
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
-0.33 0
) )
), ),
sigmak_ sigmak_
@ -282,7 +282,7 @@ void RNGkEpsilon<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
(C1_ - R)*alpha*rho*G*epsilon_/k_ (C1_ - R)*alpha*rho*G*epsilon_/k_
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_) - fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha*rho*divU, epsilon_)
- fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_) - fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_)
+ epsilonSource() + epsilonSource()
+ fvOptions(alpha, rho, epsilon_) + fvOptions(alpha, rho, epsilon_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ kEpsilon<BasicTurbulenceModel>::kEpsilon
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
-0.33 0
) )
), ),
sigmak_ sigmak_
@ -259,7 +259,7 @@ void kEpsilon<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
C1_*alpha()*rho()*G*epsilon_()/k_() C1_*alpha()*rho()*G*epsilon_()/k_()
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha()*rho()*divU, epsilon_) - fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha()*rho()*divU, epsilon_)
- fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_) - fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
+ epsilonSource() + epsilonSource()
+ fvOptions(alpha, rho, epsilon_) + fvOptions(alpha, rho, epsilon_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,7 +125,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const
{ {
fixedValueFvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl; os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ public:
//- Evaluate the patchField //- Evaluate the patchField
virtual void evaluate virtual void evaluate
( (
const Pstream::commsTypes commsType=Pstream::Pstream::blocking const Pstream::commsTypes commsType=Pstream::blocking
); );

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,7 +147,7 @@ namespace Foam
os << nl; os << nl;
} }
} // end namespace }
template<class Type> template<class Type>
@ -183,17 +183,24 @@ void Foam::csvSetWriter<Type>::writeCoordHeader
Ostream& os Ostream& os
) const ) const
{ {
const word axisName(points.axis());
if (points.hasVectorAxis()) if (points.hasVectorAxis())
{ {
forAll(points, i) for
(
word::const_iterator iter = axisName.begin();
iter != axisName.end();
++iter
)
{ {
os << points.axis()[i]; os << *iter;
writeSeparator(os); writeSeparator(os);
} }
} }
else else
{ {
os << points.axis(); os << axisName;
writeSeparator(os); writeSeparator(os);
} }
} }

View file

@ -33,6 +33,9 @@ Description
\f[ \f[
p_rgh = p - \rho g.(h - hRef) p_rgh = p - \rho g.(h - hRef)
\f]
\f[
p = p0 - 0.5 \rho |U|^2 p = p0 - 0.5 \rho |U|^2
\f] \f]

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1255,7 +1255,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtUfCorr
ddt0_<GeometricField<Type, fvPatchField, volMesh>> ddt0_<GeometricField<Type, fvPatchField, volMesh>>
( (
"ddt0(" + rho.name() + ',' + U.name() + ')', "ddt0(" + rho.name() + ',' + U.name() + ')',
U.dimensions() rho.dimensions()*U.dimensions()
); );
DDt0Field<GeometricField<Type, fvsPatchField, surfaceMesh>>& dUfdt0 = DDt0Field<GeometricField<Type, fvsPatchField, surfaceMesh>>& dUfdt0 =
@ -1350,7 +1350,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
ddt0_<GeometricField<Type, fvPatchField, volMesh>> ddt0_<GeometricField<Type, fvPatchField, volMesh>>
( (
"ddt0(" + rho.name() + ',' + U.name() + ')', "ddt0(" + rho.name() + ',' + U.name() + ')',
U.dimensions() rho.dimensions()*U.dimensions()
); );
DDt0Field<fluxFieldType>& dphidt0 = DDt0Field<fluxFieldType>& dphidt0 =

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -202,8 +202,8 @@ void Foam::MULES::limiterCorr
scalarField psiMaxn(psiIf.size(), psiMin); scalarField psiMaxn(psiIf.size(), psiMin);
scalarField psiMinn(psiIf.size(), psiMax); scalarField psiMinn(psiIf.size(), psiMax);
scalarField sumPhip(psiIf.size(), VSMALL); scalarField sumPhip(psiIf.size(), 0.0);
scalarField mSumPhim(psiIf.size(), VSMALL); scalarField mSumPhim(psiIf.size(), 0.0);
forAll(phiCorrIf, facei) forAll(phiCorrIf, facei)
{ {
@ -361,7 +361,7 @@ void Foam::MULES::limiterCorr
max(min max(min
( (
(sumlPhip[celli] + psiMaxn[celli]) (sumlPhip[celli] + psiMaxn[celli])
/(mSumPhim[celli] - SMALL), /(mSumPhim[celli] + ROOTVSMALL),
1.0), 0.0 1.0), 0.0
); );
@ -369,7 +369,7 @@ void Foam::MULES::limiterCorr
max(min max(min
( (
(mSumlPhim[celli] + psiMinn[celli]) (mSumlPhim[celli] + psiMinn[celli])
/(sumPhip[celli] + SMALL), /(sumPhip[celli] + ROOTVSMALL),
1.0), 0.0 1.0), 0.0
); );
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -236,8 +236,8 @@ void Foam::MULES::limiter
scalarField sumPhiBD(psiIf.size(), 0.0); scalarField sumPhiBD(psiIf.size(), 0.0);
scalarField sumPhip(psiIf.size(), VSMALL); scalarField sumPhip(psiIf.size(), 0.0);
scalarField mSumPhim(psiIf.size(), VSMALL); scalarField mSumPhim(psiIf.size(), 0.0);
forAll(phiCorrIf, facei) forAll(phiCorrIf, facei)
{ {
@ -428,7 +428,7 @@ void Foam::MULES::limiter
max(min max(min
( (
(sumlPhip[celli] + psiMaxn[celli]) (sumlPhip[celli] + psiMaxn[celli])
/(mSumPhim[celli] - SMALL), /(mSumPhim[celli] + ROOTVSMALL),
1.0), 0.0 1.0), 0.0
); );
@ -436,7 +436,7 @@ void Foam::MULES::limiter
max(min max(min
( (
(mSumlPhim[celli] + psiMinn[celli]) (mSumlPhim[celli] + psiMinn[celli])
/(sumPhip[celli] + SMALL), /(sumPhip[celli] + ROOTVSMALL),
1.0), 0.0 1.0), 0.0
); );
} }

View file

@ -52,11 +52,11 @@ bool Foam::functionObjects::MachNo::calc()
if if
( (
foundObject<volVectorField>(fieldName_) foundObject<volVectorField>(fieldName_)
&& mesh_.foundObject<fluidThermo>(fluidThermo::dictName) && foundObject<fluidThermo>(fluidThermo::dictName)
) )
{ {
const fluidThermo& thermo = const fluidThermo& thermo =
mesh_.lookupObject<fluidThermo>(fluidThermo::dictName); lookupObject<fluidThermo>(fluidThermo::dictName);
const volVectorField& U = lookupObject<volVectorField>(fieldName_); const volVectorField& U = lookupObject<volVectorField>(fieldName_);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ namespace functionObjects
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::functionObjects::fieldAverage::resetFields() void Foam::functionObjects::fieldAverage::resetFields()
{ {
@ -67,6 +67,27 @@ void Foam::functionObjects::fieldAverage::resetFields()
void Foam::functionObjects::fieldAverage::initialize() void Foam::functionObjects::fieldAverage::initialize()
{ {
if (!totalIter_.size())
{
totalIter_.setSize(faItems_.size(), 1);
}
if (!totalTime_.size())
{
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
}
else
{
// Check if totalTime_ has been set otherwise initialize
forAll(totalTime_, fieldi)
{
if (totalTime_[fieldi] < 0)
{
totalTime_[fieldi] = obr_.time().deltaTValue();
}
}
}
resetFields(); resetFields();
// Add mean fields to the field lists // Add mean fields to the field lists
@ -95,15 +116,11 @@ void Foam::functionObjects::fieldAverage::initialize()
void Foam::functionObjects::fieldAverage::restart() void Foam::functionObjects::fieldAverage::restart()
{ {
Log Log << " Restarting averaging at time " << obr_.time().timeName()
<< " Restarting averaging at time " << obr_.time().timeName()
<< nl << endl; << nl << endl;
totalIter_.clear(); totalIter_.clear();
totalIter_.setSize(faItems_.size(), 1);
totalTime_.clear(); totalTime_.clear();
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
initialize(); initialize();
} }
@ -134,8 +151,7 @@ void Foam::functionObjects::fieldAverage::calcAverages()
periodIndex_++; periodIndex_++;
} }
Log Log << type() << " " << name() << " write:" << nl
<< type() << " " << name() << " write:" << nl
<< " Calculating averages" << nl; << " Calculating averages" << nl;
addMeanSqrToPrime2Mean<scalar, scalar>(); addMeanSqrToPrime2Mean<scalar, scalar>();
@ -206,12 +222,6 @@ void Foam::functionObjects::fieldAverage::writeAveragingProperties() const
void Foam::functionObjects::fieldAverage::readAveragingProperties() void Foam::functionObjects::fieldAverage::readAveragingProperties()
{ {
totalIter_.clear();
totalIter_.setSize(faItems_.size(), 1);
totalTime_.clear();
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
if ((restartOnRestart_ || restartOnOutput_) && log) if ((restartOnRestart_ || restartOnOutput_) && log)
{ {
Info<< " Starting averaging at time " << obr_.time().timeName() Info<< " Starting averaging at time " << obr_.time().timeName()
@ -232,8 +242,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
if (!propsDictHeader.headerOk()) if (!propsDictHeader.headerOk())
{ {
Log Log << " Starting averaging at time "
<< " Starting averaging at time "
<< obr_.time().timeName() << nl; << obr_.time().timeName() << nl;
return; return;
@ -243,6 +252,12 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
Log << " Restarting averaging for fields:" << nl; Log << " Restarting averaging for fields:" << nl;
totalIter_.setSize(faItems_.size(), 1);
// Initialize totalTime with negative values
// to indicate that it has not been set
totalTime_.setSize(faItems_.size(), -1);
forAll(faItems_, fieldi) forAll(faItems_, fieldi)
{ {
const word& fieldName = faItems_[fieldi].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
@ -253,8 +268,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter")); totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime")); totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
Log Log << " " << fieldName
<< " " << fieldName
<< " iters = " << totalIter_[fieldi] << " iters = " << totalIter_[fieldi]
<< " time = " << totalTime_[fieldi] << nl; << " time = " << totalTime_[fieldi] << nl;
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,7 +56,7 @@ fieldCoordinateSystemTransform
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
fieldSet_(), fieldSet_(),
coordSys_(mesh_, dict) coordSys_(mesh_, dict.subDict("coordinateSystem"))
{ {
read(dict); read(dict);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,13 +45,18 @@ Description
UMean UMean
UPrime2Mean UPrime2Mean
); );
coordinateSystem coordinateSystem
{ {
origin (0.001 0 0); origin (0.001 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0.15 0); e1 (1 0.15 0);
e3 (0 0 -1); e3 (0 0 -1);
} }
} }
}
\endverbatim \endverbatim
Usage Usage

View file

@ -40,11 +40,15 @@ functions
coordinateSystem coordinateSystem
{ {
origin (0.001 0 0); origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0.15 0); e1 (1 0.15 0);
e3 (0 0 -1); e3 (0 0 -1);
} }
} }
}
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -39,13 +39,6 @@ namespace functionObjects
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
bool Foam::functionObjects::fieldExpression::calc()
{
NotImplemented;
return false;
}
void Foam::functionObjects::fieldExpression::setResultName void Foam::functionObjects::fieldExpression::setResultName
( (
const word& typeName, const word& typeName,
@ -121,8 +114,8 @@ bool Foam::functionObjects::fieldExpression::execute()
if (!calc()) if (!calc())
{ {
Warning Warning
<< "functionObject " << type() << ": Cannot find required field " << " functionObjects::" << type() << " " << name()
<< fieldName_ << endl; << " failed to execute." << endl;
// Clear the result field from the objectRegistry if present // Clear the result field from the objectRegistry if present
clear(); clear();

View file

@ -71,10 +71,13 @@ protected:
// Protected member functions // Protected member functions
virtual bool calc(); virtual bool calc() = 0;
void setResultName(const word& typeName, const word& defaultArg); void setResultName(const word& typeName, const word& defaultArg);
template<class Type>
bool foundObject(const word& name);
private: private:
@ -133,6 +136,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "fieldExpressionTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View file

@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fieldExpression.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class Type>
bool Foam::functionObjects::fieldExpression::foundObject
(
const word& name
)
{
if (fvMeshFunctionObject::foundObject<Type>(name))
{
return true;
}
else
{
Warning
<< " functionObjects::" << type() << " " << this->name()
<< " cannot find required object " << name << " of type "
<< Type::typeName << endl;
return false;
}
}
// ************************************************************************* //

View file

@ -28,7 +28,7 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
This function object calculates the value and location of scalar minimim This function object calculates the value and location of scalar minimum
and maximum for a list of user-specified fields. For variables with a rank and maximum for a list of user-specified fields. For variables with a rank
greater than zero, either the min/max of a component value or the magnitude greater than zero, either the min/max of a component value or the magnitude
is reported. When operating in parallel, the processor owning the value is reported. When operating in parallel, the processor owning the value

View file

@ -84,52 +84,52 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
{ {
case opSum: case opSum:
{ {
result = sum(values); result = gSum(values);
break; break;
} }
case opSumMag: case opSumMag:
{ {
result = sum(cmptMag(values)); result = gSum(cmptMag(values));
break; break;
} }
case opAverage: case opAverage:
{ {
result = sum(values)/values.size(); result = gSum(values)/nCells_;
break; break;
} }
case opWeightedAverage: case opWeightedAverage:
{ {
result = sum(weightField*values)/sum(weightField); result = gSum(weightField*values)/gSum(weightField);
break; break;
} }
case opVolAverage: case opVolAverage:
{ {
result = sum(V*values)/sum(V); result = gSum(V*values)/volume_;
break; break;
} }
case opWeightedVolAverage: case opWeightedVolAverage:
{ {
result = sum(weightField*V*values)/sum(weightField*V); result = gSum(weightField*V*values)/gSum(weightField*V);
break; break;
} }
case opVolIntegrate: case opVolIntegrate:
{ {
result = sum(V*values); result = gSum(V*values);
break; break;
} }
case opMin: case opMin:
{ {
result = min(values); result = gMin(values);
break; break;
} }
case opMax: case opMax:
{ {
result = max(values); result = gMax(values);
break; break;
} }
case opCoV: case opCoV:
{ {
Type meanValue = sum(values*V)/sum(V); Type meanValue = gSum(values*V)/volume_;
const label nComp = pTraits<Type>::nComponents; const label nComp = pTraits<Type>::nComponents;
@ -139,7 +139,7 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
scalar mean = component(meanValue, d); scalar mean = component(meanValue, d);
scalar& res = setComponent(result, d); scalar& res = setComponent(result, d);
res = sqrt(sum(V*sqr(vals - mean))/sum(V))/mean; res = sqrt(gSum(V*sqr(vals - mean))/volume_)/mean;
} }
break; break;
@ -173,14 +173,10 @@ bool Foam::functionObjects::fieldValues::volRegion::writeValues
weightField = setFieldValues<scalar>(weightFieldName_, true); weightField = setFieldValues<scalar>(weightFieldName_, true);
} }
// Combine onto master Type result = processValues(values, V, weightField);
combineFields(values);
combineFields(V);
combineFields(weightField);
if (Pstream::master()) if (Pstream::master())
{ {
Type result = processValues(values, V, weightField);
// Add to result dictionary, over-writing any previous entry // Add to result dictionary, over-writing any previous entry
resultDict_.add(fieldName, result, true); resultDict_.add(fieldName, result, true);

View file

@ -39,7 +39,7 @@ bool Foam::functionObjects::grad::calcGrad()
( (
resultName_, resultName_,
fvc::grad(lookupObject<VolFieldType>(fieldName_)), fvc::grad(lookupObject<VolFieldType>(fieldName_)),
true mesh_.changing() && mesh_.cache(resultName_)
); );
} }
else if (foundObject<SurfaceFieldType>(fieldName_)) else if (foundObject<SurfaceFieldType>(fieldName_))
@ -48,7 +48,7 @@ bool Foam::functionObjects::grad::calcGrad()
( (
resultName_, resultName_,
fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)), fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)),
true mesh_.changing() && mesh_.cache(resultName_)
); );
} }
else else

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -324,22 +324,7 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict)
Info<< type() << " " << name() << ":" << nl; Info<< type() << " " << name() << ":" << nl;
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
if (dict.found("U")) UName_ = dict.lookupOrDefault("U", word("U"));
{
dict.lookup("U") >> UName_;
}
else
{
UName_ = "U";
if (dict.found("U"))
{
IOWarningInFunction(dict)
<< "Using deprecated entry \"U\"."
<< " Please use \"UName\" instead."
<< endl;
dict.lookup("U") >> UName_;
}
}
if (findIndex(fields_, UName_) == -1) if (findIndex(fields_, UName_) == -1)
{ {

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,16 +40,20 @@ Description
libs ("libfieldFunctionObjects.so"); libs ("libfieldFunctionObjects.so");
... ...
setFormat vtk; setFormat vtk;
U U;
trackForward yes; trackForward yes;
fields fields
( (
U U
p p
); );
lifeTime 10000; lifeTime 10000;
trackLength 1e-3; trackLength 1e-3;
nSubCycle 5; nSubCycle 5;
cloudName particleTracks; cloudName particleTracks;
seedSampleSet uniform; seedSampleSet uniform;
uniformCoeffs uniformCoeffs
{ {
@ -67,7 +71,7 @@ Usage
Property | Description | Required | Default value Property | Description | Required | Default value
type | Type name: streamLine | yes | type | Type name: streamLine | yes |
setFormat | Output data type | yes | setFormat | Output data type | yes |
U | Tracking velocity field name | yes | U | Tracking velocity field name | no | U
fields | Fields to sample | yes | fields | Fields to sample | yes |
lifetime | Maximum number of particle tracking steps | yes | lifetime | Maximum number of particle tracking steps | yes |
trackLength | Tracking segment length | no | trackLength | Tracking segment length | no |

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -441,24 +441,7 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
{ {
//dict_ = dict; //dict_ = dict;
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
if (dict.found("U"))
{
dict.lookup("U") >> UName_; dict.lookup("U") >> UName_;
}
else
{
UName_ = "U";
if (dict.found("U"))
{
IOWarningInFunction
(
dict
) << "Using deprecated entry \"U\"."
<< " Please use \"UName\" instead."
<< endl;
dict.lookup("U") >> UName_;
}
}
if (findIndex(fields_, UName_) == -1) if (findIndex(fields_, UName_) == -1)
{ {

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,6 +64,8 @@ void Foam::functionObjects::wallShearStress::calcShearStress
volVectorField& shearStress volVectorField& shearStress
) )
{ {
shearStress.dimensions().reset(Reff.dimensions());
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchi = iter.key(); label patchi = iter.key();

View file

@ -141,7 +141,7 @@ Foam::functionObjects::yPlus::yPlus
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedScalar("0", dimless, 0.0) dimensionedScalar("0", dimless, 0.0)
@ -150,6 +150,7 @@ Foam::functionObjects::yPlus::yPlus
mesh.objectRegistry::store(yPlusPtr); mesh.objectRegistry::store(yPlusPtr);
read(dict);
resetName(typeName); resetName(typeName);
} }

View file

@ -156,6 +156,9 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
// Free stream velocity magnitude // Free stream velocity magnitude
dict.lookup("magUInf") >> magUInf_; dict.lookup("magUInf") >> magUInf_;
// Reference (free stream) density
dict.lookup("rhoInf") >> rhoRef_;
// Reference length and area scales // Reference length and area scales
dict.lookup("lRef") >> lRef_; dict.lookup("lRef") >> lRef_;
dict.lookup("Aref") >> Aref_; dict.lookup("Aref") >> Aref_;

View file

@ -639,7 +639,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
// Reference density needed for incompressible calculations // Reference density needed for incompressible calculations
if (rhoName_ == "rhoInf") if (rhoName_ == "rhoInf")
{ {
rhoRef_ = readScalar(dict.lookup("rhoInf")); dict.lookup("rhoInf") >> rhoRef_;
} }
// Reference pressure, 0 by default // Reference pressure, 0 by default

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -254,7 +254,7 @@ bool Foam::functionObjects::scalarTransport::execute()
FatalErrorInFunction FatalErrorInFunction
<< "Incompatible dimensions for phi: " << phi.dimensions() << nl << "Incompatible dimensions for phi: " << phi.dimensions() << nl
<< "Dimensions should be " << dimMass/dimTime << " or " << "Dimensions should be " << dimMass/dimTime << " or "
<< dimVolume/dimTime << endl; << dimVolume/dimTime << exit(FatalError);
} }
Info<< endl; Info<< endl;

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ namespace Foam
); );
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::codedFunctionObject::prepare void Foam::codedFunctionObject::prepare
( (
@ -284,6 +284,16 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
); );
} }
if(!dataPtr && !readPtr && !execPtr && !writePtr && !endPtr)
{
IOWarningInFunction
(
dict
) << "No critical \"code\" prefixed keywords were found."
<< " Please check the code documentation for more details."
<< nl << endl;
}
updateLibrary(name_); updateLibrary(name_);
return redirectFunctionObject().read(dict); return redirectFunctionObject().read(dict);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,19 +28,20 @@ Group
grpUtilitiesFunctionObjects grpUtilitiesFunctionObjects
Description Description
This function object provides a general interface to enable dynamic code Provides a general interface to enable dynamic code compilation.
compilation.
The entries are The entries are:
codeInclude : include files \plaintable
codeOptions : include paths; inserted into EXE_INC in Make/options codeInclude | include files
codeLibs : link line; inserted into LIB_LIBS in Make/options codeOptions | include paths; inserted into EXE_INC in Make/options
codeData : c++; local member data (null constructed); codeLibs | link line; inserted into LIB_LIBS in Make/options
localCode : c++; local static functions codeData | c++; local member data (null constructed);
codeRead : c++; upon functionObject::read(); localCode | c++; local static functions;
codeExecute : c++;upon functionObject::execute(); codeRead | c++; upon functionObject::read();
codeWrite : c++; upon functionObject::write() codeExecute | c++; upon functionObject::execute();
codeEnd : c++; upon functionObject::end(); codeWrite | c++; upon functionObject::write()
codeEnd | c++; upon functionObject::end();
\endplaintable
Example of function object specification: Example of function object specification:
\verbatim \verbatim
@ -56,12 +57,11 @@ Description
// Lookup U // Lookup U
const volVectorField& U = mesh().lookupObject<volVectorField>("U"); const volVectorField& U = mesh().lookupObject<volVectorField>("U");
// Write // Write
mag(U).write(); mag(U)().write();
} #};"
} }
\endverbatim \endverbatim
See also See also
Foam::functionObject Foam::functionObject
Foam::codedBase Foam::codedBase

View file

@ -1,4 +0,0 @@
systemCall.C
systemCallFunctionObject.C
LIB = $(FOAM_LIBBIN)/libsystemCall

View file

@ -261,7 +261,12 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
{ {
// If we are running in parallel and the particle is on a // If we are running in parallel and the particle is on a
// boundary face // boundary face
if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces()) if
(
Pstream::parRun()
&& td.switchProcessor
&& p.face() >= pMesh().nInternalFaces()
)
{ {
label patchi = pbm.whichPatch(p.face()); label patchi = pbm.whichPatch(p.face());

View file

@ -96,7 +96,8 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
pc_, pc_,
this->Tc_, this->Tc_,
X, X,
dMassPC dMassPC,
this->rhoc_
); );
// Limit phase change mass by availability of each specie // Limit phase change mass by availability of each specie

View file

@ -30,6 +30,7 @@ License
#include "NoPhaseChange.H" #include "NoPhaseChange.H"
#include "LiquidEvaporation.H" #include "LiquidEvaporation.H"
#include "LiquidEvaporationConvDiff.H"
#include "LiquidEvaporationBoil.H" #include "LiquidEvaporationBoil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,6 +40,7 @@ License
makePhaseChangeModel(CloudType); \ makePhaseChangeModel(CloudType); \
makePhaseChangeModelType(NoPhaseChange, CloudType); \ makePhaseChangeModelType(NoPhaseChange, CloudType); \
makePhaseChangeModelType(LiquidEvaporation, CloudType); \ makePhaseChangeModelType(LiquidEvaporation, CloudType); \
makePhaseChangeModelType(LiquidEvaporationConvDiff, CloudType); \
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType); makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);

View file

@ -142,7 +142,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const ) const
{ {
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition
@ -196,8 +197,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
// vapour concentration at surface [kmol/m3] at film temperature // vapour concentration at surface [kmol/m3] at film temperature
const scalar Cs = pSat/(RR*Ts); const scalar Cs = pSat/(RR*Ts);
// vapour concentration in bulk gas [kmol/m3] at film temperature // vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
const scalar Cinf = Xc[gid]*pc/(RR*Ts); const scalar Cinf = Xc[gid]*pc/(RR*Tc);
// molar flux of vapour [kmol/m2/s] // molar flux of vapour [kmol/m2/s]
const scalar Ni = max(kc*(Cs - Cinf), 0.0); const scalar Ni = max(kc*(Cs - Cinf), 0.0);

View file

@ -119,7 +119,8 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const; ) const;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -142,7 +142,8 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const ) const
{ {
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition

View file

@ -129,7 +129,8 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const; ) const;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -0,0 +1,287 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "LiquidEvaporationConvDiff.H"
#include "specie.H"
#include "mathematicalConstants.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class CloudType>
Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationConvDiff<CloudType>::calcXc
(
const label celli
) const
{
scalarField Xc(this->owner().thermo().carrier().Y().size());
forAll(Xc, i)
{
Xc[i] =
this->owner().thermo().carrier().Y()[i][celli]
/this->owner().thermo().carrier().W(i);
}
return Xc/sum(Xc);
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Sh
(
const scalar Re,
const scalar Sc
) const
{
return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
(
const dictionary& dict,
CloudType& owner
)
:
PhaseChangeModel<CloudType>(dict, owner, typeName),
liquids_(owner.thermo().liquids()),
activeLiquids_(this->coeffDict().lookup("activeLiquids")),
liqToCarrierMap_(activeLiquids_.size(), -1),
liqToLiqMap_(activeLiquids_.size(), -1)
{
if (activeLiquids_.size() == 0)
{
WarningInFunction
<< "Evaporation model selected, but no active liquids defined"
<< nl << endl;
}
else
{
Info<< "Participating liquid species:" << endl;
// Determine mapping between liquid and carrier phase species
forAll(activeLiquids_, i)
{
Info<< " " << activeLiquids_[i] << endl;
liqToCarrierMap_[i] =
owner.composition().carrierId(activeLiquids_[i]);
}
// Determine mapping between model active liquids and global liquids
const label idLiquid = owner.composition().idLiquid();
forAll(activeLiquids_, i)
{
liqToLiqMap_[i] =
owner.composition().localId(idLiquid, activeLiquids_[i]);
}
}
}
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
(
const LiquidEvaporationConvDiff<CloudType>& pcm
)
:
PhaseChangeModel<CloudType>(pcm),
liquids_(pcm.owner().thermo().liquids()),
activeLiquids_(pcm.activeLiquids_),
liqToCarrierMap_(pcm.liqToCarrierMap_),
liqToLiqMap_(pcm.liqToLiqMap_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::LiquidEvaporationConvDiff<CloudType>::~LiquidEvaporationConvDiff()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::LiquidEvaporationConvDiff<CloudType>::calculate
(
const scalar dt,
const label celli,
const scalar Re,
const scalar Pr,
const scalar d,
const scalar nu,
const scalar T,
const scalar Ts,
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc //POSECH
) const
{
// immediately evaporate mass that has reached critical condition
if ((liquids_.Tc(X) - T) < SMALL)
{
if (debug)
{
WarningInFunction
<< "Parcel reached critical conditions: "
<< "evaporating all avaliable mass" << endl;
}
forAll(activeLiquids_, i)
{
const label lid = liqToLiqMap_[i];
dMassPC[lid] = GREAT;
}
return;
}
// construct carrier phase species volume fractions for cell, celli
const scalarField Xc(calcXc(celli));
// calculate mass transfer of each specie in liquid
forAll(activeLiquids_, i)
{
const label gid = liqToCarrierMap_[i];
const label lid = liqToLiqMap_[i];
// vapour diffusivity [m2/s]
const scalar Dab = liquids_.properties()[lid].D(pc, Ts);
// saturation pressure for species i [pa]
// - carrier phase pressure assumed equal to the liquid vapour pressure
// close to the surface
// NOTE: if pSat > pc then particle is superheated
// calculated evaporation rate will be greater than that of a particle
// at boiling point, but this is not a boiling model
const scalar pSat = liquids_.properties()[lid].pv(pc, T);
// Schmidt number
const scalar Sc = nu/(Dab + ROOTVSMALL);
// Sherwood number
const scalar Sh = this->Sh(Re, Sc);
// mass transfer coefficient [m/s]
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
// vapour concentration at surface [kmol/m3] at film temperature
const scalar Cs = pSat/(RR*Ts);
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
// molar flux of vapour [kmol/m2/s]
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
// droplet surface pressure assumed to surface vapour pressure
const scalar ps = liquids_.pv(pc, Ts, X);
// vapour density at droplet surface [kg/m3]
const scalar rhos = ps*liquids_.W(X)/(RR*Ts);
// vapour mass fraction at surface
const scalar Ys = min((Cs*liquids_.W(X)/rhos),0.9);
// vapour mass fraction in bulk gas
const scalar Yinf = Cinf*liquids_.W(X)/rhos;
// Spalding mass number
const scalar Bm = max(((Ys - Yinf)/(1.0 - Ys)),0.0);
// mass transfer [kg]
dMassPC[lid] += kc*pi*sqr(d)*rhoc*log(1+Bm)*dt;
}
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::dh
(
const label idc,
const label idl,
const scalar p,
const scalar T
) const
{
scalar dh = 0;
typedef PhaseChangeModel<CloudType> parent;
switch (parent::enthalpyTransfer_)
{
case (parent::etLatentHeat):
{
dh = liquids_.properties()[idl].hl(p, T);
break;
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Ha(idc, p, T);
scalar hp = liquids_.properties()[idl].h(p, T);
dh = hc - hp;
break;
}
default:
{
FatalErrorInFunction
<< "Unknown enthalpyTransfer type" << abort(FatalError);
}
}
return dh;
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Tvap
(
const scalarField& X
) const
{
return liquids_.Tpt(X);
}
template<class CloudType>
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::TMax
(
const scalar p,
const scalarField& X
) const
{
return liquids_.pvInvert(p, X);
}
// ************************************************************************* //

View file

@ -0,0 +1,157 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::LiquidEvaporationConvDiff
Description
Liquid evaporation model
- uses ideal gas assumption
\*---------------------------------------------------------------------------*/
#ifndef LiquidEvaporationConvDiff_H
#define LiquidEvaporationConvDiff_H
#include "PhaseChangeModel.H"
#include "liquidMixtureProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class LiquidEvaporationConvDiff Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class LiquidEvaporationConvDiff
:
public PhaseChangeModel<CloudType>
{
protected:
// Protected data
//- Global liquid properties data
const liquidMixtureProperties& liquids_;
//- List of active liquid names
List<word> activeLiquids_;
//- Mapping between liquid and carrier species
List<label> liqToCarrierMap_;
//- Mapping between local and global liquid species
List<label> liqToLiqMap_;
// Protected Member Functions
//- Sherwood number as a function of Reynolds and Schmidt numbers
scalar Sh(const scalar Re, const scalar Sc) const;
//- Calculate the carrier phase component volume fractions at celli
tmp<scalarField> calcXc(const label celli) const;
public:
//- Runtime type information
TypeName("liquidEvaporationConvDiff");
// Constructors
//- Construct from dictionary
LiquidEvaporationConvDiff(const dictionary& dict, CloudType& cloud);
//- Construct copy
LiquidEvaporationConvDiff(const LiquidEvaporationConvDiff<CloudType>& pcm);
//- Construct and return a clone
virtual autoPtr<PhaseChangeModel<CloudType>> clone() const
{
return autoPtr<PhaseChangeModel<CloudType>>
(
new LiquidEvaporationConvDiff<CloudType>(*this)
);
}
//- Destructor
virtual ~LiquidEvaporationConvDiff();
// Member Functions
//- Update model
virtual void calculate
(
const scalar dt,
const label celli,
const scalar Re,
const scalar Pr,
const scalar d,
const scalar nu,
const scalar T,
const scalar Ts,
const scalar pc,
const scalar Tc,
const scalarField& X,
scalarField& dMassPC,
const scalar rhoc
) const;
//- Return the enthalpy per unit mass
virtual scalar dh
(
const label idc,
const label idl,
const scalar p,
const scalar T
) const;
//- Return vapourisation temperature
virtual scalar Tvap(const scalarField& X) const;
//- Return maximum/limiting temperature
virtual scalar TMax(const scalar p, const scalarField& X) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "LiquidEvaporationConvDiff.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -78,7 +78,8 @@ void Foam::NoPhaseChange<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const ) const
{ {
// Nothing to do... // Nothing to do...

View file

@ -94,7 +94,8 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const; ) const;
}; };

View file

@ -166,7 +166,8 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC scalarField& dMassPC,
const scalar rhoc
) const = 0; ) const = 0;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,7 +53,6 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
) << "Unknown coordinateRotation type " ) << "Unknown coordinateRotation type "
<< rotType << nl << nl << rotType << nl << nl
<< "Valid coordinateRotation types are :" << nl << "Valid coordinateRotation types are :" << nl
<< "[default: axes ]"
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }
@ -87,7 +86,6 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
) << "Unknown coordinateRotation type " ) << "Unknown coordinateRotation type "
<< rotType << nl << nl << rotType << nl << nl
<< "Valid coordinateRotation types are :" << nl << "Valid coordinateRotation types are :" << nl
<< "[default: axes ]"
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,9 +35,9 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(meshSearch, 0); defineTypeNameAndDebug(meshSearch, 0);
scalar meshSearch::tol_ = 1e-3; scalar meshSearch::tol_ = 1e-3;
} }
@ -117,7 +117,6 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
} }
// linear searching
Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
{ {
const vectorField& centres = mesh_.cellCentres(); const vectorField& centres = mesh_.cellCentres();
@ -137,7 +136,6 @@ Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findNearestCellWalk Foam::label Foam::meshSearch::findNearestCellWalk
( (
const point& location, const point& location,
@ -174,7 +172,6 @@ Foam::label Foam::meshSearch::findNearestCellWalk
} }
// tree based searching
Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
{ {
// Search nearest cell centre. // Search nearest cell centre.
@ -214,7 +211,6 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
} }
// linear searching
Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
{ {
const vectorField& centres = mesh_.faceCentres(); const vectorField& centres = mesh_.faceCentres();
@ -234,7 +230,6 @@ Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findNearestFaceWalk Foam::label Foam::meshSearch::findNearestFaceWalk
( (
const point& location, const point& location,
@ -322,7 +317,6 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findCellWalk Foam::label Foam::meshSearch::findCellWalk
( (
const point& location, const point& location,
@ -502,7 +496,10 @@ Foam::meshSearch::meshSearch
mesh_(mesh), mesh_(mesh),
cellDecompMode_(cellDecompMode) cellDecompMode_(cellDecompMode)
{ {
if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS) if
(
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|| cellDecompMode_ == polyMesh::CELL_TETS)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();
@ -510,7 +507,6 @@ Foam::meshSearch::meshSearch
} }
// Construct with a custom bounding box
Foam::meshSearch::meshSearch Foam::meshSearch::meshSearch
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -523,7 +519,11 @@ Foam::meshSearch::meshSearch
{ {
overallBbPtr_.reset(new treeBoundBox(bb)); overallBbPtr_.reset(new treeBoundBox(bb));
if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS) if
(
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|| cellDecompMode_ == polyMesh::CELL_TETS
)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();
@ -541,8 +541,8 @@ Foam::meshSearch::~meshSearch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree() const Foam::indexedOctree<Foam::treeDataFace>&
const Foam::meshSearch::boundaryTree() const
{ {
if (!boundaryTreePtr_.valid()) if (!boundaryTreePtr_.valid())
{ {
@ -594,8 +594,8 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
} }
const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree() const Foam::indexedOctree<Foam::treeDataCell>&
const Foam::meshSearch::cellTree() const
{ {
if (!cellTreePtr_.valid()) if (!cellTreePtr_.valid())
{ {
@ -640,92 +640,6 @@ const
} }
//// Is the point in the cell
//// Works by checking if there is a face inbetween the point and the cell
//// centre.
//// Check for internal uses proper face decomposition or just average normal.
//bool Foam::meshSearch::pointInCell(const point& p, label celli) const
//{
// if (faceDecomp_)
// {
// const point& ctr = mesh_.cellCentres()[celli];
//
// vector dir(p - ctr);
// scalar magDir = mag(dir);
//
// // Check if any faces are hit by ray from cell centre to p.
// // If none -> p is in cell.
// const labelList& cFaces = mesh_.cells()[celli];
//
// // Make sure half_ray does not pick up any faces on the wrong
// // side of the ray.
// scalar oldTol = intersection::setPlanarTol(0.0);
//
// forAll(cFaces, i)
// {
// label facei = cFaces[i];
//
// pointHit inter = mesh_.faces()[facei].ray
// (
// ctr,
// dir,
// mesh_.points(),
// intersection::HALF_RAY,
// intersection::VECTOR
// );
//
// if (inter.hit())
// {
// scalar dist = inter.distance();
//
// if (dist < magDir)
// {
// // Valid hit. Hit face so point is not in cell.
// intersection::setPlanarTol(oldTol);
//
// return false;
// }
// }
// }
//
// intersection::setPlanarTol(oldTol);
//
// // No face inbetween point and cell centre so point is inside.
// return true;
// }
// else
// {
// const labelList& f = mesh_.cells()[celli];
// const labelList& owner = mesh_.faceOwner();
// const vectorField& cf = mesh_.faceCentres();
// const vectorField& Sf = mesh_.faceAreas();
//
// forAll(f, facei)
// {
// label nFace = f[facei];
// vector proj = p - cf[nFace];
// vector normal = Sf[nFace];
// if (owner[nFace] == celli)
// {
// if ((normal & proj) > 0)
// {
// return false;
// }
// }
// else
// {
// if ((normal & proj) < 0)
// {
// return false;
// }
// }
// }
//
// return true;
// }
//}
Foam::label Foam::meshSearch::findNearestCell Foam::label Foam::meshSearch::findNearestCell
( (
const point& location, const point& location,
@ -941,7 +855,6 @@ bool Foam::meshSearch::isInside(const point& p) const
} }
// Delete all storage
void Foam::meshSearch::clearOut() void Foam::meshSearch::clearOut()
{ {
boundaryTreePtr_.clear(); boundaryTreePtr_.clear();

View file

@ -291,7 +291,7 @@ Foam::labelList Foam::metisDecomp::decompose
fineDistribution[i] = finalDecomp[agglom[i]]; fineDistribution[i] = finalDecomp[agglom[i]];
} }
return finalDecomp; return fineDistribution;
} }

View file

@ -35,11 +35,11 @@ void Foam::processorMeshes::read()
// and fields // and fields
forAll(databases_, proci) forAll(databases_, proci)
{ {
meshes_.set(proci, NULL); boundaryProcAddressing_.set(proci, nullptr);
pointProcAddressing_.set(proci, NULL); cellProcAddressing_.set(proci, nullptr);
faceProcAddressing_.set(proci, NULL); faceProcAddressing_.set(proci, nullptr);
cellProcAddressing_.set(proci, NULL); pointProcAddressing_.set(proci, nullptr);
boundaryProcAddressing_.set(proci, NULL); meshes_.set(proci, nullptr);
} }
forAll(databases_, proci) forAll(databases_, proci)

Some files were not shown because too many files have changed in this diff Show more