solver modules: Moved constructing the face velocity/momentum into preSolve()
The velocity boundary conditions are corrected before the construction of the face velocity or momentum but for multi-region cases with interacting velocity boundary conditions this is only possible after all the region solver modules have been constructed so it is better to delay the optional construction of the face velocity/momentum until preSolve().
This commit is contained in:
@ -146,27 +146,6 @@ Foam::solvers::VoFSolver::VoFSolver
|
||||
{
|
||||
mesh.schemes().setFluxRequired(p_rgh.name());
|
||||
|
||||
if (mesh.dynamic() || MRF.size())
|
||||
{
|
||||
Info<< "Constructing face momentum Uf" << endl;
|
||||
|
||||
// Ensure the U BCs are up-to-date before constructing Uf
|
||||
U_.correctBoundaryConditions();
|
||||
|
||||
Uf = new surfaceVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Uf",
|
||||
runTime.name(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::interpolate(U_)
|
||||
);
|
||||
}
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
Info<< "Using LTS" << endl;
|
||||
@ -221,6 +200,27 @@ void Foam::solvers::VoFSolver::preSolve()
|
||||
// Read the controls
|
||||
readControls();
|
||||
|
||||
if ((mesh.dynamic() || MRF.size()) && !Uf.valid())
|
||||
{
|
||||
Info<< "Constructing face momentum Uf" << endl;
|
||||
|
||||
// Ensure the U BCs are up-to-date before constructing Uf
|
||||
U_.correctBoundaryConditions();
|
||||
|
||||
Uf = new surfaceVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Uf",
|
||||
runTime.name(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::interpolate(U_)
|
||||
);
|
||||
}
|
||||
|
||||
if (transient())
|
||||
{
|
||||
correctCoNum();
|
||||
|
||||
Reference in New Issue
Block a user