fvOptions: Added support for transport equations involving d2dt2
Added incompressible solver support to the buoyancyForce fvOption
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,6 +88,15 @@ protected:
|
||||
//- Check that all sources have been applied
|
||||
void checkApplied() const;
|
||||
|
||||
//- Return source for equation with specified name and dimensions
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type>> source
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const word& fieldName,
|
||||
const dimensionSet& ds
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
optionList(const optionList&);
|
||||
|
||||
@ -201,6 +210,21 @@ public:
|
||||
GeometricField<Type, fvPatchField, volMesh>& field
|
||||
);
|
||||
|
||||
//- Return source for equation with second time derivative
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type>> d2dt2
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field
|
||||
);
|
||||
|
||||
//- Return source for equation with second time derivative
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type>> d2dt2
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const word& fieldName
|
||||
);
|
||||
|
||||
|
||||
// Constraints
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,26 +26,15 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field
|
||||
)
|
||||
{
|
||||
return this->operator()(field, field.name());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::source
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const word& fieldName
|
||||
const word& fieldName,
|
||||
const dimensionSet& ds
|
||||
)
|
||||
{
|
||||
checkApplied();
|
||||
|
||||
const dimensionSet ds = field.dimensions()/dimTime*dimVolume;
|
||||
|
||||
tmp<fvMatrix<Type>> tmtx(new fvMatrix<Type>(field, ds));
|
||||
fvMatrix<Type>& mtx = tmtx.ref();
|
||||
|
||||
@ -76,6 +65,27 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field
|
||||
)
|
||||
{
|
||||
return this->operator()(field, field.name());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const word& fieldName
|
||||
)
|
||||
{
|
||||
return source(field, fieldName, field.dimensions()/dimTime*dimVolume);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
(
|
||||
@ -242,6 +252,27 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::d2dt2
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field
|
||||
)
|
||||
{
|
||||
return this->d2dt2(field, field.name());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::d2dt2
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const word& fieldName
|
||||
)
|
||||
{
|
||||
return source(field, fieldName, field.dimensions()/sqr(dimTime)*dimVolume);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::fv::optionList::constrain(fvMatrix<Type>& eqn)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -82,6 +82,16 @@ Foam::fv::buoyancyForce::buoyancyForce
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::fv::buoyancyForce::addSup
|
||||
(
|
||||
fvMatrix<vector>& eqn,
|
||||
const label fieldi
|
||||
)
|
||||
{
|
||||
eqn += g_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::buoyancyForce::addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
|
||||
@ -96,6 +96,13 @@ public:
|
||||
|
||||
// Evaluate
|
||||
|
||||
//- Add explicit contribution to incompressible momentum equation
|
||||
virtual void addSup
|
||||
(
|
||||
fvMatrix<vector>& eqn,
|
||||
const label fieldi
|
||||
);
|
||||
|
||||
//- Add explicit contribution to compressible momentum equation
|
||||
virtual void addSup
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user