Skip to content
Snippets Groups Projects
Commit 2a8f24e3 authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

BUG: forces: ensure UName entry can be used (fixes #2093)

Previously, for basic incompressible and compressible simulations,
the "force" function object has not been using the user-specified "UName"
for the "devRhoReff" computation (affecting the tangential component),
but using the "U" of the latest available step. In contrast,
the user-specified "pName" has always been being used correctly.

This has been causing issues for users when they wish to use a specific
"UMean" field in various force and forceCoeff function object computations.
parent 61900df3
No related branches found
No related tags found
No related merge requests found
......@@ -350,27 +350,27 @@ Foam::functionObjects::forces::devRhoReff() const
typedef compressible::turbulenceModel cmpTurbModel;
typedef incompressible::turbulenceModel icoTurbModel;
const auto& U = lookupObject<volVectorField>(UName_);
if (foundObject<cmpTurbModel>(cmpTurbModel::propertiesName))
{
const cmpTurbModel& turb =
lookupObject<cmpTurbModel>(cmpTurbModel::propertiesName);
return turb.devRhoReff();
return turb.devRhoReff(U);
}
else if (foundObject<icoTurbModel>(icoTurbModel::propertiesName))
{
const incompressible::turbulenceModel& turb =
lookupObject<icoTurbModel>(icoTurbModel::propertiesName);
return rho()*turb.devReff();
return rho()*turb.devReff(U);
}
else if (foundObject<fluidThermo>(fluidThermo::dictName))
{
const fluidThermo& thermo =
lookupObject<fluidThermo>(fluidThermo::dictName);
const volVectorField& U = lookupObject<volVectorField>(UName_);
return -thermo.mu()*dev(twoSymm(fvc::grad(U)));
}
else if (foundObject<transportModel>("transportProperties"))
......@@ -378,8 +378,6 @@ Foam::functionObjects::forces::devRhoReff() const
const transportModel& laminarT =
lookupObject<transportModel>("transportProperties");
const volVectorField& U = lookupObject<volVectorField>(UName_);
return -rho()*laminarT.nu()*dev(twoSymm(fvc::grad(U)));
}
else if (foundObject<dictionary>("transportProperties"))
......@@ -389,8 +387,6 @@ Foam::functionObjects::forces::devRhoReff() const
dimensionedScalar nu("nu", dimViscosity, transportProperties);
const volVectorField& U = lookupObject<volVectorField>(UName_);
return -rho()*nu*dev(twoSymm(fvc::grad(U)));
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment