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

funkySetFields setup

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By joshmccraney

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2020, 12:46
Default funkySetFields setup
  #1
Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 51
Rep Power: 3
joshmccraney is on a distinguished road
Hi FOAMers!

I'm think I've successfully installed swak4foam for OF6. However, it's not clear to me how to initialize pressure, velocity, and the phase. Does anyone have a tutorial?

I've been reading here but I am a little confused exactly how to format things. Is there an extra file I need to put in a dictionary, or do I modify current dictionaries?

If anyone has a simple case file for running a test case that serves as a good template, I'd really appreciate it.
joshmccraney is offline   Reply With Quote

Old   February 5, 2020, 19:16
Default
  #2
Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 51
Rep Power: 3
joshmccraney is on a distinguished road
A senior member of this community was nice enough to help me out (not sure if I should list names?). At any rate, for clarity, this is how you run funkySetFields:

1) in the "system" directory, copy the setFieldsDict as a funkySetFieldsDict via
>> cp setFieldsDict funkySetFieldsDict

2) delete all lines of funkySetFieldsDict and replace with what you want, for example:

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

expressions
(
initFieldAlpha//JMC: INITIALIZE DATA (SIMILAR TO defaultFieldValues)
{
field alpha.water;
expression "0";
keepPatches true;
}

initFieldU//JMC: INITIALIZE DATA (SIMILAR TO defaultFieldValues)
{
field U;
expression "vector(0.0,0.0,0.0)";
keepPatches true;
}

pressureAir//JMC: INITIALIZE DATA (SIMILAR TO defaultFieldValues)
{
field p_rgh;
expression "0";
keepPatches true;
}

floatingCircle
{
field alpha.water;
expression "1";
condition "sqrt(pow((pos().x-0.14),2)+pow((pos().y-0.2),2))<0.05";
keepPatches true;
}

pressureCircle
{
field p_rgh;
expression "100.0*pos().y";
condition "sqrt(pow((pos().x-0.14),2)+pow((pos().y-0.2),2))<0.05";
keepPatches true;
}

risingCircle
{
field U;
expression "vector(0.0,1.5,0.0)";
condition "sqrt(pow((pos().x-0.14),2)+pow((pos().y-0.2),2))<0.05";
keepPatches true;
}
);

// ************************************************** *********************** //

3) now go into the case file, and as usual run
>> blockMesh
>> funkySetFields -time 0
IMPORTANT, RUN THIS INSTEAD OF setFields, WHERE -time 0 STIPULATES WHERE TO BEGIN THE IC
>> interFoam

All done!
divyesh likes this.
joshmccraney is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] funkySetFields and funkySetBoundaryFields zxj160 OpenFOAM Community Contributions 19 February 14, 2018 20:07
2D Glass Melt Simulation Setup marmz FLUENT 5 October 9, 2016 16:25
[swak4Foam] how to use funkySetFields function in muliregion case bryant_k OpenFOAM Community Contributions 12 August 1, 2016 05:40
[ICEM] surface/curve mesh setup Studi ANSYS Meshing & Geometry 15 November 12, 2014 01:32
[ICEM] Hexa mesh, curve mesh setup, bunching law Anorky ANSYS Meshing & Geometry 4 November 12, 2014 01:27


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