Options for setFields
Hi all,
I need to define a setFieldsDict for a non-box region. I am aware of swak4Foam and funkySetFields. However, I do not need all that sophistications. Is it possible to define parts (blocks) of the mesh for a zoneToCell instead of a boxToCell (just like the definition of porous media)? If yes, how can I do it? I need some descriptions .... like how to define the zones? (e.g. How to name the zone files?) How to add the zones in the setFieldsDict? Best regards, Hisham |
Quote:
But suite yourself Quote:
Bernhard |
Hi Bernhard,
Thanks a lot for your response. You are great ... so as swak4Foam .. :) It is just that I needed to do that thing quickly with the bread knife ... I will use funkySetFields after all but I did not invest enough time in learning it until now and the task seemed easy enough for setFields ... But I guess it is a good chance to start learning it. Thanks a lot for your great contributions! I will try your idea (it seems like the way to go with OF) Best regards, Hisham |
setFields zoneToCell (applications of setFields to mesh blocks)
I got it. I post here for future readers.
1. In the blockMeshDict, define the cellZone names for required blocks: e.g. (from the damBreak example) blocks ( hex (0 1 5 4 12 13 17 16) cellZoneName (23 8 1) simpleGrading (1 1 1) hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1) hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1) hex (5 6 10 9 17 18 22 21) cellZoneName (4 42 1) simpleGrading (1 1 1) hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1) ); 2. In the setFieldsDict, defaultFieldValues ( volScalarFieldValue alpha1 0 ); regions ( zoneToCell { name "cellZoneName"; fieldValues ( volScalarFieldValue alpha1 1 ); } ); |
running the damBreak tutorial after using makeAxialMesh utility
Hello Hisham and Bernhard,
I am working on a modified damBreak case (http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/HassanHemida/Hassan_Hemida_VOF.pdf) to study the free surface tracking. I wanted to make the case axisymmetric; so I modified the mesh using blockMeshDict and then used setFields to assign alpha1 values. I then used the makeAxialMesh utility, followed by collapseEdges, to make the case axisymmetric. I also added the new patches to p_rgh, U, alpha1 files. Then I run decomposePar. However, at this point, I get an error saying that "keyword frontAndBack_pos is not defined in 0/alpha1::boundary" (which makes sense because after I use setFields, the contents of alpha1 file change to numbers 1 or 0 ) Please let me know if you have any ideas to solve this problem. Thanks and regards. Pallav |
Hi Pallav,
It would be a good idea to compress your case into a single file and attach it to your post. A full copy paste of your error message (use the quote tags from the toolbar) also makes things easier. By doing that it is easier for others to give ideas on what may be wrong! Also, starting a new post would be a good idea, in case there is no post that is not about the same problem (e.g. the same error message). Back to your problem: Does it run without decomposePar? Best regards, Hisham |
I imagine you need to run the setFields after you change the mesh.... not before.
|
Quote:
|
Quote:
|
SetFields
Dear friends
For the HeatTransfer->buoyantBoussinsqSimpleFoam->HotRoom problem: I wrote 1. In the blockMeshDict: blocks ( hex (0 1 2 3 4 5 6 7) cellZoneName (20 20 20) simpleGrading (1 1 1) ); 2. In the setFieldsDict, defaultFieldValues ( volScalarFieldValue alphat 0 ); regions ( zoneToCell { name "cellZoneName"; fieldValues ( volScalarFieldValue alphat 1 ); } But its not working, could you help me? |
Hi Goutam
It is easier to help if you post the error message generated by OF. In the case you outlined, it is easier to assign a uniform internal field value for alphat in its file in the 0 directory (for the whole domain is a single zone) I have introduced the editions you wrote and it worked fine. It is highly probable that you need to copy the T.org file to a T file in the 0 directory: Code:
:~/openfoam210/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0$ cp T.org T Hisham |
Dear Hisham,
Thanks for your reply. I have copied T.org to T before I run the problem. I did this. When I run setFields, I got the following massage: FOAM Warning: From function zoneToFace:: combine (topoSet&, const bool) in file sets/faceSources/zoneToFace/zoneToFace.C at line 86. Cannot find any faceZone named cellZoneName Valid names are 0 ( ) Setting patchField values of volScalarField alphat End What I will do, can you please help me? I am trying to solve this for the last 7 days. Can I send you my files? I set the model for laminar instead of turbulent and I did the changes that required. Only, setFields option are not working when I use cellZoneName. |
From the error message, it seems that the problem lies in the zoneToFace assignment in the setFieldsDict.
Please zip the case up in one file and attach it to a reply! or maybe paste the setFieldsDict file in your reply Hisham |
Hot Room laminar case
1 Attachment(s)
Dear Hisham
Please see the attached zip file. Thanks Goutam |
I'm not sure what you want to do exactly. But the error is generated because you provide a zoneToCell data to a zoneToFace keyword. So you either have to change the line number 25 of the setFieldsDict to "zoneToCell" instead of "zoneToFace" or else provide valid data to the zoneToFace function
|
Quote:
Firstly, I want to use bouyant force for the laminar case for 3D geometry. I found that this is the nearest solver to do this. Before, I used icoFoam solver for p, U and T, but for buoyant force, its not working. When I consider a pipe flow problem, then the setFields command is not working. I did meshing in Fluent and I use fluentMeshToFoam file.msh command. After that I checked the meshing by checkMesh command. its fine. Regards Goutam |
The error messages from OF are very helpful ... just read them carefully to figure out your next step
Good luck with your work :) |
Quote:
Thanks for your kind help. |
Options for setFields
I like the "zoneToCell" option, better than the "boxToCell" one. Can we use the "zoneToCell" option for the wedge cells in an axisymmetric case?
|
setFields for multiple components of a phase
Hello everyone,
I am using reactingTwoPhaseEulerFoam for two multicomponent phases analysis. I want to use interfaceCompositionPhaseChangePhaseSystem utility in OpenFOAM to take care of one of the components of a phase. My geometry is a cylindrical vessel. I want to set the volume fraction in such a way that the bottom 45% part of the vessel contains 60% volume fraction of component A of phase 1 and 1% volume fraction of component B of phase 1 and the rest 39% in the bottom 45% fill volume of the vessel is all phase 2. The upper 55% is 100% phase 2. What I was thinking is define the entire internal field with for the entire volume of the cylinder with 60% component A of phase 1, 1% of component B of phase 1 and 39% of phase 2. Then I am trying to use setFieldsDict for the above 55% volume to be 100% phase 2 so that it deletes the above mentioned combination for the above 55% of the vessel and replaces it entirely with phase 2. But this doesn't work! Can anyone please help me with this? Thanks Viraj |
All times are GMT -4. The time now is 00:40. |