Quote:
Best, |
Ok .... Thanks
|
Quote:
Let's assume you have N phases. You will have to define: - N momentum equations (N velocity fields and N fvVectorMatrices) - N*(N-1)/2 interaction fields (meaning relative velocities, drag coefficients, ...) - N-1 phase fraction equations (assuming one fraction is computed as alpha_0 = 1-sum(alpha_i), i != 0. You will need N phase fraction fields for this. - 1 pressure equation based on the mixture As you can easily imagine, if N is arbitrary, coding this can be messy, if not done with proper care. You can collect your phase fields and equations (also objects if you want) for each property in a PtrList (http://foam.sourceforge.net/doc/Doxy..._1PtrList.html). I will give you an example for the relative velocity fields: First define: Code:
const nUr = N*(N-1)/2; Code:
PtrList<volScalarField> Ur(nUr); Code:
forAll (Ur, urI) Code:
Ur[i]() The same operation can be done with equations: Code:
PtrList<fvVectorMatrix> UEqn(N); Code:
solve (UEqn[uEqnI]() == ...); Of course you can create a ptrList of the phaseModel object, and further simplify your work. If you decide to do this, I would suggest to incorporate alpha in the phaseModel, since it is currently not there, or you have an inconsistent syntax that becomes annoying with many phases. Last hint: since you are beginning with OpenFOAM from what I read, proceed step by step, and ask questions (poking me by email is allowed too, I do not bite :D, and I usually answer if I can). Best, |
thats clean .... i was about to write python programs to output the necessary files .... In that way , I can take the user input and just write out the files . However the approach requires the compilation of the source code evrytime you specify different number of components ....
|
No :)
You simply have to read the number of phases from a dictionary (label nPhases, being it integer), before allocating the PtrList objects ;-) Something similar is done in OF for the species in reacting solvers, and in multiphaseInterFoam, but in this last solver the implementation of what they called mixture class abuses a bit of C++ functionality, making the code quite unreadable (never a good idea!). Best, |
All times are GMT -4. The time now is 13:27. |