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/)
-   -   Dynamic Mesh issue concerning rotation in rhoCentralFoam/sonicFoam (https://www.cfd-online.com/Forums/openfoam-solving/237893-dynamic-mesh-issue-concerning-rotation-rhocentralfoam-sonicfoam.html)

emjaey3590 August 11, 2021 03:38

Dynamic Mesh issue concerning rotation in rhoCentralFoam/sonicFoam
 
Hello Foamers,

I am trying to use supersonic compressible solver (rhoCentralFoam/sonicFoam) to simulate flow across a bullet, which has a rotational motion (dynamicMeshDict). The bullet used is a stl file, henceforth I used snappyHexMesh to generate the Mesh. The arbitrary mesh interface (AMI) is also introduced in the simulation to enable simulation across disconnected, adjacent, mesh domains.

The boundary condition used for pressure (p) is:
For inlet, walls, bullet wall I have used "zeroGradient" boundary condition.
For outlet I have used "waveTransmissive" boundary condition.
For AMI I have used "cyclicAMI" boundary condition.

The boundary condition used for velocity (U) is:
For inlet "supersonicFreestream" is used.
For outlet "inletOutlet" is used.
For bullet "movingWallVelocity" is used.
For walls "zeroGradient" is used.
For AMI "cyclicAMI" is used.

The boundary condition used for temperature (T) is:
For inlet and outlet "inletOutlet" is used.
For walls and bullet wall "zeroGradient" is used.
For AMI "cyclicAMI" is used.

The fvSchemes and FvSolution that I have used is same as that of the tutorials that are provided for rhoCentralFoam and sonicFoam.

But when I try to launch the simulation, it runs for few iterations and finally fives the error mentioned below

Code:

--> FOAM FATAL ERROR:
Negative initial temperature T0: -26.69115

    From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-6/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:?
#3  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
#4  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
^C
[1]+  Aborted                (core dumped) rhoCentralFoam > log

Would somebody be kind enough to help me solve this problem.

Jonathan March 19, 2022 22:29

Quote:

Originally Posted by emjaey3590 (Post 810079)
Hello Foamers,

I am trying to use supersonic compressible solver (rhoCentralFoam/sonicFoam) to simulate flow across a bullet, which has a rotational motion (dynamicMeshDict). The bullet used is a stl file, henceforth I used snappyHexMesh to generate the Mesh. The arbitrary mesh interface (AMI) is also introduced in the simulation to enable simulation across disconnected, adjacent, mesh domains.

The boundary condition used for pressure (p) is:
For inlet, walls, bullet wall I have used "zeroGradient" boundary condition.
For outlet I have used "waveTransmissive" boundary condition.
For AMI I have used "cyclicAMI" boundary condition.

The boundary condition used for velocity (U) is:
For inlet "supersonicFreestream" is used.
For outlet "inletOutlet" is used.
For bullet "movingWallVelocity" is used.
For walls "zeroGradient" is used.
For AMI "cyclicAMI" is used.

The boundary condition used for temperature (T) is:
For inlet and outlet "inletOutlet" is used.
For walls and bullet wall "zeroGradient" is used.
For AMI "cyclicAMI" is used.

The fvSchemes and FvSolution that I have used is same as that of the tutorials that are provided for rhoCentralFoam and sonicFoam.

But when I try to launch the simulation, it runs for few iterations and finally fives the error mentioned below

Code:

--> FOAM FATAL ERROR:
Negative initial temperature T0: -26.69115

    From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-6/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:?
#3  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
#4  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
^C
[1]+  Aborted                (core dumped) rhoCentralFoam > log

Would somebody be kind enough to help me solve this problem.

Not sure if you solved this, but I have found with compressible simulations (rhoCentral and others) that time step size is really important. I often get (got) negative temperatures as soon as the shocks started forming if my Courant number was too high. Using adaptive time stepping based on Co number really helped, otherwise reducing the timestep to something smaller usually helps.

The other thing which people sometimes miss is to check your fluid properties - if you have an error and you try to do sonic flow, you're going to get funny results. For instance, make sure if you copy transportProperties / thermoPhysicalProperties from another case they are correct for your set up.

Hope it helps.


All times are GMT -4. The time now is 16:12.