CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

SetFieldsDict file problem with 3D multiphase flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2013, 11:20
Cool SetFieldsDict file problem with 3D multiphase flow
  #1
New Member
 
Gianfranco Vitucci
Join Date: Apr 2013
Posts: 5
Rep Power: 13
jeff_87 is on a distinguished road
Hello,

I have the following problem using interFoam for a multiphase problem:

I want to simulate a 3D water droplet impact on a thin water layer.
The domain is a parallelepiped.
The thin layer has not a definite form (so I can't use for example BoxToCell to set the layer data on the domain), but I have all the data of alpha1 in the entire domain calculated in a previous simulation.

Alpha1 has all the values between 0 and 1.

My question is:

is there a way to write the data of alpha1 in the setFieldDict file?

Thanks
jeff_87 is offline   Reply With Quote

Old   April 22, 2013, 15:18
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jeff_87 View Post
Hello,

I have the following problem using interFoam for a multiphase problem:

I want to simulate a 3D water droplet impact on a thin water layer.
The domain is a parallelepiped.
The thin layer has not a definite form (so I can't use for example BoxToCell to set the layer data on the domain), but I have all the data of alpha1 in the entire domain calculated in a previous simulation.

Alpha1 has all the values between 0 and 1.

My question is:

is there a way to write the data of alpha1 in the setFieldDict file?
If I understand you correctly: No. But there are two ways to get the solution from one case into another:
- if both simulations use the same mesh then you only need to copy over the alpha1-file into the 0-directory of the new case and you're done
- if they have different meshes you can use the mapFields-utility to map the old solution onto the new grid.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 29, 2013, 06:30
Default
  #3
New Member
 
Gianfranco Vitucci
Join Date: Apr 2013
Posts: 5
Rep Power: 13
jeff_87 is on a distinguished road
Thank you so much for the reply Mr. Gschaider

The mesh-grid is the same for both the simulations.

I had just done the step you suggested to do ("if both simulations use the same mesh then you only need to copy over the alpha1-file into the 0-directory of the new case and you're done"), but unfortunately in this case I want to add water droplets to the domain composed by the only liquid thin layer. To add the droplets I have to give the command setFields that reads the setFieldsDict-file in which I created the droplets and in such file I can't write the alpha1 water layer existing domain because it has not a definite form.

So the only way to write exactly this file is to modify the existing alpha1-file but I think it is impossible.

Thank you so much for your reply
jeff_87 is offline   Reply With Quote

Old   April 29, 2013, 07:45
Default
  #4
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 13
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by jeff_87 View Post
Thank you so much for the reply Mr. Gschaider

The mesh-grid is the same for both the simulations.

I had just done the step you suggested to do ("if both simulations use the same mesh then you only need to copy over the alpha1-file into the 0-directory of the new case and you're done"), but unfortunately in this case I want to add water droplets to the domain composed by the only liquid thin layer. To add the droplets I have to give the command setFields that reads the setFieldsDict-file in which I created the droplets and in such file I can't write the alpha1 water layer existing domain because it has not a definite form.

So the only way to write exactly this file is to modify the existing alpha1-file but I think it is impossible.

Thank you so much for your reply
I am not sure if I really understand what you mean. I think you are looking for a command to help you define the location of alpha=1 elements inside the alpha=0 domain, without using BoxToCell. am I right?
Mahdi2010 is offline   Reply With Quote

Old   April 29, 2013, 08:35
Default
  #5
New Member
 
Gianfranco Vitucci
Join Date: Apr 2013
Posts: 5
Rep Power: 13
jeff_87 is on a distinguished road
Exactly.

My initial domain is a cubic biphase domain in which there are only air (alpha=0), a water layer (alpha=1) and the interface between air and water (0<alpha<1).

This domain is the ending domain of a previous simulation.
At the starting of the previous simulation the water layer was exactly a box, so I used BoxToCell.
Now, at the end of the previous simulation the water layer is similar to but not exactly a box and so I can't use BoxToCell.

Moreover, In this condition I have to add one droplet with the command SphereToCell, but it is not a problem.
jeff_87 is offline   Reply With Quote

Old   April 29, 2013, 08:57
Default
  #6
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 13
Mahdi2010 is on a distinguished road
I have more or less the same problem, what if we use "zoneToCell"?
I mean what would happen if we define the non-cubic area as a region in the blockmeshDict
and in the setFielddict use zoneToCell to mention this area?
Mahdi2010 is offline   Reply With Quote

Old   April 29, 2013, 11:22
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jeff_87 View Post
Thank you so much for the reply Mr. Gschaider

The mesh-grid is the same for both the simulations.

I had just done the step you suggested to do ("if both simulations use the same mesh then you only need to copy over the alpha1-file into the 0-directory of the new case and you're done"), but unfortunately in this case I want to add water droplets to the domain composed by the only liquid thin layer. To add the droplets I have to give the command setFields that reads the setFieldsDict-file in which I created the droplets and in such file I can't write the alpha1 water layer existing domain because it has not a definite form.

So the only way to write exactly this file is to modify the existing alpha1-file but I think it is impossible.

Thank you so much for your reply
Don't know if I missunderstand you, but why not copy over and then ADD the droplet/sphere with setFields. If setFields can't do that then I'd suggest funkySetFields. That CAN do that
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 29, 2013, 12:42
Default
  #8
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
I just read through this thread quick, but I think one thing that hasn't been mentioned is that, I think you would have to make sure you remove the entry:
Code:
defaultFieldValues
(
    volScalarFieldValue alpha1 0
);
So that you don't remove the results from the previous model run. I haven't done this but it would seem to be the case.
mgdenno is offline   Reply With Quote

Old   April 30, 2013, 04:40
Default
  #9
New Member
 
Gianfranco Vitucci
Join Date: Apr 2013
Posts: 5
Rep Power: 13
jeff_87 is on a distinguished road
@ gschaider:

I tried to do this, but when I add the droplet with setFields, it deletes the existing alpha1 field and sets just the droplet.

@ mgdenno:

Yes, in fact I tried to delete defaultFieldValues in the setFieldsDict-file but it gives me an error when I use setFields.
I think there should be a voice, something like MappedFieldValues or something similar with which I can give the existing alpha1 field in the setFieldsDict-file and then, in the same file, I can add the droplet with SphereToCell, but unfortunately I can't find this term.
jeff_87 is offline   Reply With Quote

Old   April 30, 2013, 06:21
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jeff_87 View Post
@ gschaider:

I tried to do this, but when I add the droplet with setFields, it deletes the existing alpha1 field and sets just the droplet.

@ mgdenno:

Yes, in fact I tried to delete defaultFieldValues in the setFieldsDict-file but it gives me an error when I use setFields.
I think there should be a voice, something like MappedFieldValues or something similar with which I can give the existing alpha1 field in the setFieldsDict-file and then, in the same file, I can add the droplet with SphereToCell, but unfortunately I can't find this term.
I'm rather inflexible and add the droplet with
Code:
funkySetFields -time 0 -field alpha1 -keepPatches -condition "mag(pos()-vector(0,0,1))<0.1" -expression "1"
to an existing alpha1-file (that'd be a droplet with radius 0.1 and center (0,0,1) ). But I acknowledge that just because it is easier for me it is not necessarily so for everyone (especially as every machine I touch gets soiled with swak4Foam anyway)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 30, 2013, 20:39
Default
  #11
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
For completeness, commenting out just what is inside the brackets:
Code:
defaultFieldValues
(
    //volScalarFieldValue alpha1 0
);
seems to do what you were looking for.

The attached picture is running setFields on the damBreak case after 0.5 seconds.
Attached Images
File Type: jpg alpha1_Reset.jpg (17.2 KB, 44 views)
mgdenno is offline   Reply With Quote

Old   May 3, 2013, 06:20
Default
  #12
New Member
 
Gianfranco Vitucci
Join Date: Apr 2013
Posts: 5
Rep Power: 13
jeff_87 is on a distinguished road
@ mgdenno

YES!!!! That's the solution!!! So easy!!!

Thank you so much!!

@ gshaider

Thank you very much for the precious advices.
funkySetFields is a good way to solve these kind of problems but I never used it. Now is the time to learn this function.

Thank you
jeff_87 is offline   Reply With Quote

Reply

Tags
interfoam, multiphase, setfieldsdict


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
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 09:50
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 04:26
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


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