mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support 'if-present' handling of relaxation coefficients
- new
scalar relaxCoeff = 0;
if (solution().relaxEquation(name, relaxCoeff))
{
relax(relaxCoeff);
}
// or
scalar relaxCoeff = 0;
solution().relaxEquation(name, relaxCoeff);
- old
if (solution().relaxEquation(name))
{
relax(solution().equationRelaxationFactor(name));
}
// or
scalar relaxCoeff = 0;
if (solution().relaxEquation(name))
{
relaxCoeff = solution().equationRelaxationFactor(name);
}
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2021 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -173,10 +173,7 @@ bool Foam::functionObjects::age::execute()
|
||||
|
||||
// Set under-relaxation coeff
|
||||
scalar relaxCoeff = 0;
|
||||
if (mesh_.relaxEquation(schemesField_))
|
||||
{
|
||||
relaxCoeff = mesh_.equationRelaxationFactor(schemesField_);
|
||||
}
|
||||
mesh_.relaxEquation(schemesField_, relaxCoeff);
|
||||
|
||||
Foam::fv::options& fvOptions(Foam::fv::options::New(mesh_));
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -371,11 +371,8 @@ bool Foam::functionObjects::energyTransport::execute()
|
||||
);
|
||||
|
||||
// Set under-relaxation coeff
|
||||
scalar relaxCoeff = 0.0;
|
||||
if (mesh_.relaxEquation(schemesField_))
|
||||
{
|
||||
relaxCoeff = mesh_.equationRelaxationFactor(schemesField_);
|
||||
}
|
||||
scalar relaxCoeff = 0;
|
||||
mesh_.relaxEquation(schemesField_, relaxCoeff);
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -263,11 +263,8 @@ bool Foam::functionObjects::scalarTransport::execute()
|
||||
word laplacianScheme("laplacian(" + D.name() + "," + schemesField_ + ")");
|
||||
|
||||
// Set under-relaxation coeff
|
||||
scalar relaxCoeff = 0.0;
|
||||
if (mesh_.relaxEquation(schemesField_))
|
||||
{
|
||||
relaxCoeff = mesh_.equationRelaxationFactor(schemesField_);
|
||||
}
|
||||
scalar relaxCoeff = 0;
|
||||
mesh_.relaxEquation(schemesField_, relaxCoeff);
|
||||
|
||||
// Two phase scalar transport
|
||||
if (phaseName_ != "none")
|
||||
|
||||
Reference in New Issue
Block a user