tmp<typename EulerLocalDdtScheme<Type>::fluxFieldType> EulerLocalDdtScheme<Type>::fvcDdtPhiCorr ( const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { IOobject ddtIOobject ( "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); if (mesh().moving()) { return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, mesh(), dimensioned<typename flux<Type>::type> ( "0", rA.dimensions()*phi.dimensions()/dimTime, pTraits<typename flux<Type>::type>::zero ) ) ); } else { const objectRegistry& registry = this->mesh(); // get access to the scalar beta[i] const scalarField& beta = registry.lookupObject<scalarField>(deltaTName_); volScalarField rDeltaT = 1.0/(beta[0]*registry.lookupObject<volScalarField>(deltaTauName_)); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) ) ) ); } }
tmp<typename EulerLocalDdtScheme<Type>::fluxFieldType> EulerLocalDdtScheme<Type>::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { IOobject ddtIOobject ( "ddtPhiCorr(" + rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); if (mesh().moving()) { return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, mesh(), dimensioned<typename flux<Type>::type> ( "0", rA.dimensions()*phi.dimensions()/dimTime, pTraits<typename flux<Type>::type>::zero ) ) ); } else { const objectRegistry& registry = this->mesh(); // get access to the scalar beta[i] const scalarField& beta = registry.lookupObject<scalarField>(deltaTName_); volScalarField rDeltaT = 1.0/(beta[0]*registry.lookupObject<volScalarField>(deltaTauName_)); if ( U.dimensions() == dimVelocity && phi.dimensions() == dimVelocity*dimArea ) { return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *( fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) & mesh().Sf()) ) ) ); } else if ( U.dimensions() == dimVelocity && phi.dimensions() == dimDensity*dimVelocity*dimArea ) { return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, fvcDdtPhiCoeff ( U.oldTime(), phi.oldTime()/fvc::interpolate(rho.oldTime()) ) *( fvc::interpolate(rDeltaT*rA*rho.oldTime()) *phi.oldTime()/fvc::interpolate(rho.oldTime()) - ( fvc::interpolate ( rDeltaT*rA*rho.oldTime()*U.oldTime() ) & mesh().Sf() ) ) ) ); } else if ( U.dimensions() == dimDensity*dimVelocity && phi.dimensions() == dimDensity*dimVelocity*dimArea ) { return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phi.oldTime()) *( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - ( fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() ) ) ) ); } else { FatalErrorIn ( "EulerLocalDdtScheme<Type>::fvcDdtPhiCorr" ) << "dimensions of phi are not correct" << abort(FatalError); return fluxFieldType::null(); } } }