| 610 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 611 | |
| 612 | bool 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 | { |
no test coverage detected