codedMixed boundary condition for switching between no-slip and slip
Hello,
I would like to create a mixed boundary condition where based, on a switch, I change the boundary from no-slip to slip. Let's assume that after 1s of simulation the walls go from no slip to slip. For the time being I have: Code:
myPatch However, I am quite new at this and would appreciate the help. |
Hi, I have a few suggetsions for you, hoping to be of help:
1) I would put the for loop inside the if clause, since this way you have one evaluation of the if and one loop, otherwise you are evaluation the if clause multiple times, with lower performance; 2) From what I understand, the initial setup is not representing a no slip, since the fraction is 0 (you are starting with a zeroGradient basically, the flow can penetrate the wall!). You should start with a Dirichlet imposing zero velocity: Code:
type codedMixed; 3) About your question, there are several ways you can follow to implement a slip condition, which is the equation you would like to use? 4) I don't know if you care, but you can express the switch threshold in the properties dict in the constant folder, this is an example where i get a variable called q from a dict called physicalProperties (which is defined in the solver, you could have transportProperties or something like that): Code:
const dictionary& physicalProperties = db().lookupObject<IOdictionary>("physicalProperties"); |
I forgot to mention the silly solution:
you can put no slip and solve till 1s, then change in the 1 folder the bc to slip and start again the simulation from 1. This could avoid the use of a codedBC. :D |
Quote:
Thanks for the reply! But the purpose if to actually use the mixedCoded boundary. Regarding the slip boundary. I would expect it to be the same as implemented in OF where the basicSymmetryFvPatchField is called. However, I do not know how to input this into the codedMixed :( |
I took a look to the code of the Bc you mention, the interesting part would be this
Code:
tmp<vectorField> nHat = this->patch().nf(); I guess imposing a symmetry you would need to put the orthogonal component of the velocity to zero; I don't think this would be a completely correct way, but you can try it to test the codedBC, waiting for someone else to explain the right interpretation of the BC. At the end of the day it would be an approximation similar to no slip -> v=0, so you're basically imposing the no-penetrating condition rather than the whole symmetry. If you decide to try this, the BC would be something like: Code:
I hope it helps. |
All times are GMT -4. The time now is 11:41. |