Skip to content

Commit

Permalink
Fixes to enable stable single-phase runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
p-costa committed Jan 18, 2024
1 parent a86aa67 commit 86948a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/chkdt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ subroutine chkdt(n,dl,dzci,dzfi,is_solve_ns,mu12,rho12,sigma,gacc,u,v,w,dtmax,ga
dtik = sqrt(sigma/(minval(rho12(:)))/dlmin**3)
dtig = maxval(abs(gacc))/dlmin
dti = 2.*(dti+dtiv+sqrt((dti+dtiv)**2+4.*(dtig**2+dtik**2))) !TODO: follow Kang's paper to include dtipsi in the single dti formula, if is_solve_ns = .true.
if(dti == 0.) dti = 1.
if(dti == 0.) dti = 1.
if(dtipsi == 0.) dtipsi = 1.
dtmax = min(dti**(-1),dtipsi**(-1))
end if
#if defined(_SCALAR)
Expand Down
4 changes: 3 additions & 1 deletion src/rk.f90
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ subroutine rk_scal(rkpar,n,dli,dzci,dzfi,dt, &
end subroutine rk_scal
!
subroutine rk_2fl(rkpar,n,dli,dzci,dzfi,dt,gam,seps,u,v,w,psi)
use mod_acdi, only: acdi_transport_pf
use mod_acdi , only: acdi_transport_pf
use mod_two_fluid, only: clip_field
!
! low-storage 3rd-order Runge-Kutta scheme
! for time integration of the phase field (actually Adams-Bashforth).
Expand Down Expand Up @@ -214,6 +215,7 @@ subroutine rk_2fl(rkpar,n,dli,dzci,dzfi,dt,gam,seps,u,v,w,psi)
end do
end do
end do
call clip_field([1,1,1],[0._rp,1._rp],psi)
!
! swap d?dtrk <-> d?dtrko
!
Expand Down
2 changes: 1 addition & 1 deletion src/two_fluid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module mod_two_fluid
use mod_types
implicit none
private
public init2fl,cmpt_norm_curv
public init2fl,clip_field,cmpt_norm_curv
type sphere
real(rp) :: xyz(3),r
end type sphere
Expand Down

0 comments on commit 86948a0

Please sign in to comment.