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

setFieldsDict - Ellipse

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2023, 13:29
Question setFieldsDict - Ellipse
  #1
New Member
 
Alp
Join Date: May 2023
Posts: 1
Rep Power: 0
alpie77 is on a distinguished road
Hello everyone,
I am working on an Openfoam assignment at my university. For this assignment, I need to use setFieldsDict and define an ellipsoid volume or region ( It is 3D) and set different values for inside and outside of the ellipsoid region. But I could not find any documentation on defining an ellipsoid region in setFields.

I could manage to do it with funkySetFields which is below.
In this funkysetfields an ellipsoid is defined and inside the ellipsoid thermal diffusivity for sand is valid, outside of this ellipsoid diffusivity of aluminum is valid.

Code:
FoamFile
{
    version         2.0;
    format          ascii;

    root            "";
    case            "defective cooler";
    instance        "system";
    local           "";

    class           dictionary;
    object          funkySetFieldsDict;
}

expressions
(
	aAluminum
	{
		field a;
		expression	"8.418e-5"; 
		condition "sqr((pos().x-0.003))/(sqr(0.015))+sqr((pos().y-0.0045))/(sqr(0.0007))+sqr((pos().z-0.003))/(sqr(0.001))>1"; 
// This equation describes the inside or outside of an ellipsoid.
    }

	aSand
	{
		field a;
		expression	"1-12e-6"; 
		condition	"sqr((pos().x-0.003))/(sqr(0.015))+sqr((pos().y-0.0045))/(sqr(0.0007))+sqr((pos().z-0.003))/(sqr(0.001))<1"; 
		
	}
);

Question :
I need to do the same thing with OpenFOAM V10, setFieldsDict.
How can I do the same thing, in setFieldsDict?

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

defaultFieldValues
(
    volScalarFieldValue a 8.418e-5
);

regions
(
    

    // Setting values inside a sphere
    sphereToCell
    {
        centre  (0.015 0.0045 0.003); 
        radius  (0.003 0.007 0.001); // I tried to give 3 radiui assuming in 3D, but this did not work of course :)//
        fieldValues
        (
                volScalarFieldValue a 1.12e-6
        );
    }

    
);


// ************************************************************************* //
Thanks for your help and effort.
alpie77 is offline   Reply With Quote

Old   June 9, 2023, 01:01
Default
  #2
New Member
 
Join Date: Jun 2023
Posts: 1
Rep Power: 0
Binsuna is on a distinguished road
Did you have the answer for this issue?
__________________

Last edited by Binsuna; June 11, 2023 at 10:34.
Binsuna is offline   Reply With Quote

Reply

Tags
ellipse, 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
[blockMesh] problem with the ellipse curvededge alvin11 OpenFOAM Meshing & Mesh Conversion 6 December 9, 2024 08:27
sintax rules to compile setFieldsDict leske OpenFOAM Pre-Processing 2 January 21, 2016 16:58
[Other] Meshing an ellipse Sujatha OpenFOAM Meshing & Mesh Conversion 10 January 31, 2014 20:58
2D rotating ellipse (domain interface??) Kambusha CFX 38 May 19, 2012 08:10
[GAMBIT] 2D ellipse in rectangular domain rieuk ANSYS Meshing & Geometry 8 October 7, 2010 09:52


All times are GMT -4. The time now is 13:59.