|
[Sponsors] |
December 8, 2017, 14:14 |
EulerD2dt2Scheme
|
#1 |
New Member
Lucas Ribeiro
Join Date: Aug 2016
Posts: 23
Rep Power: 10 |
Hello folks,
Does anyone know how to derive the formulas implemented for the EulerD2dt2Scheme::fvmD2dt2? Specially for the first one, applied when the mesh is moving. Any reference? Code:
template<class Type> tmp<fvMatrix<Type> > EulerD2dt2Scheme<Type>::fvmD2dt2 ( const dimensionedScalar& rho, GeometricField<Type, fvPatchField, volMesh>& vf ) { tmp<fvMatrix<Type> > tfvm ( new fvMatrix<Type> ( vf, rho.dimensions()*vf.dimensions()*dimVol /dimTime/dimTime ) ); fvMatrix<Type>& fvm = tfvm(); scalar deltaT = mesh().time().deltaT().value(); scalar deltaT0 = mesh().time().deltaT0().value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); scalar rDeltaT2 = 4.0/sqr(deltaT + deltaT0); if (mesh().moving()) { scalar halfRdeltaT2 = 0.5*rDeltaT2; scalarField VV0 = mesh().V() + mesh().V0(); scalarField V0V00 = mesh().V0() + mesh().V00(); fvm.diag() = rho.value()*(coefft*halfRdeltaT2)*VV0; fvm.source() = halfRdeltaT2*rho.value()* ( (coefft*VV0 + coefft00*V0V00) *vf.oldTime().internalField() - (coefft00*V0V00)*vf.oldTime().oldTime().internalField() ); } else { fvm.diag() = (coefft*rDeltaT2)*mesh().V()*rho.value(); fvm.source() = rDeltaT2*mesh().V()*rho.value()* ( (coefft + coefft00)*vf.oldTime().internalField() - coefft00*vf.oldTime().oldTime().internalField() ); } return tfvm; } |
|
Tags |
euler, foam-extend-3.2, fvmd2dt2 |
|
|