|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Andrew Arnold
Join Date: Apr 2024
Posts: 10
Rep Power: 2 ![]() |
Hi everyone-
I'm using OF v2312 buoyantBoussinesqPimpleFoam, and I would like to add a drag term to the momentum equation dependent on velocity with spatially-varying coefficients. I've been successful in implementing a spatially-uniform drag term that depends on velocity through codedSource in fvOptions, and I believe I know how to implement spatial dependence as well. However, I think it would be useful to define constant scalar fields (D1, D2, etc., for the coefficients of the first-degree term in velocity, second-degree, etc.) for the purpose of visualization and data-logging. The idea is to take in Fourier coefficients describing the scalar fields and use them to initialize the coefficient fields. I'm open to the prospect of modifying source code, particularly the createFields.H file, but I would appreciate feedback regarding the best approach here--is this a necessary step? In the future, I'm also interested in adding spatially-varying thermal-diffusivity, as well, so I figure this general approach will be useful for tackling that problem. Thoughts? Thanks. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
|
In similar cases in which the additional field does *not* affect computations and serves visualization purpose *only*, we found it more convenient to seek ways to perform visualisation in Paraview.
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Andrew Arnold
Join Date: Apr 2024
Posts: 10
Rep Power: 2 ![]() |
Hi dlahaye-
Thanks for the advice. The additional field does affect computations by providing a source term to the momentum equation; and later, I hope to extend the spatial-heterogeneity to include material properties, as well, so the field will enter the equations in a more substantive way as a coefficient instead of an additive term. I'm proceeding with modifying the source code following the examples of the OpenFOAM Technology Primer--at any rate, it's helping me learn OpenFOAM on a deeper level. Any further advice will be greatly appreciated, but I might return with more specific questions rather than seeking general guidance. Cheers |
|
![]() |
![]() |
![]() |
Tags |
createfields.h, fvoptions |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 04:49 |
[swak4Foam] swakExpression not writing to log | alexfells | OpenFOAM Community Contributions | 3 | March 16, 2020 18:19 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 18:57 |
problem in defining the field | 13msmemusman | OpenFOAM Programming & Development | 14 | March 18, 2015 12:49 |
Defining pressure field function | aniramzee | STAR-CCM+ | 0 | March 12, 2013 10:41 |