Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2024-03-26 12:27:31 +00:00
4 changed files with 16 additions and 11 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,10 +58,11 @@ void Foam::fvTotalSource::addSource(fvMatrix<scalar>& eqn) const
eqn.dimensions() = S.dimensions();
// Apply the source
scalarField& eqnSource = eqn.source();
forAll(cells, i)
{
const scalar f = mesh().V()[cells[i]]/V;
eqn.source()[cells[i]] -= f*S.value();
eqnSource[cells[i]] -= f*S.value();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,11 +60,13 @@ void Foam::fvTotalSource::addSupType
);
// Apply the source
Field<Type>& eqnSource = eqn.source();
scalarField& eqnDiag = eqn.diag();
forAll(cells, i)
{
const scalar f = mesh().V()[cells[i]]/V;
eqn.source()[cells[i]] -= f*S.value()*sourceCoeff[i];
eqn.diag()[cells[i]] += f*S.value()*internalCoeff[i];
eqnSource[cells[i]] -= f*S.value()*sourceCoeff[i];
eqnDiag[cells[i]] += f*S.value()*internalCoeff[i];
}
}
else
@ -76,10 +78,11 @@ void Foam::fvTotalSource::addSupType
);
// Apply the source
Field<Type>& eqnSource = eqn.source();
forAll(cells, i)
{
const scalar f = mesh().V()[cells[i]]/V;
eqn.source()[cells[i]] -= f*S.value()*value[i];
eqnSource[cells[i]] -= f*S.value()*value[i];
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,10 +77,10 @@ void Foam::fv::acceleration::add
const labelUList cells = set_.cells();
vectorField& eqnSource = eqn.source();
forAll(cells, i)
{
const label celli = cells[i];
eqn.source()[celli] -= V[celli]*alphaRho[celli]*a;
eqnSource[cells[i]] -= V[cells[i]]*alphaRho[cells[i]]*a;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,9 +132,10 @@ void Foam::fv::heatSource::addSup
const scalar t = mesh().time().userTimeValue();
const scalar q = q_->value(t);
scalarField& eqnSource = eqn.source();
forAll(cells, i)
{
eqn.source()[cells[i]] -= mesh().V()[cells[i]]*q;
eqnSource[cells[i]] -= mesh().V()[cells[i]]*q;
}
}