ENH: scalarTransport: transfer write control from controlDict to function object

This commit is contained in:
Kutalmis Bercin
2022-01-06 16:05:12 +00:00
committed by Andrew Heather
parent ab976a5ac0
commit 32d3fabcfe

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -69,7 +69,7 @@ Foam::volScalarField& Foam::functionObjects::scalarTransport::transportedField()
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
mesh_
);
@ -374,6 +374,14 @@ bool Foam::functionObjects::scalarTransport::execute()
bool Foam::functionObjects::scalarTransport::write()
{
Log << type() << " write: " << name() << nl
<< tab << fieldName_ << nl
<< endl;
volScalarField& s = transportedField();
s.write();
return true;
}