tmp<GeometricField<Type, fvPatchField, volMesh> > steadyStateDdtScheme<Type>::fvcDdt ( const dimensioned<Type>& dt ) { return tmp<GeometricField<Type, fvPatchField, volMesh> > ( new GeometricField<Type, fvPatchField, volMesh> ( IOobject ( "ddt("+dt.name()+')', mesh().time().timeName(), mesh() ), mesh(), dimensioned<Type> ( "0", dt.dimensions()/dimTime, pTraits<Type>::zero ) ) ); }
tmp<DimensionedField<scalar, GeoMesh> > stabilise ( const DimensionedField<scalar, GeoMesh>& dsf, const dimensioned<scalar>& ds ) { tmp<DimensionedField<scalar, GeoMesh> > tRes ( new DimensionedField<scalar, GeoMesh> ( IOobject ( "stabilise(" + dsf.name() + ',' + ds.name() + ')', dsf.instance(), dsf.db() ), dsf.mesh(), dsf.dimensions() + ds.dimensions() ) ); stabilise(tRes().getField(), dsf.getField(), ds.value()); return tRes; }
void DimensionedField<Type, GeoMesh>::operator= ( const dimensioned<Type>& dt ) { dimensions_ = dt.dimensions(); Field<Type>::operator=(dt.value()); }
dimensioned<scalar> mag(const dimensioned<Type>& dt) { return dimensioned<scalar> ( "mag(" + dt.name() + ')', dt.dimensions(), mag(dt.value()) ); }
void dimensioned<Type>::replace ( const direction d, const dimensioned<typename dimensioned<Type>::cmptType>& dc ) { dimensions_ = dc.dimensions(); value_.replace(d, dc.value()); }
dimensioned<typename outerProduct<Type, Type>::type> sqr(const dimensioned<Type>& dt) { return dimensioned<typename outerProduct<Type, Type>::type> ( "sqr(" + dt.name() + ')', sqr(dt.dimensions()), sqr(dt.value()) ); }
dimensioned<typename powProduct<Type, r>::type> pow(const dimensioned<Type>& dt, typename powProduct<Type, r>::type) { return dimensioned<typename powProduct<Type, r>::type> ( "pow(" + dt.name() + ',' + name(r) + ')', pow(dt.dimensions(), r), pow(dt.value(), 2) ); }
DimensionedField<Type, GeoMesh>::DimensionedField ( const IOobject& io, const Mesh& mesh, const dimensioned<Type>& dt, const bool checkIOFlags ) : regIOobject(io), Field<Type>(GeoMesh::size(mesh), dt.value()), mesh_(mesh), dimensions_(dt.dimensions()) { if (checkIOFlags) { readIfPresent(); } }
tmp<DimensionedField<scalar, GeoMesh> > stabilise ( const tmp<DimensionedField<scalar, GeoMesh> >& tdsf, const dimensioned<scalar>& ds ) { const DimensionedField<scalar, GeoMesh>& dsf = tdsf(); tmp<DimensionedField<scalar, GeoMesh> > tRes = reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New ( tdsf, "stabilise(" + dsf.name() + ',' + ds.name() + ')', dsf.dimensions() + ds.dimensions() ); stabilise(tRes().getField(), dsf.getField(), ds.value()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); return tRes; }
tmp<GeometricField<Type, fvPatchField, volMesh> > ddt ( const dimensioned<Type> dt, const fvMesh& mesh ) { return fv::ddtScheme<Type>::New ( mesh, mesh.ddtScheme("ddt(" + dt.name() + ')') )().fvcDdt(dt); }
tmp<fvMatrix<Type> > laplacian ( const dimensioned<GType>& gamma, GeometricField<Type, fvPatchField, volMesh>& vf ) { GeometricField<GType, fvsPatchField, surfaceMesh> Gamma ( IOobject ( gamma.name(), vf.instance(), vf.mesh(), IOobject::NO_READ ), vf.mesh(), gamma ); return fvm::laplacian(Gamma, vf); }
dimensioned<Type> min ( const dimensioned<Type>& dt1, const dimensioned<Type>& dt2 ) { if (dt1.dimensions() != dt2.dimensions()) { FatalErrorIn("min(const dimensioned<Type>&, const dimensioned<Type>&)") << "dimensions of arguments are not equal" << abort(FatalError); } return dimensioned<Type> ( "min(" + dt1.name() + ',' + dt2.name() + ')', dt1.dimensions(), min(dt1.value(), dt2.value()) ); }
tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian ( const dimensioned<GType>& gamma, const GeometricField<Type, fvPatchField, volMesh>& vf, const word& name ) { GeometricField<GType, fvsPatchField, surfaceMesh> Gamma ( IOobject ( gamma.name(), vf.instance(), vf.mesh(), IOobject::NO_READ ), vf.mesh(), gamma ); return fvc::laplacian(Gamma, vf, name); }
tmp<GeometricField<Type, fvPatchField, volMesh> > EulerLocalDdtScheme<Type>::fvcDdt ( const dimensioned<Type>& dt ) { 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_)); IOobject ddtIOobject ( "ddt("+dt.name()+')', mesh().time().timeName(), mesh() ); if (mesh().moving()) { tmp<GeometricField<Type, fvPatchField, volMesh> > tdtdt ( new GeometricField<Type, fvPatchField, volMesh> ( ddtIOobject, mesh(), dimensioned<Type> ( "0", dt.dimensions()/dimTime, pTraits<Type>::zero ) ) ); tdtdt().internalField() = rDeltaT.internalField()*dt.value()*(1.0 - mesh().V0()/mesh().V()); return tdtdt; } else { return tmp<GeometricField<Type, fvPatchField, volMesh> > ( new GeometricField<Type, fvPatchField, volMesh> ( ddtIOobject, mesh(), dimensioned<Type> ( "0", dt.dimensions()/dimTime, pTraits<Type>::zero ), calculatedFvPatchField<Type>::typeName ) ); } }