Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diffusive Mixing (1D <--> CFD) #50

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

MariaEmmerich
Copy link
Collaborator

This PR updates

The connection of the CFD Module and 1D diffusive mixing, concentrations are passed as concentration fields to the CFD Module and concentration fields are translated as linear segments as input for the 1D diffusive mixing.

PR Checklist

  • Did you include comments/documentation?
  • Did you include and pass unit tests?

@MariaEmmerich MariaEmmerich linked an issue Sep 6, 2024 that may be closed by this pull request
@MariaEmmerich MariaEmmerich added feature New feature or request OpenLB Issue related to OpenLB package labels Sep 6, 2024
@MariaEmmerich
Copy link
Collaborator Author

@micheltakken I have added the connection between the abstract diffusive mixing to and from the CFD Modules.
This includes:

  • the translation of the concentration definition as a function across the width into the lattice of the cfd module using piecewise linear interpolation
  • the translation of the output of the lattice into a complex inout for the calculation of the diffusion in the channel by defining the concentration values at the lattice points as linear segments that are interconnected.

For both cases we adhere to the law of mass conservation.

The connection "on the CFD side" is still missing.
I already created a function to pass the concentration values to and from the simulator, but could you please have a look at the functions I defined to make sure they connnect to the logic in the cfd module.
Additionally, atm I am defining the lattice resolution in the MixingModels.hh rather than passing it from the simulator.

Once we have included the missing parts we can start to test.

// auto& section = outflowDistributions.at(channel->getId()).front(); // there is only one channel connected to a node at a CFD hybrid node connection
// // std::vector<T> inflowSectionIntoCfd = section.concentrationField;
// }
int resolutionIntoCfd = 20; // TODO this should be a parameter
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the lattice resolution is hard coded rather than passed from the simulator.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resolution values are stored in olbContinuous.h or essContinuous.h and can technically be obtained from a cfdSimulator with cfdSimulator->getResolution(). This is not yet implemented. I will take care of this.

TODO

Copy link
Collaborator Author

@MariaEmmerich MariaEmmerich Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the getResolution(nodeId) function and a TODO in the olbMixing.hh

Copy link
Member

@micheltakken micheltakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the comments for the resuested changes
They are mainly concerning residual(?) or missing comments in the code.

Apart from that it looks good, and good first iteration using GitHub :)

src/simulation/MixingModels.h Outdated Show resolved Hide resolved
src/simulation/MixingModels.h Outdated Show resolved Hide resolved
src/simulation/MixingModels.h Outdated Show resolved Hide resolved
src/simulation/MixingModels.h Outdated Show resolved Hide resolved
src/simulation/MixingModels.h Show resolved Hide resolved
src/simulation/MixingModels.hh Outdated Show resolved Hide resolved
src/simulation/MixingModels.hh Outdated Show resolved Hide resolved
src/simulation/simulators/cfdSimulator.h Outdated Show resolved Hide resolved
src/simulation/simulators/olbMixing.hh Show resolved Hide resolved
src/simulation/simulators/olbMixing.hh Show resolved Hide resolved
This only works if the resolution, i.e., the number of lattice points at the node, does not change during the simulation (at different timesteps)
Copy link
Member

@micheltakken micheltakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO @ self
Define the coupling of Abstract and CFD from the CFD part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request OpenLB Issue related to OpenLB package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardcoded value
2 participants