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

How to define setFields to have a triangle fluid domain in 2D case?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By xiaor1
  • 1 Post By alexeym
  • 1 Post By behnazghp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2015, 04:28
Default How to define setFields to have a triangle fluid domain in 2D case?
  #1
New Member
 
Join Date: Feb 2015
Posts: 4
Rep Power: 11
xiaor1 is on a distinguished road
Hi, every one,

I am just new to OpenFoam and now my case is a inclined rectangular tank with a horizontal water surface(water depth is very low) as the initial condition. But when I go through Dambreaking tutorial, I find that I can only define a box-shape fluid domain rather than a triangle one, which doesnot work in this case. Could anyone please tell me that how to define such a fluid domain as in the pic?shallow water in tank.pdf Any information is appreciated. Thanks!
ahparvin likes this.
xiaor1 is offline   Reply With Quote

Old   March 16, 2015, 05:22
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If your mesh is not inclined, you can use rotated box, so the intersection of the mesh and rotated box is triangle (case A on attached image, search the forum for syntax of rotatedBox in setFields), if your mesh is inclined, you can use just box (case B on attached image).
Attached Images
File Type: png box-outside-domain.png (6.8 KB, 174 views)
mcfdma likes this.
alexeym is offline   Reply With Quote

Old   March 16, 2015, 09:27
Default
  #3
New Member
 
Join Date: Feb 2015
Posts: 4
Rep Power: 11
xiaor1 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

If your mesh is not inclined, you can use rotated box, so the intersection of the mesh and rotated box is triangle (case A on attached image, search the forum for syntax of rotatedBox in setFields), if your mesh is inclined, you can use just box (case B on attached image).
Thank you! Alexey Matveichev,

I used the first method u mentioned and it works quite well. Thanks for help!

Best regards
xiaor1 is offline   Reply With Quote

Old   April 13, 2018, 15:10
Default water domain above slopped surface
  #4
New Member
 
Join Date: Apr 2018
Posts: 2
Rep Power: 0
behnazghp is on a distinguished road
Hello
Could someone please help me define a volume of water above a sloped surface? Basically, I need to define a triangular volume of water in setField. Please see the figure attached.

Thanks
Attached Images
File Type: png cross-section6.png (9.6 KB, 91 views)
ahparvin likes this.
behnazghp is offline   Reply With Quote

Old   January 2, 2022, 07:37
Default
  #5
New Member
 
Join Date: Dec 2020
Posts: 9
Rep Power: 5
ahparvin is on a distinguished road
Hello behnazphp

I don't know if after a long time can you reply back to me. but I have a similar issue.
could you finally define directly the initial conditions by rotatedboxToCell in setFieldsDic?

Thanks
ahparvin is offline   Reply With Quote

Old   January 4, 2022, 07:44
Default
  #6
New Member
 
Join Date: Dec 2020
Posts: 9
Rep Power: 5
ahparvin is on a distinguished road
Quote:
Originally Posted by ahparvin View Post
Hello behnazphp

I don't know if after a long time can you reply back to me. but I have a similar issue.
could you finally define directly the initial conditions by rotatedboxToCell in setFieldsDic?

Thanks
Hello;

I have a similar issue. I want to define a trapezoidal shape initial condition for a dam break problem. This shape is formed from overlapping the Mesh and a rotated box with different alpha values.
I tried to do that by defining a rotatedboxTocell in the setFields dictionary.
However there is no error in running setField but after that in initial conditions, I can not see any sign of water alpha = 1.

Any of you can help me with that?


autodraw 1_4_2022.jpg


Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
);

regions
(
    rotatedBoxToCell
    {
        name    rotatedBox1;
        type    cellSet;
        action  new;
        source  rotatedBoxToCell;
        origin  (0.3 0.2 10);
        i       (-0.1 -0.1 0);
        j       (0.1 -0.1 0);
        k       (0 0 -20);
        
            fieldValues
        (
            volScalarFieldValue alpha.water 1
        );         
    }  
       
);
ahparvin is offline   Reply With Quote

Reply

Tags
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
Floating point exception: Zero divide liladhar CFX 11 December 16, 2013 04:07
injection problem Mark New FLUENT 0 August 4, 2013 01:30
[ICEM] How to define the name of the fluid domain ztdep ANSYS Meshing & Geometry 5 December 20, 2012 09:13
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 10:19


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