# EulerD2dt2Scheme

 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 8, 2017, 14:14 EulerD2dt2Scheme #1 New Member   Lucas Ribeiro Join Date: Aug 2016 Posts: 23 Rep Power: 8 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 tmp > EulerD2dt2Scheme::fvmD2dt2 ( const dimensionedScalar& rho, GeometricField& vf ) { tmp > tfvm ( new fvMatrix ( vf, rho.dimensions()*vf.dimensions()*dimVol /dimTime/dimTime ) ); fvMatrix& 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; }``` Thank you