CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

change boundary condition when switching solver

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

Like Tree1Likes
  • 1 Post By sufjanst

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2019, 22:52
Default change boundary condition when switching solver
  #1
New Member
 
Join Date: Feb 2010
Posts: 26
Rep Power: 12
Virtual-iCFD is on a distinguished road
Hi Foamers,

I first solve the model with potentialFOAM and then solve with simpleFOAM for a internal pipe flow.

Since my boundary condition I set up in simpleFOAM is both pressure inlet and pressure outlet, it won't solve the initial flow field using potentialFOAM. I changed inlet BC to inlet velocity.

After solving potential flow-field, i want to switch to solve simpleFOAM but now i need to change to original BC with pressure inlet instead of inlet velocity.

What is the file i need to make change? I tried to replace the folder 0 from my simpleFOAM to potentialFOAM once i completed my potentialFOAM computation but the simpleFOAM solver seems to ignore the new pressure inlet BC and still regard the inlet as velocity inlet.

Does anyone would know how I can do this correctly?

Thanks,
Virtual-iCFD is offline   Reply With Quote

Old   August 9, 2019, 16:53
Default
  #2
New Member
 
Join Date: Feb 2010
Posts: 26
Rep Power: 12
Virtual-iCFD is on a distinguished road
I am providing more details of the boundary conditions files i used.

The problem i am solving is pressure driven flow so in simplefoam i need to use both inlet and outlet pressure.

however, for initial flow field i need reasonable one to run simpleFOAM but with both inlet and outlet pressure, i don't know how to initialize such flow field.

Here is the BC files i use for calculating potentialFOAM

HTML Code:
/*----------------------------------------------------------------------------------------------------*\
|                                                                                                      | 
| 
|                                                                                                      | 
\*----------------------------------------------------------------------------------------------------*/



FoamFile
{
	version 2.0;
	format binary;
	class volVectorField;
	location "";
	object U;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 1 -1 0 0 0 0];

internalField uniform ( 0. 0. 0. );


boundaryField
{
	outlet
	{
		type zeroGradient;
	}

	inlet
	{
		type            uniformFixedValue;
        	uniformValue    constant (0 0 -0.2);
	}

	post1
	{
		type 		fixedValue;
		value		uniform (0 0 0);
	}

	post2
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post3
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post4
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post5
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post6
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	wall1
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	wall2
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}


}
HTML Code:
/*----------------------------------------------------------------------------------------------------*\
|                                                                                                      | 
|                                                                                                      | 
\*----------------------------------------------------------------------------------------------------*/



FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object p;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 2 -2 0 0 0 0];

internalField uniform 0.;


boundaryField
{
	outlet
	{
		type            fixedValue;
        	value           uniform 0;
	}

	inlet
	{
		type zeroGradient;
	}

	post1
	{
		type zeroGradient;
	}

	post2
	{
		type zeroGradient;
	}

	post3
	{
		type zeroGradient;
	}

	post4
	{
		type zeroGradient;
	}

	post5
	{
		type zeroGradient;
	}

	post6
	{
		type zeroGradient;
	}

	wall1
	{
		type zeroGradient;
	}

	wall2
	{
		type zeroGradient;
	}


}
Here is the BC files i use for calculating simpleFOAM

HTML Code:
/*----------------------------------------------------------------------------------------------------*\
|                                                                                                      | 
|   
|                                                                                                      | 
\*----------------------------------------------------------------------------------------------------*/



FoamFile
{
	version 2.0;
	format binary;
	class volVectorField;
	location "";
	object U;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 1 -1 0 0 0 0];

internalField uniform ( 0. 0. 0. );


boundaryField
{
	outlet
	{
		type zeroGradient;
	}

	inlet
	{
		type zeroGradient;
	}

	post1
	{
		type 		fixedValue;
		value		uniform (0 0 0);
	}

	post2
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post3
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post4
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post5
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	post6
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	wall1
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}

	wall2
	{
		type            fixedValue;
                value           uniform (0 0 0);
	}


}
HTML Code:
/*----------------------------------------------------------------------------------------------------*\
|                                                                                                      | 
| 
|                                                                                                      | 
\*----------------------------------------------------------------------------------------------------*/



FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object p;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 2 -2 0 0 0 0];

internalField uniform 0.;


boundaryField
{
	outlet
	{
		type            fixedValue;
        	value           uniform 0;
	}

	inlet
	{
		type            fixedValue;
        	value           uniform 865.470938;
	}

	post1
	{
		type zeroGradient;
	}

	post2
	{
		type zeroGradient;
	}

	post3
	{
		type zeroGradient;
	}

	post4
	{
		type zeroGradient;
	}

	post5
	{
		type zeroGradient;
	}

	post6
	{
		type zeroGradient;
	}

	wall1
	{
		type zeroGradient;
	}

	wall2
	{
		type zeroGradient;
	}


}
Virtual-iCFD is offline   Reply With Quote

Old   August 14, 2019, 04:50
Default
  #3
Member
 
Join Date: Mar 2016
Posts: 73
Rep Power: 6
sufjanst is on a distinguished road
When you run potentialFoam, the u-File in you "0" folder will be modified (so make sure to make a backup).

If you open the modified u file you will first see the values for "internalField". If you scroll down to the end of the file you can set up the bounday conditions (I would recommend using nedit for editing because the file can be very long).

Remember to delete phi in "0" after running potentialFoam, otherwise you will get an error in simpleFoam.
Virtual-iCFD likes this.
sufjanst is offline   Reply With Quote

Old   August 14, 2019, 06:02
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 379
Rep Power: 8
simrego is on a distinguished road
Hi!


Use changeDictionary. And change only the type of your BC, nothing else (Also leave the internal field as it is). It should works. But there is a newer utility for changing dictionaries but honestly I have never used it. It is called foamDictionary if i'm correct.
simrego is offline   Reply With Quote

Reply

Tags
change boundary condition, potentialfoam, simplefoam

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
How to change boundary condition from command fluent87 FLUENT 8 September 11, 2019 14:27
Constant mass flow rate boundary condition sahm OpenFOAM 0 June 20, 2018 23:45
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 17:08
problem of implementing a new solver with a special boundary condition huyidao OpenFOAM Programming & Development 0 April 27, 2015 09:24
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01


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