-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
发现粘性力功率计算的实现和公式(4.59)有出入 #11
Conversation
@ZZP-DMU,感谢提出意见和修改,我将尽可能在这周内抽空探查所述问题。 |
! tdsdt(j) = tdsdt(j) + txx(i)*txx(j) + 2._rk*txy(i)*txy(j) + 2._rk*txz(i)*txz(j) + & | ||
! tyy(i)*tyy(j) + 2._rk*tyz(i)*tyz(j) + tzz(i)*tzz(j) | ||
! end if | ||
! end do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,你应该是对的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但由于这里只会影响能量守恒公式的计算结果(内能),不会影响程序的加速度求解,不知道粘性熵的具体公式,建议保持原状,保留你的注释。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tdsdt似乎是指粘性力功率,粘性力的公式书中在能量方程中分离出来了。不知道是否是指这个
src/single_step/internal_force.f90
Outdated
! tyy(i)*tyy(j) + 2._rk*tyz(i)*tyz(j) + tzz(i)*tzz(j) | ||
! end if | ||
! end do | ||
! tdsdt(i) = 0.5_rk*eta(i)/rho(i)*tdsdt(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段应该是:
do i = 1, ntotal
tdsdt(i) = 0.5_rk*eta(i)/rho(i)*tdsdt(i)
end do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,应该是这样的
@@ -53,6 +53,7 @@ subroutine kernel(r, dx, hsml, w, dwdx) | |||
w = factor*1._rk/6._rk*(2._rk - q)**3 | |||
do d = 1, dim | |||
dwdx(d) = -factor*1._rk/6._rk*3.*(2._rk - q)**2/hsml*(dx(d)/r) | |||
!dwda(d) =-factor*(2._rk - q)**2/2*hsml*(dx(d)/r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dwdx(d)应该没有问题?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来的写着比较冗余,所以我简化了一下
@@ -82,6 +82,7 @@ subroutine direct_find(itimestep, ntotal, hsml, x, niac, pair_i, pair_j, w, dwdx | |||
!> kernel and derivations of kernel | |||
|
|||
call kernel(r, dxiac, mhsml, w(niac), tdwdx) | |||
!kernel(r, dx, hsml, w, dwdx) | |||
do d = 1, dim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的注释是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个注释是kernel定义的形式,我在这边注释便于阅读
@@ -156,32 +156,62 @@ subroutine int_force(itimestep, dt, ntotal, hsml, mass, vx, niac, rho, eta, pair | |||
hvcc = 0._rk | |||
do d = 1, dim | |||
hvcc = hvcc + dvx(d)*dwdx(d, k) | |||
!看不懂hvcc&vcc到底是在计算什么东西 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实没有从函数中输出或者被使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在/src/sing_step/art_heat.f90中vcc&hvcc都出现了,应该和这里类似,表示速度的散度。但这里确实没有使用vcc&hvcc
src/single_step/density.f90
Outdated
do i = 1, ntotal | ||
rho(i) = rho(i)/wi(i) | ||
end do | ||
end if | ||
!?归一化,不太理解? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像是某些无重力场景会涉及到归一化密度。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是修正后的密度求和公式吗?
src/single_step/external_force.f90
Outdated
@@ -52,6 +52,14 @@ subroutine ext_force(ntotal, mass, x, niac, pair_i, pair_j, itype, hsml, dvxdt) | |||
do i = 1, ntotal | |||
dvxdt(dim, i) = -9.8_rk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可能写成:
dvxdt(dim, i) = dvxdt(dim, i) - 9.8_rk
但意义差不多,问题不大。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,dvxdt仅是输出的参数。
我之前的理解是:如果从外部传入的话,dvxdt可能会有非零初始值。
公式(4.59)中计算粘性力功率的项是:
$\frac{\mu_i}{2 \rho_i}\varepsilon_i^{\alpha \beta} \varepsilon_j^{\alpha \beta} $
但是在/src/single_step/internal_force.f90中的粘性力功率实现代码是:
我认为应该修改为如下形式