|
[Sponsors] |
February 14, 2022, 10:05 |
Access BC variable from another file
|
#1 |
Member
UOCFD
Join Date: Oct 2020
Posts: 40
Rep Power: 6 |
Hey foamers,
I am developing a customized code for lagrangian particles patchInteraction model. I want to include a variable read from the activePressureForceBaffleVelocity BC, which is called openFraction_. How can I call it from localInteraction.C?? Since now I have tried with: U.mesh.boundary()[patchi].openFraction_(); U.patch().boundaryMesh()[patchi].openFraction_(); without success. Any solution to his would be appreciated |
|
February 14, 2022, 10:31 |
|
#2 |
Senior Member
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9 |
I don't know the proper way to do that, but can you access it like other dicts are called? something like
this->coeffDict().getOrDefault("openFraction", 0.001) then you change the underlined text to your 0/U.patchName file? |
|
February 15, 2022, 04:29 |
|
#3 |
Member
UOCFD
Join Date: Oct 2020
Posts: 40
Rep Power: 6 |
I think that is the way to read variables from the own model file, but not from other locations like a BC...
|
|
March 7, 2022, 11:02 |
|
#4 |
Member
UOCFD
Join Date: Oct 2020
Posts: 40
Rep Power: 6 |
By doing U.boundaryField()[patchID]:
Code:
type activePressureForceBaffleVelocity; cyclicPatch baffleCyclic_half0; orientation 1; openingTime 0.005; maxOpenFractionDelta 0.1; openFraction 0; minThresholdValue -3.78e+06; forceBased 0; value uniform (0 0 0); Code:
void Foam::activePressureForceBaffleVelocityFvPatchVectorField:: write(Ostream& os) const { fvPatchVectorField::write(os); writeEntry(os, "cyclicPatch", cyclicPatchName_); ... |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 | towanda | OpenFOAM Community Contributions | 6 | September 5, 2015 22:03 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |