CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   possibility of converting 3D->2D for saving simulation time (https://www.cfd-online.com/Forums/openfoam-solving/116052-possibility-converting-3d-2d-saving-simulation-time.html)

liguifan April 11, 2013 21:04

possibility of converting 3D->2D for saving simulation time
 
Hello Foamers,

I am just wondering if I can reduce a 3D symmetrical simulation to a 2D simulation (maybe it is a dull question)?

What I am doing is to find the oil spreading time on cylindrical water tank. Since I need to make refined mesh of the interface of oil and water, but I can not afford the huge computational time for a 3D modeling.

I am not sure whether the simulation result is same or not.

Please give me some suggestion if possible.

erichu April 14, 2013 20:31

Quote:

Originally Posted by liguifan (Post 420006)
Hello Foamers,

I am just wondering if I can reduce a 3D symmetrical simulation to a 2D simulation (maybe it is a dull question)?

What I am doing is to find the oil spreading time on cylindrical water tank. Since I need to make refined mesh of the interface of oil and water, but I can not afford the huge computational time for a 3D modeling.

I am not sure whether the simulation result is same or not.

Please give me some suggestion if possible.


Hello,
you can try using a 2D axisymmetric wedge. However, I cannot comment the accuracy.
Would it be possible for you to coarsen the 3D mesh?

liguifan April 14, 2013 20:45

Thanks for the reply, do you have any idea about how to set up the boundary condition?
Here is my U file for 3D case
Quote:

boundaryField
{
outerWall
{
type fixedValue;
value uniform (0 0 0);
}

lowerWall
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type fluxCorrectedVelocity;
value uniform (0 0 0);
}
}
I would assume for the 2D case, it would be something like:
Quote:

boundaryField
{
outerWall
{
type fixedValue;
value uniform (0 0 0);
}
wedge1
{
type wedge;

}
wedge2
{
type wedge;
}
atmosphere
{
type fluxCorrectedVelocity;
value uniform (0 0 0);
}

}
Please correct me if I am wrong.

Thanks very much for that.

Akshay April 15, 2013 01:46

Hi Guifan
The 2d axis-symmetric wedge bc should work fine as Eric mentioned. What you have written down is the way to go. Put up a few pictures of your case and let's see how it's supposed to be done.
A small wedge angle needs to be there from the start. You cannot bring in an actual 2D model.

Cheers!
Akshay

liguifan April 15, 2013 11:56

1 Attachment(s)
Hi Akshay,

Firstly, thanks very much for you comment.
Here is the case I use a 2D to simulate the 3D( equivalent to: I cut a piece from the 3D water tank centre)
http://www.cfd-online.com/Forums/ope...tml#post420524

According to your suggestion, I also tried the 2D-axisymmetrical wedge and here is the details.
I following the following steps
1) build a rectangular mesh and convert it to a wedge using makeAxialMesh -axis axi -wedge frontAndBackPlanes ultility
then I get the following file in the newly created folder, and I replace the original Ploymesh folder under contant/
Quote:

7
(
axi
{
type symmetryPlane;
nFaces 39;
startFace 2271;
}
frontAndBackPlanes
{
type patch;
nFaces 0;
startFace 2310;
}
lowerWall
{
type patch;
nFaces 30;
startFace 2310;
}
outerWall
{
type patch;
nFaces 39;
startFace 2340;
}
atmosphere
{
type patch;
nFaces 30;
startFace 2379;
}
frontAndBackPlanes_pos
{
type wedge;
nFaces 1170;
startFace 2409;
}
frontAndBackPlanes_neg
{
type wedge;
nFaces 1170;
startFace 3579;
}
)
3) then I use collapeEdges 1e-8 180 ultility, it create another folder 0.001
I get
Quote:

7
(
axi
{
type symmetryPlane;
nFaces 0;
startFace 2271;
}
frontAndBackPlanes
{
type patch;
nFaces 0;
startFace 2271;
}
lowerWall
{
type patch;
nFaces 30;
startFace 2271;
}
outerWall
{
type patch;
nFaces 39;
startFace 2301;
}
atmosphere
{
type patch;
nFaces 30;
startFace 2340;
}
frontAndBackPlanes_pos
{
type wedge;
nFaces 1170;
startFace 2370;
}
frontAndBackPlanes_neg
{
type wedge;
nFaces 1170;
startFace 3540;
}
)
4) I replace this new folder with the polymesh in the constant/ again.
Since the "axi" and "frontAndBackPlanes" are with nFaces 0, so I deleted them in the boundary file and updated the alpha.org, U and p_rgh file accordingly.

