Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion ( const dictionary& dict, const dictionary& stateDict ) : motionState_(stateDict), motionState0_(), restraints_(), constraints_(), tConstraints_(tensor::I), rConstraints_(tensor::I), initialCentreOfMass_ ( dict.lookupOrDefault ( "initialCentreOfMass", vector(dict.lookup("centreOfMass")) ) ), initialCentreOfRotation_(initialCentreOfMass_), initialQ_ ( dict.lookupOrDefault ( "initialOrientation", dict.lookupOrDefault("orientation", tensor::I) ) ), mass_(readScalar(dict.lookup("mass"))), momentOfInertia_(dict.lookup("momentOfInertia")), aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)), aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)), report_(dict.lookupOrDefault<Switch>("report", false)), solver_(sixDoFSolver::New(dict.subDict("solver"), *this)) { addRestraints(dict); // Set constraints and initial centre of rotation // if different to the centre of mass addConstraints(dict); // If the centres of mass and rotation are different ... vector R(initialCentreOfMass_ - initialCentreOfRotation_); if (magSqr(R) > VSMALL) { // ... correct the moment of inertia tensor using parallel axes theorem momentOfInertia_ += mass_*diag(I*magSqr(R) - sqr(R)); // ... and if the centre of rotation is not specified for motion state // update it if (!stateDict.found("centreOfRotation")) { motionState_.centreOfRotation() = initialCentreOfRotation_; } } // Save the old-time motion state motionState0_ = motionState_; }
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(const dictionary& dict) : motionState_(dict), restraints_(), restraintNames_(), constraints_(), constraintNames_(), maxConstraintIterations_(0), initialCentreOfMass_ ( dict.lookupOrDefault("initialCentreOfMass", centreOfMass()) ), initialQ_ ( dict.lookupOrDefault("initialOrientation", Q()) ), momentOfInertia_(dict.lookup("momentOfInertia")), mass_(readScalar(dict.lookup("mass"))), cDamp_(dict.lookupOrDefault<scalar>("accelerationDampingCoeff", 0.0)), aLim_(dict.lookupOrDefault<scalar>("accelerationLimit", VGREAT)), report_(dict.lookupOrDefault<Switch>("report", false)) { addRestraints(dict); addConstraints(dict); }
Foam::swirlFlowRateInletVelocityFvPatchVectorField:: swirlFlowRateInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<vector>(p, iF, dict), phiName_(dict.lookupOrDefault<word>("phi", "phi")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")), origin_ ( dict.lookupOrDefault ( "origin", returnReduce(patch().size(), maxOp<label>()) ? gSum(patch().Cf()*patch().magSf())/gSum(patch().magSf()) : Zero ) ), axis_ ( dict.lookupOrDefault ( "axis", returnReduce(patch().size(), maxOp<label>()) ? -gSum(patch().Sf())/gSum(patch().magSf()) : Zero ) ), flowRate_(Function1<scalar>::New("flowRate", dict)), rpm_(Function1<scalar>::New("rpm", dict)) {}
Foam::sampledIsoSurface::sampledIsoSurface ( const word& name, const polyMesh& mesh, const dictionary& dict ) : sampledSurface(name, mesh, dict), isoField_(dict.lookup("isoField")), isoVal_(readScalar(dict.lookup("isoValue"))), mergeTol_(dict.lookupOrDefault("mergeTol", 1e-6)), regularise_(dict.lookupOrDefault("regularise", true)), average_(dict.lookupOrDefault("average", false)), zoneID_(dict.lookupOrDefault("zone", word::null), mesh.cellZones()), exposedPatchName_(word::null), surfPtr_(NULL), facesPtr_(NULL), prevTimeIndex_(-1), storedVolFieldPtr_(NULL), volFieldPtr_(NULL), storedPointFieldPtr_(NULL), pointFieldPtr_(NULL) { if (!sampledSurface::interpolate()) { FatalIOErrorIn ( "sampledIsoSurface::sampledIsoSurface" "(const word&, const polyMesh&, const dictionary&)", dict ) << "Non-interpolated iso surface not supported since triangles" << " span across cells." << exit(FatalIOError); } if (zoneID_.index() != -1) { dict.lookup("exposedPatchName") >> exposedPatchName_; if (mesh.boundaryMesh().findPatchID(exposedPatchName_) == -1) { FatalIOErrorIn ( "sampledIsoSurface::sampledIsoSurface" "(const word&, const polyMesh&, const dictionary&)", dict ) << "Cannot find patch " << exposedPatchName_ << " in which to put exposed faces." << endl << "Valid patches are " << mesh.boundaryMesh().names() << exit(FatalIOError); } if (debug && zoneID_.index() != -1) { Info<< "Restricting to cellZone " << zoneID_.name() << " with exposed internal faces into patch " << exposedPatchName_ << endl; } }
Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : mixedFixedValueSlipFvPatchVectorField(p, iF), TName_(dict.lookupOrDefault<word>("T", "T")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")), psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")), muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")), tauMCName_(dict.lookupOrDefault<word>("tauMC", "tauMC")), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), Uwall_("Uwall", dict, p.size()), thermalCreep_(dict.lookupOrDefault("thermalCreep", true)), curvature_(dict.lookupOrDefault("curvature", true)) { if ( mag(accommodationCoeff_) < SMALL || mag(accommodationCoeff_) > 2.0 ) { FatalIOErrorIn ( "maxwellSlipUFvPatchScalarField::maxwellSlipUFvPatchScalarField" "(" "const fvPatch&, " "const DimensionedField<vector, volMesh>&, " "const dictionary&" ")", dict ) << "unphysical accommodationCoeff_ specified" << "(0 < accommodationCoeff_ <= 1)" << endl << exit(FatalIOError); } if (dict.found("value")) { fvPatchField<vector>::operator= ( vectorgpuField("value", dict, p.size()) ); if (dict.found("refValue") && dict.found("valueFraction")) { this->refValue() = vectorgpuField("refValue", dict, p.size()); this->valueFraction() = scalargpuField("valueFraction", dict, p.size()); } else { this->refValue() = *this; this->valueFraction() = scalar(1.0); } } }
Foam::populationBalanceSubModels::growthModels::constantGrowth ::constantGrowth ( const dictionary& dict, const fvMesh& mesh ) : growthModel(dict, mesh), minAbscissa_(dict.lookupOrDefault("minAbscissa", 1e-10)), maxAbscissa_(dict.lookupOrDefault("maxAbscissa", 1e10)) {}
Foam::highestMomentReconstruction::highestMomentReconstruction ( const dictionary& dict, const label nMoments, const label nSecondaryNodes ) : extendedMomentInversion(dict, nMoments, nSecondaryNodes), momentsTol_(dict.lookupOrDefault("momentsTol", 1.0e-12)), sigmaTol_(dict.lookupOrDefault("sigmaTol", 1.0e-12)), targetFunctionTol_(dict.lookupOrDefault("targetFunctionTol", 1.0e-12)) {}
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState ( const dictionary& dict ) : centreOfMass_(dict.lookup("centreOfMass")), Q_(dict.lookupOrDefault("orientation", tensor::I)), v_(dict.lookupOrDefault("velocity", vector::zero)), a_(dict.lookupOrDefault("acceleration", vector::zero)), pi_(dict.lookupOrDefault("angularMomentum", vector::zero)), tau_(dict.lookupOrDefault("torque", vector::zero)) {}
Foam::scalar Foam::layerAdditionRemoval::readOldThickness ( const dictionary& dict ) { return dict.lookupOrDefault("oldLayerThickness", -1.0); }
Foam::functionObjects::mag::mag ( const word& name, const Time& runTime, const dictionary& dict ) : functionObject(name), obr_ ( runTime.lookupObject<objectRegistry> ( dict.lookupOrDefault("region", polyMesh::defaultRegion) ) ), fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { if (!isA<fvMesh>(obr_)) { FatalErrorInFunction << "objectRegistry is not an fvMesh" << exit(FatalError); } read(dict); }
Foam:: timeVaryingMappedFixedValuePointPatchField<Type>:: timeVaryingMappedFixedValuePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, const dictionary& dict ) : fixedValuePointPatchField<Type>(p, iF), fieldTableName_(iF.name()), setAverage_(readBool(dict.lookup("setAverage"))), perturb_(dict.lookupOrDefault("perturb", 1E-5)), mapperPtr_(NULL), sampleTimes_(0), startSampleTime_(-1), startSampledValues_(0), startAverage_(pTraits<Type>::zero), endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits<Type>::zero) { dict.readIfPresent("fieldTableName", fieldTableName_); updateCoeffs(); }
timeVaryingMappedFixedValueFvPatchField<Type>:: timeVaryingMappedFixedValueFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<Type>(p, iF), fieldTableName_(iF.name()), setAverage_(readBool(dict.lookup("setAverage"))), perturb_(dict.lookupOrDefault("perturb", 1E-5)), referenceCS_(NULL), nearestVertex_(0), nearestVertexWeight_(0), sampleTimes_(0), startSampleTime_(-1), startSampledValues_(0), startAverage_(pTraits<Type>::zero), endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits<Type>::zero) { dict.readIfPresent("fieldTableName", fieldTableName_); if (dict.found("value")) { fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size())); } else { updateCoeffs(); } }
Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject ( const word& name, const Time& t, const dictionary& dict ) : functionObject(name), time_(t), // dict_(dict), regionName_(polyMesh::defaultRegion), dictName_(), enabled_(true), storeFilter_(true), timeStart_(-VGREAT), timeEnd_(VGREAT), nStepsToStartTimeChange_ ( dict.lookupOrDefault("nStepsToStartTimeChange", 3) ), outputControl_(t, dict, "output"), evaluateControl_(t, dict, "evaluate") #ifdef FOAM_FUNCTIONOBJECT_HAS_SEPARATE_WRITE_METHOD_AND_NO_START ,lastTimeStepExecute_(-1) #endif { Dbug << this->name() << " OutputFilterFunctionObject::Constructor" << endl; read(dict); readDict(); }
Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject ( const word& name, const Time& t, const dictionary& dict ) : functionObject(name), time_(t), dict_(dict), regionName_(polyMesh::defaultRegion), dictName_(), enabled_(true), storeFilter_(true), timeStart_(-VGREAT), timeEnd_(VGREAT), nStepsToStartTimeChange_ ( dict.lookupOrDefault("nStepsToStartTimeChange", 3) ), outputControl_(t, dict, "output"), evaluateControl_(t, dict, "evaluate") { readDict(); }
Foam::sampledPlane::sampledPlane ( const word& name, const polyMesh& mesh, const dictionary& dict ) : sampledSurface(name, mesh, dict), cuttingPlane(plane(dict)), zoneKey_(keyType::null), triangulate_(dict.lookupOrDefault("triangulate", true)), needsUpdate_(true) { // Make plane relative to the coordinateSystem (Cartesian) // allow lookup from global coordinate systems if (dict.found("coordinateSystem")) { coordinateSystem cs(mesh, dict.subDict("coordinateSystem")); point base = cs.globalPosition(planeDesc().refPoint()); vector norm = cs.globalVector(planeDesc().normal()); // Assign the plane description static_cast<plane&>(*this) = plane(base, norm); } dict.readIfPresent("zone", zoneKey_); if (debug && zoneKey_.size() && mesh.cellZones().findIndex(zoneKey_) < 0) { Info<< "cellZone " << zoneKey_ << " not found - using entire mesh" << endl; } }
Foam::timeVaryingMappedFixedValueFvPatchField<Type>:: timeVaryingMappedFixedValueFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<Type>(p, iF), fieldTableName_(iF.name()), setAverage_(readBool(dict.lookup("setAverage"))), perturb_(dict.lookupOrDefault("perturb", 1e-5)), mapMethod_ ( dict.lookupOrDefault<word> ( "mapMethod", "planarInterpolation" ) ), mapperPtr_(NULL), sampleTimes_(0), startSampleTime_(-1), startSampledValues_(0), startAverage_(Zero), endSampleTime_(-1), endSampledValues_(0), endAverage_(Zero), offset_(Function1<Type>::New("offset", dict)) { if ( mapMethod_ != "planarInterpolation" && mapMethod_ != "nearest" ) { FatalIOErrorInFunction ( dict ) << "mapMethod should be one of 'planarInterpolation'" << ", 'nearest'" << exit(FatalIOError); } dict.readIfPresent("fieldTableName", fieldTableName_); if (dict.found("value")) { fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size())); } else { // Note: we use evaluate() here to trigger updateCoeffs followed // by re-setting of fvatchfield::updated_ flag. This is // so if first use is in the next time step it retriggers // a new update. this->evaluate(Pstream::blocking); } }
Foam::populationBalanceSubModels::breakupKernels::exponentialBreakup ::exponentialBreakup ( const dictionary& dict ) : breakupKernel(dict), minAbscissa_(dict.lookupOrDefault("minAbscissa", 1.0)), expCoeff_ ( dict.lookupOrDefault ( "expCoeff", dimensionedScalar("expC", inv(pow3(dimLength)), 0.1) ) ) {}
Foam::cylindricalCS::cylindricalCS ( const word& name, const dictionary& dict ) : coordinateSystem(name, dict), inDegrees_(dict.lookupOrDefault("degrees", true)) {}
Foam::cylindricalCS::cylindricalCS ( const objectRegistry& obr, const dictionary& dict ) : coordinateSystem(obr, dict), inDegrees_(dict.lookupOrDefault("degrees", true)) {}
Foam:: timeVaryingMappedFixedValuePointPatchField<Type>:: timeVaryingMappedFixedValuePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, const dictionary& dict ) : fixedValuePointPatchField<Type>(p, iF), fieldTableName_(iF.name()), setAverage_(readBool(dict.lookup("setAverage"))), perturb_(dict.lookupOrDefault("perturb", 1e-5)), mapMethod_ ( dict.lookupOrDefault<word> ( "mapMethod", "planarInterpolation" ) ), mapperPtr_(NULL), sampleTimes_(0), startSampleTime_(-1), startSampledValues_(0), startAverage_(pTraits<Type>::zero), endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits<Type>::zero), offset_() { if (dict.found("offset")) { offset_ = DataEntry<Type>::New("offset", dict); } dict.readIfPresent("fieldTableName", fieldTableName_); if (dict.found("value")) { fixedValuePointPatchField<Type>::operator== ( Field<Type>("value", dict, p.size()) ); } else { // Note: use evaluate to do updateCoeffs followed by a reset // of the pointPatchField::updated_ flag. This is // so if first use is in the next time step it retriggers // a new update. pointPatchField<Type>::evaluate(Pstream::blocking); } }
Foam::sampledPatch::sampledPatch ( const word& name, const polyMesh& mesh, const dictionary& dict ) : sampledSurface(name, mesh, dict), patchNames_(dict.lookup("patches")), triangulate_(dict.lookupOrDefault("triangulate", false)), needsUpdate_(true) {}
Foam:: waveAbsorptionVelocity2DFvPatchVectorField:: waveAbsorptionVelocity2DFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<vector>(p, iF, dict), nPaddles_(dict.lookupOrDefault<label>("nPaddles", 1)), initialWaterDepths_( dict.lookupOrDefault("initialWaterDepths", List<scalar> (1, -1.0)) ), absorptionDir_(dict.lookupOrDefault<scalar>("absorptionDir", 400.0)), uCurrent_(dict.lookupOrDefault("uCurrent", vector(0., 0., 0.))), meanAngles_( dict.lookupOrDefault("meanAngles", List<scalar> (1, -1.0)) ), zSpanL_( dict.lookupOrDefault("zSpanL", List<scalar> (1, -1.0)) ), nEdgeMin_(dict.lookupOrDefault<label>("nEdgeMin", 0)), nEdgeMax_(dict.lookupOrDefault<label>("nEdgeMax", 0)), allCheck_(dict.lookupOrDefault<bool>("allCheck", false )) {}
Foam::extendedMomentInversion::extendedMomentInversion ( const dictionary& dict, const label nMoments, const label nSecondaryNodes ) : nMoments_(nMoments), nPrimaryNodes_((nMoments_ - 1)/2), nSecondaryNodes_(nSecondaryNodes), primaryWeights_(nPrimaryNodes_, 0.0), primaryAbscissae_(nPrimaryNodes_, 0.0), sigma_(0.0), secondaryWeights_(nPrimaryNodes_, nSecondaryNodes_), secondaryAbscissae_(nPrimaryNodes_, nSecondaryNodes_), minMean_(dict.lookupOrDefault("minMean_", 1.0e-8)), minVariance_(dict.lookupOrDefault("minVariance_", 1.0e-8)), maxSigmaIter_(dict.lookupOrDefault<label>("maxSigmaIter", 1000)), momentsTol_(dict.lookupOrDefault("momentsTol", 1.0e-12)), sigmaMin_(dict.lookupOrDefault("sigmaMin", 1.0e-6)), sigmaTol_(dict.lookupOrDefault("sigmaTol", 1.0e-12)), targetFunctionTol_(dict.lookupOrDefault("targetFunctionTol", 1.0e-12)), foundUnrealizableSigma_(false), nullSigma_(false) {}
Foam::binaryTree<CompType, ThermoType>::binaryTree ( TDACChemistryModel<CompType, ThermoType>& chemistry, dictionary coeffsDict ) : chemistry_(chemistry), root_(nullptr), maxNLeafs_(readLabel(coeffsDict.lookup("maxNLeafs"))), size_(0), n2ndSearch_(0), max2ndSearch_(coeffsDict.lookupOrDefault("max2ndSearch",0)), coeffsDict_(coeffsDict) {}
Foam::functionObjects::CourantNo::CourantNo ( const word& name, const Time& runTime, const dictionary& dict ) : functionObject(name), obr_ ( runTime.lookupObject<objectRegistry> ( dict.lookupOrDefault("region", polyMesh::defaultRegion) ) ), phiName_("phi"), rhoName_("rho") { if (!isA<fvMesh>(obr_)) { FatalErrorInFunction << "objectRegistry is not an fvMesh" << exit(FatalError); } read(dict); const fvMesh& mesh = refCast<const fvMesh>(obr_); volScalarField* CourantNoPtr ( new volScalarField ( IOobject ( type(), mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("0", dimless, 0.0), zeroGradientFvPatchScalarField::typeName ) ); mesh.objectRegistry::store(CourantNoPtr); }
Foam::SRFFreestreamVelocityFvPatchVectorField:: SRFFreestreamVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : inletOutletFvPatchVectorField(p, iF), relative_(dict.lookupOrDefault("relative", false)), UInf_(dict.lookup("UInf")) { this->phiName_ = dict.lookupOrDefault<word>("phi","phi"); fvPatchVectorField::operator=(vectorField("value", dict, p.size())); }
Foam::functionObjects::regionFunctionObject::regionFunctionObject ( const word& name, const Time& runTime, const dictionary& dict ) : functionObject(name), time_(runTime), obr_ ( runTime.lookupObject<objectRegistry> ( dict.lookupOrDefault("region", polyMesh::defaultRegion) ) ) {}
Foam::functionObjects::processorField::processorField ( const word& name, const Time& runTime, const dictionary& dict ) : functionObject(name), obr_ ( runTime.lookupObject<objectRegistry> ( dict.lookupOrDefault("region", polyMesh::defaultRegion) ) ) { if (!isA<fvMesh>(obr_)) { FatalErrorInFunction << "objectRegistry is not an fvMesh" << exit(FatalError); } read(dict); const fvMesh& mesh = refCast<const fvMesh>(obr_); volScalarField* procFieldPtr ( new volScalarField ( IOobject ( "processorID", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("0", dimless, 0.0) ) ); mesh.objectRegistry::store(procFieldPtr); }
Foam::functionObjects::removeRegisteredObject::removeRegisteredObject ( const word& name, const Time& runTime, const dictionary& dict ) : functionObject(name), obr_ ( runTime.lookupObject<objectRegistry> ( dict.lookupOrDefault("region", polyMesh::defaultRegion) ) ), objectNames_() { read(dict); }
groovyBCCommon<Type>::groovyBCCommon ( const dictionary& dict, bool hasGradient, bool isPoint, string fractionExpression ) : evaluateDuringConstruction_( dict.lookupOrDefault<bool>("evaluateDuringConstruction",false) ), debug_(dict.lookupOrDefault<bool>("debug",false)), hasGradient_(hasGradient), fractionExpression_(dict.lookupOrDefault( "fractionExpression", isPoint ? string("toPoint("+fractionExpression+")") : string(fractionExpression)) ) { if (dict.found("valueExpression")) { dict.lookup("valueExpression") >> valueExpression_; } else {