mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
tmp: Improved reference count checks to provide better error diagnostics
in case of tmp misuse. Simplified tmp reuse pattern in field algebra to use tmp copy and assignment rather than the complex delayed call to 'ptr()'. Removed support for unused non-const 'REF' storage of non-tmp objects due to C++ limitation in constructor overloading: if both tmp(T&) and tmp(const T&) constructors are provided resolution is ambiguous. The turbulence libraries have been upgraded and '-DCONST_TMP' option specified in the 'options' file to switch to the new 'tmp' behavior.
This commit is contained in:
@ -201,7 +201,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd
|
||||
{
|
||||
if (phase1 == &phase)
|
||||
{
|
||||
tKd() += K;
|
||||
tKd.ref() += K;
|
||||
}
|
||||
|
||||
Swap(phase1, phase2);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = \
|
||||
EXE_INC = -DCONST_TMP \
|
||||
-I../multiphaseSystem/lnInclude \
|
||||
-I../../phaseSystems/lnInclude \
|
||||
-I../../interfacialModels/lnInclude\
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = \
|
||||
EXE_INC = -DCONST_TMP \
|
||||
-I../twoPhaseSystem/lnInclude \
|
||||
-I../../phaseSystems/lnInclude \
|
||||
-I../../interfacialModels/lnInclude\
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,7 +83,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
|
||||
) const
|
||||
{
|
||||
tmp<scalarField> typsf(new scalarField(this->size()));
|
||||
scalarField& ypsf = typsf();
|
||||
scalarField& ypsf = typsf.ref();
|
||||
|
||||
forAll(ypsf, faceI)
|
||||
{
|
||||
@ -197,7 +197,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
|
||||
scalarField yPlusTherm(this->yPlusTherm(P, Prat));
|
||||
|
||||
tmp<scalarField> talphatConv(new scalarField(this->size()));
|
||||
scalarField& alphatConv = talphatConv();
|
||||
scalarField& alphatConv = talphatConv.ref();
|
||||
|
||||
// Populate boundary values
|
||||
forAll(alphatConv, faceI)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& nuf = tnu();
|
||||
volScalarField& nuf = tnu.ref();
|
||||
|
||||
forAll(D, celli)
|
||||
{
|
||||
|
||||
@ -273,7 +273,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField();
|
||||
volScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
|
||||
@ -164,7 +164,8 @@ Foam::RASModels::phasePressureModel::pPrime() const
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField();
|
||||
volScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
@ -192,7 +193,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const
|
||||
);
|
||||
|
||||
surfaceScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime().boundaryField();
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = \
|
||||
EXE_INC = -DCONST_TMP \
|
||||
-I../twoPhaseSystem/lnInclude \
|
||||
-I../interfacialModels/lnInclude\
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& nuf = tnu();
|
||||
volScalarField& nuf = tnu.ref();
|
||||
|
||||
forAll(D, celli)
|
||||
{
|
||||
|
||||
@ -278,7 +278,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField();
|
||||
volScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
|
||||
@ -170,7 +170,8 @@ Foam::RASModels::phasePressureModel::pPrime() const
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField();
|
||||
volScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
@ -198,7 +199,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const
|
||||
);
|
||||
|
||||
surfaceScalarField::GeometricBoundaryField& bpPrime =
|
||||
tpPrime().boundaryField();
|
||||
tpPrime.ref().boundaryField();
|
||||
|
||||
forAll(bpPrime, patchi)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user