CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

volField of bool values (or integers) ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2019, 12:41
Default volField of bool values (or integers) ?
  #1
New Member
 
Danny
Join Date: Jan 2018
Posts: 1
Rep Power: 0
ddreelan7 is on a distinguished road
Hi All,

I am an OpenFOAM novice and am working on a Cellular Automata model for alloy solidification.

When a grain is nucleated at a cell, I want its value (switch i.e. true or false) to change, indicating that it is now solid. As far as I have been able to find out, there is no volField which uses a bool value, or even an integer value i.e. no volSwitchField / volLabelField or equivalent.

I am assigning it a random crystal orientation, which I am recording as a volVectorField, whose 3 components are the 3 Euler angles, so if I could just modify the volVectorField class to also record if the cell is solid or liquid that would be perfect.

When a cell is liquid, it has no orientation angle, so a possible work around would be to set the angles to an invalid value, e.g. greater than 360 degrees, or NaN.

However, as the CA algorithm will be constantly checking the state (solid or liquid) of neighbouring cells, a switch value would be more natural and probably more efficient.

For now I am using a volScalarField and setting its value to 0 or 1, and when checking I am allowing some tolerance.

Any help would be greatly appreciated, as I am very new to this and digging through source code to find answers is difficult at my current level.

Best Regards,
Danny
ddreelan7 is offline   Reply With Quote

Old   April 19, 2019, 04:24
Default
  #2
Member
 
Vu
Join Date: Nov 2016
Posts: 42
Rep Power: 9
DoQuocVu is on a distinguished road
Hi Danny,


Why don't you try using a boolList or PackedBoolList instead?
DoQuocVu is offline   Reply With Quote

Old   September 24, 2020, 05:02
Default Cellular Automata
  #3
Member
 
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10
tom_flint2012 is on a distinguished road
Hi Danny,


How far did you get in implementing the cellular automata method in openfoam?



I am more familiar with phase field methods, but I'm also thinking of implementing CA solidification model in my solver. I have a 'simple' multi-component description of diffusion for liquids, with N phases (n-1)^2 diffusion coefficient matrix.



If you have something working it would be great to see it in action.


All the best,


Tom
tom_flint2012 is offline   Reply With Quote

Old   October 1, 2020, 05:31
Default CA
  #4
Member
 
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10
tom_flint2012 is on a distinguished road
Hi Danny,


Not sure if you're still working on this. Bu I just finished my cellular automata implementation. I used dynamic lists to store al the data for the growing octahedron in each cell. Then when a particular vector of that octahedron entered a new cell I used this point as the new origin for that cells octahedron - copying over the three euler angles to that cell etc. It works very well. I had to use the lists in order to parallelise.


There was some memory distribution fighting to be done but I'm really happy with it. Let me know if you do want a hand with your implementation.


My work is multiphase so I dont think I'll be able to simulate the solute rejection at the growing interface easily. I think I would need a phase field model for the moving boundary concentration condition. I can do it for a binary alloy but struggling with my N-component mixture.


Do you know if anyone has done any work in multicomponent solute partitioning in OpenFOAM?



I think I'll just grow the dendrites by curvature and local undercooling. I'd be interested to hear your thoughts on this.


All the best,


Tom
tom_flint2012 is offline   Reply With Quote

Reply

Tags
bool, cellular, field, solidification, switch

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 06:55
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." lethu OpenFOAM Meshing & Mesh Conversion 1 June 3, 2020 07:49
Reconstruction after parallel run with dynamic mesh refinement sebonator OpenFOAM 9 June 14, 2018 07:38
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 22:38
Velocity values are normal but pressure values are too big rv82 OpenFOAM Running, Solving & CFD 4 April 13, 2015 03:59


All times are GMT -4. The time now is 17:10.