CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   How to define setFields to have a triangle fluid domain in 2D case? (https://www.cfd-online.com/Forums/openfoam-pre-processing/150117-how-define-setfields-have-triangle-fluid-domain-2d-case.html)

xiaor1 March 16, 2015 04:28

How to define setFields to have a triangle fluid domain in 2D case?
 
1 Attachment(s)
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?Attachment 37844 Any information is appreciated. Thanks!

alexeym March 16, 2015 05:22

1 Attachment(s)
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).

xiaor1 March 16, 2015 09:27

Quote:

Originally Posted by alexeym (Post 536455)
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

behnazghp April 13, 2018 15:10

water domain above slopped surface
 
1 Attachment(s)
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

ahparvin January 2, 2022 07:37

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 January 4, 2022 07:44

1 Attachment(s)
Quote:

Originally Posted by ahparvin (Post 819453)
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?


Attachment 87808


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
        );       
    } 
     
);


mohammedtareq April 22, 2024 03:38

hi xiaor1
can u please explain how u get the triangle box for water area i try use Rotatedbox utility but can not define the i , j ,k vectors


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