ENH: moved sources to eqn rhs

This commit is contained in:
andy
2011-11-03 17:19:13 +00:00
parent 4b527e3e27
commit e0b35ae32e
26 changed files with 41 additions and 60 deletions

View File

@ -55,7 +55,7 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
}
forAll(cells, i)
{
Usource[cells[i]] += ((Vcells[cells[i]]/V())*T[i]*E) & U[cells[i]];
Usource[cells[i]] -= ((Vcells[cells[i]]/V())*T[i]*E) & U[cells[i]];
}
}

View File

@ -33,6 +33,8 @@ Description
duration 1000.0; // duration
selectionMode cellSet; // cellSet // points //cellZone
On evaluation, source expects to be added to the rhs of the equation
SourceFiles
basicSource.C

View File

@ -81,32 +81,9 @@ void Foam::ExplicitSetValue<Type>::setValue
<< ">::setValue for source " << name_ << endl;
}
DimensionedField<Type, volMesh> rhs
(
IOobject
(
name_ + fieldNames_[fieldI] + "rhs",
eqn.psi().mesh().time().timeName(),
eqn.psi().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
eqn.psi().mesh(),
dimensioned<Type>
(
"zero",
dimless,
pTraits<Type>::zero
)
);
List<Type> values(cells_.size());
forAll(values, i)
{
values[i] = injectionRate_[fieldI];
}
UIndirectList<Type>(values, cells_) = injectionRate_[fieldI];
eqn.setValues(cells_, values);
}

View File

@ -137,7 +137,7 @@ void Foam::ExplicitSource<Type>::addSup
const label fieldI
)
{
// if (debug)
if (debug)
{
Info<< "ExplicitSource<"<< pTraits<Type>::typeName
<< ">::addSup for source " << name_ << endl;
@ -163,12 +163,9 @@ void Foam::ExplicitSource<Type>::addSup
false
);
forAll(cells_, i)
{
Su[cells_[i]] = injectionRate_[fieldI]/VDash_;
}
UIndirectList<Type>(Su, cells_) = injectionRate_[fieldI]/VDash_;
eqn -= Su;
eqn += Su;
}

View File

@ -79,7 +79,7 @@ addRadialActuationDiskAxialInertialResistance
forAll(cells, i)
{
Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & U[cells[i]];
Usource[cells[i]] -= ((Vcells[cells[i]]/V_)*Tr[i]*E) & U[cells[i]];
}
if (debug)

View File

@ -399,7 +399,7 @@ Foam::rotorDiskSource::~rotorDiskSource()
void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
{
// add source to lhs of eqn
// add source to rhs of eqn
const volVectorField& U = eqn.psi();
@ -410,7 +410,7 @@ void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
eqn += calculateForces
eqn -= calculateForces
(
rho.internalField(),
inflowVelocity(U),
@ -419,7 +419,7 @@ void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
}
else
{
eqn += calculateForces
eqn -= calculateForces
(
oneField(),
inflowVelocity(U),