5) I run checkMesh, I got the errors
Quote:

Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 2440
internal points: 0
faces: 4710
internal faces: 2271
cells: 1170
boundary patches: 6
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 1131
prisms: 39
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
axi 0 0 ok (empty)
lowerWall 30 61 ok (non-closed singly connected)
outerWall 39 80 ok (non-closed singly connected)
atmosphere 30 61 ok (non-closed singly connected)
frontAndBackPlanes_pos1170 1240 ok (non-closed singly connected)
frontAndBackPlanes_neg1170 1240 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.001 0 -0.000117163) (0.02 0.06 0.00511716)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge frontAndBackPlanes_pos with angle 2.49766 degrees
***Wedge patch frontAndBackPlanes_pos not planar. Point (0.00222222 0.058 0.00502992) is not in patch plane by 3.9962e-08 meter.
Boundary openness (2.73117e-18 1.01068e-20 7.05232e-18) OK.
Max cell openness = 1.97881e-16 OK.
Max aspect ratio = 59.0006 OK.
Minumum face area = 5.81594e-09. Maximum face area = 1.16322e-05. Face area magnitudes OK.
Min volume = 5.81594e-12. Max volume = 2.28767e-08. Total volume = 3.29763e-06. Cell volumes OK.
Mesh non-orthogonality Max: 5.67294e-05 average: 1.46889e-05
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.330801 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End
I am not sure why is this.



When I run multiphaseInterFoam I got the erros
Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.1.1-221db2718bbb
Exec : multiphaseInterFoam
Date : Apr 15 2013
Time : 10:25:11
Host : "liguifan-laptop"
PID : 4827
Case : /home/liguifan/Desktop/damBreak2
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi



--> FOAM FATAL IO ERROR:
Attempt to return dictionary entry as a primitive

file: /home/liguifan/Desktop/damBreak2/constant/transportProperties::phases from line 20 to line 36.

From function ITstream& primitiveEntry::stream() const
in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 82.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::IOerror::abort() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Foam::dictionaryEntry::stream() const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#3 Foam::dictionary::lookup(Foam::word const&, bool, bool) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 Foam::multiphaseMixture::multiphaseMixture(Foam::G eometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libmultiphaseInterFoam.so"
#5
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/multiphaseInterFoam"
#6 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#7
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/multiphaseInterFoam"
Aborted
Here is my alpha.org , U and p_rgh file
Quote:

boundaryField
{
outerWall
{
type buoyantPressure;
value uniform 0;
}


lowerWall
{
type buoyantPressure;
value uniform 0;
}


atmosphere
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}

axi
{
type symmetryPlane;
}
frontAndBackPlanes_pos
{
type wedge;

}
frontAndBackPlanes_neg
{
type wedge;

}
}
U
Quote:

boundaryField
{


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

outerWall
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
axi
{type symmetryPlane;
//value uniform (0 0 0);
}
frontAndBackPlanes_pos
{
type wedge;

}
frontAndBackPlanes_neg
{
type wedge;

}
}
alpha1.org
Quote:

boundaryField
{

outerWall
{
type zeroGradient;
}

lowerWall
{
type zeroGradient;
}

atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}

axi
{
type symmetryPlane;
}
frontAndBackPlanes_pos
{
type wedge;

}
frontAndBackPlanes_neg
{
type wedge;

}
}
Hope you can give me some suggestion!

ngj April 15, 2013 12:46

Hi Guifan,

The reported problem in your simulation is with your constant/transportProperties file. Please post this as well.

Where I see this?

Quote:

--> FOAM FATAL IO ERROR:
Attempt to return dictionary entry as a primitive

file: /home/liguifan/Desktop/damBreak2/constant/transportProperties::phases from line 20 to line 36.
Kind regards

Niels

liguifan April 15, 2013 13:01

Thanks for the reply!

Sorry for that I forgot to put it.
Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}

BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}

phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}

BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}

sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
Quote:

Originally Posted by ngj (Post 420708)
Hi Guifan,

The reported problem in your simulation is with your constant/transportProperties file. Please post this as well.

Where I see this?

Kind regards

Niels


ngj April 15, 2013 13:06

The problem is that you are using a transportProperties file for interFoam, however, you have executed multiphaseInterFoam.

Take a look in its tutorial to see how you should define the fluid properties.

Kind regards

Niels

liguifan April 15, 2013 13:15

Hi Niels,

Thanks for pointing out this for me and I will give it another try to see what happen later this afternoon.

Beside this problem, do you think my boundary for "axi" which is the axis correct.

Since in tutorial of NozzelFlow2D, its BC for axis is empty. However in my case after I execuated makeAxialMesh command. The BC for me axis is

Quote:

axi{
type symmetryPlane;
}
Does the difference hurt the result?

Kind regard,
Guifan

ngj April 15, 2013 13:17

Hi Guifan,

I can unfortunately help you, since I do not have any experience with wedge-type meshes.

Kind regards

Niels

liguifan April 15, 2013 13:18

Thanks anyway for the help! I will try to test more case to see the difference.

Cheers!

Kind regards,
Guifan

Akshay April 16, 2013 01:43

Hi Guifan!
The 'axi' boundary has 0 faces anyway, so it shouldn't really matter what BC you're declaring it as. As Niels rightly pointed out..
"--> FOAM FATAL IO ERROR:
Attempt to return dictionary entry as a primitive"
The way you have declared the phases are wrong. The materials should fall inside a phases block.
Let me know if this gets you through. Post your fvSolution file as well.
Cheers!


All times are GMT -4. The time now is 06:05.