Commit c487fe2f authored by Henry Weller's avatar Henry Weller Committed by Andrew Heather
Browse files

ENH: fvOptions: Added support for transport equations involving d2dt2

Added incompressible solver support to the buoyancyForce fvOption
parent 66b3934a
......@@ -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 | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -28,26 +28,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();
......@@ -80,6 +69,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()
(
......@@ -250,6 +260,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,
......
......@@ -99,6 +99,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
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment