fvModels,fvConstraints: Changed Function1(time) to Function1(user time)

Time-dependent input data is now expected to be specified in user-time rather
than real-time.
This commit is contained in:
Henry Weller
2022-01-26 12:45:54 +00:00
parent 8cb90dab4f
commit 4623ece721
15 changed files with 37 additions and 32 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ Foam::displacementLinearMotionMotionSolver::curPoints() const
tmp<pointField> tcurPoints(new pointField(points0())); tmp<pointField> tcurPoints(new pointField(points0()));
pointField& curPoints = tcurPoints.ref(); pointField& curPoints = tcurPoints.ref();
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const scalar displacement = displacement_->value(t); const scalar displacement = displacement_->value(t);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -107,7 +107,7 @@ void Foam::uniformJumpFvPatchField<Type>::updateCoeffs()
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
this->jump_ = jumpTable_->value(this->db().time().value()); this->jump_ = jumpTable_->value(this->db().time().userTimeValue());
} }
fixedJumpFvPatchField<Type>::updateCoeffs(); fixedJumpFvPatchField<Type>::updateCoeffs();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -104,7 +104,7 @@ void Foam::uniformJumpAMIFvPatchField<Type>::updateCoeffs()
if (this->cyclicAMIPatch().owner()) if (this->cyclicAMIPatch().owner())
{ {
this->jump_ = jumpTable_->value(this->db().time().value()); this->jump_ = jumpTable_->value(this->db().time().userTimeValue());
} }
fixedJumpAMIFvPatchField<Type>::updateCoeffs(); fixedJumpAMIFvPatchField<Type>::updateCoeffs();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -269,7 +269,7 @@ bool Foam::functionObjects::wallHeatFlux::write()
if (Pstream::master()) if (Pstream::master())
{ {
file() file()
<< mesh_.time().value() << mesh_.time().userTimeValue()
<< tab << pp.name() << tab << pp.name()
<< tab << minqp << tab << minqp
<< tab << maxqp << tab << maxqp

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -221,7 +221,7 @@ bool Foam::functionObjects::wallHeatTransferCoeff::write()
if (Pstream::master()) if (Pstream::master())
{ {
file() file()
<< mesh_.time().value() << mesh_.time().userTimeValue()
<< tab << pp.name() << tab << pp.name()
<< tab << minHtcp << tab << minHtcp
<< tab << maxHtcp << tab << maxHtcp

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -243,7 +243,7 @@ bool Foam::functionObjects::wallShearStress::write()
if (Pstream::master()) if (Pstream::master())
{ {
file() << mesh_.time().value() file() << mesh_.time().userTimeValue()
<< tab << pp.name() << tab << pp.name()
<< tab << minSsp << tab << minSsp
<< tab << maxSsp << tab << maxSsp

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ bool Foam::fv::fixedTemperatureConstraint::constrain
{ {
case temperatureMode::uniform: case temperatureMode::uniform:
{ {
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
scalarField Tuni(cells.size(), TValue_->value(t)); scalarField Tuni(cells.size(), TValue_->value(t));
eqn.setValues(cells, thermo.he(Tuni, cells)); eqn.setValues(cells, thermo.he(Tuni, cells));
break; break;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ bool Foam::fv::fixedValueConstraint::constrainType
const word& fieldName const word& fieldName
) const ) const
{ {
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
eqn.setValues eqn.setValues
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,9 @@ void Foam::fv::accelerationSource::add
const scalar t = mesh().time().value(); const scalar t = mesh().time().value();
const scalar dt = mesh().time().deltaTValue(); const scalar dt = mesh().time().deltaTValue();
const vector dU = velocity_->value(t) - velocity_->value(t - dt); const vector dU =
velocity_->value(mesh().time().timeToUserTime(t))
- velocity_->value(mesh().time().timeToUserTime(t - dt));
const vector a = dU/mesh().time().deltaTValue(); const vector a = dU/mesh().time().deltaTValue();
const labelList& cells = set_.cells(); const labelList& cells = set_.cells();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -129,7 +129,7 @@ void Foam::fv::heatSource::addSup
{ {
const labelList& cells = set_.cells(); const labelList& cells = set_.cells();
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const scalar q = q_->value(t); const scalar q = q_->value(t);
forAll(cells, i) forAll(cells, i)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -92,7 +92,7 @@ void Foam::fv::massSource::addGeneralSupType
const word& fieldName const word& fieldName
) const ) const
{ {
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const scalar massFlowRate = massFlowRate_->value(t); const scalar massFlowRate = massFlowRate_->value(t);
const Type value = fieldValues_[fieldName]->value<Type>(t); const Type value = fieldValues_[fieldName]->value<Type>(t);
@ -127,7 +127,7 @@ void Foam::fv::massSource::addSupType
if (fieldName == rhoName_) if (fieldName == rhoName_)
{ {
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const scalar massFlowRate = massFlowRate_->value(t); const scalar massFlowRate = massFlowRate_->value(t);
forAll(cells, i) forAll(cells, i)
@ -146,7 +146,7 @@ void Foam::fv::massSource::addSupType
<< endl; << endl;
} }
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const scalar massFlowRate = massFlowRate_->value(t); const scalar massFlowRate = massFlowRate_->value(t);
const scalar T = fieldValues_[TName_]->value<scalar>(t); const scalar T = fieldValues_[TName_]->value<scalar>(t);
const basicThermo& thermo = const basicThermo& thermo =

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,7 +38,10 @@ void Foam::fv::sixDoFAccelerationSource::addSup
const word& fieldName const word& fieldName
) const ) const
{ {
Vector<vector> accelerations(accelerations_->value(mesh().time().value())); const Vector<vector> accelerations
(
accelerations_->value(mesh().time().userTimeValue())
);
// If gravitational force is present combine with the linear acceleration // If gravitational force is present combine with the linear acceleration
if (mesh().foundObject<uniformDimensionedVectorField>("g")) if (mesh().foundObject<uniformDimensionedVectorField>("g"))

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,7 +96,7 @@ void Foam::fv::semiImplicitSource::addSupType
<< ">::addSup for source " << name() << endl; << ">::addSup for source " << name() << endl;
} }
const scalar t = mesh().time().value(); const scalar t = mesh().time().userTimeValue();
const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi(); const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,7 +102,7 @@ void constantRadiation::correct()
tmp<volScalarField::Internal> constantRadiation::Shs() tmp<volScalarField::Internal> constantRadiation::Shs()
{ {
const scalar time = film().time().value(); const scalar time = film().time().userTimeValue();
if ((time >= timeStart_) && (time <= timeStart_ + duration_)) if ((time >= timeStart_) && (time <= timeStart_ + duration_))
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -105,7 +105,7 @@ Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta
const fvsPatchVectorField& const fvsPatchVectorField&
) const ) const
{ {
scalar t = patch().boundaryMesh().mesh().time().value(); scalar t = patch().boundaryMesh().mesh().time().userTimeValue();
scalar theta0 = thetaT0_; scalar theta0 = thetaT0_;
if (t < t0_) if (t < t0_)