lagrangian::NonInertialFrameForce: Use field references rather than copies

Patch contributed by Mattijs Janssens
This commit is contained in:
Henry Weller 2017-02-03 14:29:07 +00:00
parent 2ee2323d42
commit 6bdcb6f8ce

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
@ -121,7 +121,7 @@ void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
) )
) )
{ {
uniformDimensionedVectorField W = this->mesh().template const uniformDimensionedVectorField& W = this->mesh().template
lookupObject<uniformDimensionedVectorField>(WName_); lookupObject<uniformDimensionedVectorField>(WName_);
W_ = W.value(); W_ = W.value();
@ -135,7 +135,7 @@ void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
) )
) )
{ {
uniformDimensionedVectorField omega = this->mesh().template const uniformDimensionedVectorField& omega = this->mesh().template
lookupObject<uniformDimensionedVectorField>(omegaName_); lookupObject<uniformDimensionedVectorField>(omegaName_);
omega_ = omega.value(); omega_ = omega.value();
@ -149,7 +149,8 @@ void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
) )
) )
{ {
uniformDimensionedVectorField omegaDot = this->mesh().template const uniformDimensionedVectorField& omegaDot =
this->mesh().template
lookupObject<uniformDimensionedVectorField>(omegaDotName_); lookupObject<uniformDimensionedVectorField>(omegaDotName_);
omegaDot_ = omegaDot.value(); omegaDot_ = omegaDot.value();
@ -163,7 +164,7 @@ void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
) )
) )
{ {
uniformDimensionedVectorField centreOfRotation = const uniformDimensionedVectorField& centreOfRotation =
this->mesh().template this->mesh().template
lookupObject<uniformDimensionedVectorField> lookupObject<uniformDimensionedVectorField>
( (