Comments (8)
Thinking about the inclusion of the information on boundary conditions inside the CellVariable
object, I realized that it may be an idea to have the boundary conditions fully handled by the CellVariable
object: creation of BoundaryConditions
object stored inside the CellVariable
structure, definition of the a
, b
, c
etc., pre-calculation/updating of the BoundaryConditionsTerm
matrix + RHS etc. etc.
This would lead to a more logical workflow, where first the cell variable is created, followed by definition of the boundary conditions if required (only solution variables need boundary conditions).
I think that such a solution may even be implemented without breaking the existing infrastructure.
from pyfvtool.
Concerning CellVariable.bc_to_ghost()
and CellVariable.BC2GhostCells()
(cell.py
), these have perhaps been superseded by cellValuesWithBoundaries
(boundary.py
)? It seems to serve a similar function, and does indeed take into account the defined boundary conditions when assigning values to the ghost cells.
from pyfvtool.
Concerning
CellVariable.bc_to_ghost()
andCellVariable.BC2GhostCells()
(cell.py
), these have perhaps been superseded bycellValuesWithBoundaries
(boundary.py
)? It seems to serve a similar function, and does indeed take into account the defined boundary conditions when assigning values to the ghost cells.
Indeed, it is the case. In the development sprint, I replaced some of the old functions with more +at least in my head+ logical ones. This is one of those cases.
This would lead to a more logical workflow, where first the cell variable is created, followed by definition of the boundary conditions if required (only solution variables need boundary conditions).
I totally agree. I cannot remember any use cases that a boundary exist without a CellVariable
(well, for steady-state problems we have the BC
before having the CellVariable
but later the solution will be a cell variable).
from pyfvtool.
[2] Should we use consistent naming: use either the term 'boundary cells', or the term 'ghost cells' exclusively? Perhaps I am missing a subtlety here? Boundary cell is perhaps ambiguous: it may refer to the ghost cell or to the outermost inner cell?
I am in favor of ghost cells.
from pyfvtool.
[2] Should we use consistent naming: use either the term 'boundary cells', or the term 'ghost cells' exclusively? Perhaps I am missing a subtlety here? Boundary cell is perhaps ambiguous: it may refer to the ghost cell or to the outermost inner cell?
I am in favor of ghost cells.
So am I.
from pyfvtool.
The CellVariable.init() code requires some further cleaning up I think
What I prefer to do is to initialize the CellVariable
with a boundary condition (Neumann) and later adjust the values of the -infamous- a, b, c
. It is the workflow that we have more or less in all examples. We can at some point write some utility functions to do the adjustment in more pythonic ways, e.g. by accepting dictionaries; for example:
BC = {
"left": {"type": "Dirichlet", "value": 0.0},
"right": {"type": "Neumann", "value": 0.0},
}
from pyfvtool.
I agree.
I have a relatively simple plan for embedding the boundary condition structure in the CellVariable
, creating it if it is not supplied externally. It will be initialized with default "no flux" (Neumann) values. Then, it can be fine-tuned via the usual left right etc.
a, b, c
mechanism. Finally, we call a method which we may name apply_BCs
that re-calculates the ghost cell values (via cellValuesWithBoundaries
) and even pre-calculates the BoundaryConditionsTerms
M and RHS.
This could later be embellished in more pythonic ways, as you suggest.
from pyfvtool.
I agree.
I have a relatively simple plan for embedding the boundary condition structure in the
CellVariable
, creating it if it is not supplied externally. It will be initialized with default "no flux" (Neumann) values. Then, it can be fine-tuned via the usualleft right etc.
a, b, c
mechanism. Finally, we call a method which we may nameapply_BCs
that re-calculates the ghost cell values (viacellValuesWithBoundaries
) and even pre-calculates theBoundaryConditionsTerms
M and RHS.This could later be embellished in more pythonic ways, as you suggest.
Love the idea! Simple and elegant.
from pyfvtool.
Related Issues (14)
- Terms for SphericalGrid1D not implemented
- Moving PyFVTool to an organization HOT 10
- Testing HOT 5
- Minimal version number for scipy HOT 3
- Labeling of coordinates in cylindrical (and spherical) meshes HOT 9
- 'test_benchmark_1d.py' fails HOT 2
- more logical name for InternalCells() method HOT 1
- Calling external sparse direct solvers HOT 5
- Deprecation warnings from numpy 1.26.2 HOT 5
- Standardize pyfvtool imports on the user side HOT 2
- Installation error due to the existence of both setup.py and pyproject.toml HOT 4
- `CellVariable.BC2GhostCells()` and `CellVariable.bc_to_ghost()`
- How to implement the TVD scheme correctly? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfvtool.