MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / read

Function read

src/functionObjects/forces/forces/forces.C:612–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
611
612bool Foam::functionObjects::forces::read(const dictionary& dict)
613{
614 fvMeshFunctionObject::read(dict);
615
616 initialised_ = false;
617
618 Log << type() << " " << name() << ":" << nl;
619
620 directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
621
622 const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
623
624 patchSet_ = pbm.patchSet(wordReList(dict.lookup("patches")));
625
626 if (directForceDensity_)
627 {
628 // Optional entry for fDName
629 fDName_ = dict.lookupOrDefault<word>("fD", "fD");
630 }
631 else
632 {
633 // Optional entries U and p
634 pName_ = dict.lookupOrDefault<word>("p", "p");
635 UName_ = dict.lookupOrDefault<word>("U", "U");
636 rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
637
638 // Reference density needed for incompressible calculations
639 if (rhoName_ == "rhoInf")
640 {
641 dict.lookup("rhoInf") >> rhoRef_;
642 }
643
644 // Reference pressure, 0 by default
645 pRef_ = dict.lookupOrDefault<scalar>("pRef", 0.0);
646 }
647
648 coordSys_.clear();
649
650 // Centre of rotation for moment calculations
651 // specified directly, from coordinate system, or implicitly (0 0 0)
652 if (!dict.readIfPresent<point>("CofR", coordSys_.origin()))
653 {
654 coordSys_ = coordinateSystem(obr_, dict);
655 localSystem_ = true;
656 }
657
658 dict.readIfPresent("porosity", porosity_);
659 if (porosity_)
660 {
661 Log << " Including porosity effects" << endl;
662 }
663 else
664 {
665 Log << " Not including porosity effects" << endl;
666 }
667
668 if (dict.found("binData"))
669 {

Callers 1

forces.CFile · 0.70

Calls 15

coordinateSystemClass · 0.85
minFunction · 0.85
maxFunction · 0.85
scalarFunction · 0.85
lookupMethod · 0.80
readIfPresentMethod · 0.80
forAllFunction · 0.70
typeEnum · 0.50
nameFunction · 0.50
exitFunction · 0.50
magClass · 0.50
forAllConstIterFunction · 0.50

Tested by

no test coverage detected