Skip to content

Commit

Permalink
1) adding conj heat transfer to stagflowcatalyst
Browse files Browse the repository at this point in the history
2) changing blockcat1d refinement criterion
3) changing sundials options in blockcat1d
  • Loading branch information
Hariswaran Sitaraman committed Aug 14, 2024
1 parent 76f7a2d commit 0708ddc
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 19 deletions.
6 changes: 3 additions & 3 deletions models/blockCatalyst1d/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ifeq ($(USE_SUNDIALS),TRUE)
# A good check is to see if $(SUNDIALS_ROOT)/lib has a bunch of libsundials_ files
# To run with sundials, enabled, please compile with USE_SUNDIALS = TRUE
SUNDIALS_ROOT ?= $(TOP)/../../../../../sundials/instdir
SUNDIALS_LIB_DIR ?= $(SUNDIALS_ROOT)/lib
SUNDIALS_LIB_DIR ?= $(SUNDIALS_ROOT)/lib64

USE_CVODE_LIBS ?= TRUE
USE_ARKODE_LIBS ?= TRUE
Expand All @@ -31,7 +31,7 @@ DEFINES += -DAMREX_USE_SUNDIALS
INCLUDE_LOCATIONS += $(SUNDIALS_ROOT)/include
LIBRARY_LOCATIONS += $(SUNDIALS_LIB_DIR)

LIBRARIES += -L$(SUNDIALS_LIB_DIR) -lsundials_cvode
LIBRARIES += -L$(SUNDIALS_LIB_DIR) -lsundials_arkode
LIBRARIES += -L$(SUNDIALS_LIB_DIR) -lsundials_cvode -lsundials_arkode
LIBRARIES += -L$(SUNDIALS_LIB_DIR) -lsundials_core -lsundials_nvecserial
LIBRARIES += -L$(SUNDIALS_LIB_DIR) -lsundials_nvecmanyvector
endif
2 changes: 1 addition & 1 deletion models/blockCatalyst1d/inputs_x
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mflo.lo_bc = 3 6 6
mflo.hi_bc = 3 6 6

# Tagging
mflo.tagged_vars = volfrac S1 S2
mflo.tagged_vars = volfrac
mflo.S1_refine = 1e20
mflo.S2_refine = 0.11
mflo.S1_refinegrad = 0.1
Expand Down
2 changes: 1 addition & 1 deletion models/blockCatalyst1d/inputs_y
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mflo.lo_bc = 6 3 6
mflo.hi_bc = 6 3 6

# Tagging
mflo.tagged_vars = volfrac S1 S2
mflo.tagged_vars = volfrac
mflo.S1_refine = 1e20
mflo.S2_refine = 0.11
mflo.S1_refinegrad = 0.1
Expand Down
2 changes: 1 addition & 1 deletion models/blockCatalyst1d/inputs_z
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mflo.lo_bc = 6 6 3
mflo.hi_bc = 6 6 3

# Tagging
mflo.tagged_vars = volfrac S1 S2
mflo.tagged_vars = volfrac
mflo.S1_refine = 1e20
mflo.S2_refine = 0.11
mflo.S1_refinegrad = 0.1
Expand Down
2 changes: 1 addition & 1 deletion models/blockCatalyst1d/verify_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#Plot solutions
#=======================================
fig,ax=plt.subplots(2,2,figsize=(8,4))
ax[0][0].plot(x,exactsoln,'r-',label="Exact solution")
ax[0][0].plot(x,exactsoln,'r-',label="Exact solution",linewidth=3)
ax[0][0].plot(x,fld_S1,'k*',label="mflo",markersize=2)
ax[0][0].legend(loc="best")

Expand Down
16 changes: 8 additions & 8 deletions models/stagFlowCatalyst/Prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,27 @@ void initdata(Box const& bx, Array4<Real> const& phi, GeometryData const& geomda
phi(i,j,k,RHOV_INDX) = phi(i,j,k,DENS_INDX)*phi(i,j,k,VELY_INDX);
phi(i,j,k,RHOW_INDX) = phi(i,j,k,DENS_INDX)*phi(i,j,k,VELZ_INDX);

if(vfrac==one)
if(vfrac>zeroval)
{
phi(i,j,k,TEMP_INDX) = mflo_thermo::get_t_from_rpc(
phi(i,j,k,DENS_INDX),phi(i,j,k,PRES_INDX),spec);

phi(i,j,k,RHOE_INDX) = phi(i,j,k,DENS_INDX)*
phi(i,j,k,RHOE_INDX) = phi(i,j,k,DENS_INDX)*
mflo_thermo::get_e_from_rpc(phi(i,j,k,DENS_INDX),phi(i,j,k,PRES_INDX),spec);

phi(i,j,k,RHOE_INDX) += half*phi(i,j,k,DENS_INDX)*
( phi(i,j,k,VELX_INDX)*phi(i,j,k,VELX_INDX)
+ phi(i,j,k,VELY_INDX)*phi(i,j,k,VELY_INDX)
+ phi(i,j,k,VELZ_INDX)*phi(i,j,k,VELZ_INDX) );
}
else
{
phi(i,j,k,TEMP_INDX) = mflo_thermo::get_t_from_rpc(
phi(i,j,k,DENS_INDX),phi(i,j,k,PRES_INDX),dummyspec);

phi(i,j,k,RHOE_INDX) = phi(i,j,k,DENS_INDX)*
mflo_thermo::get_e_from_rpc(phi(i,j,k,DENS_INDX),phi(i,j,k,PRES_INDX),dummyspec);
phi(i,j,k,RHOE_INDX) = mflo_thermo::get_solid_rhoe_from_t(phi(i,j,k,TEMP_INDX));
}

phi(i,j,k,RHOE_INDX) += half*phi(i,j,k,DENS_INDX)*
( phi(i,j,k,VELX_INDX)*phi(i,j,k,VELX_INDX)
+ phi(i,j,k,VELY_INDX)*phi(i,j,k,VELY_INDX)
+ phi(i,j,k,VELZ_INDX)*phi(i,j,k,VELZ_INDX) );

if(vfrac>zeroval)
{
Expand Down
2 changes: 2 additions & 0 deletions models/stagFlowCatalyst/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ mflo.volfrac_refinegrad = 0.1
mflo.vely_refine = 4.0
mflo.vely_refinegrad = 1e20

mflo.conjugate_heat_transfer=1

# PLOTFILES
amr.plot_file = plt # root name of plot file
amr.plot_int = 4000 # number of timesteps between plot files
Expand Down
8 changes: 5 additions & 3 deletions models/stagFlowCatalyst/thermo.H
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ namespace mflo_thermo
{
//modify if conjugate heat transfer
//included
amrex::Real temp=300.0;
amrex::Real Cv_solid=100.0;
amrex::Real rho_solid=2000.0;
amrex::Real temp=rhoe/(rho_solid*Cv_solid);
return(temp);
}

Expand All @@ -29,8 +31,8 @@ namespace mflo_thermo
{
//modify if conjugate
//heat transfer included
amrex::Real Cv_solid=1.0;
amrex::Real rho_solid=1.0;
amrex::Real Cv_solid=100.0;
amrex::Real rho_solid=2000.0;
return(rho_solid*Cv_solid*temp);
}
AMREX_GPU_HOST_DEVICE AMREX_INLINE
Expand Down
3 changes: 2 additions & 1 deletion models/stagFlowCatalyst/userfuncs.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ namespace mflo_user_funcs
GpuArray<Real, AMREX_SPACEDIM> dx,
const Real time)
{
Real volfrac=phi(i,j,k,VFRAC_INDX);
transpcoeffs(i,j,k,VISC_INDX ) = 1e-5; //viscosity
transpcoeffs(i,j,k,THCOND_INDX) = 0.01; //thermal conductivity
transpcoeffs(i,j,k,THCOND_INDX) = 0.01*volfrac+50.0*(1-volfrac); //thermal conductivity
}

AMREX_GPU_DEVICE AMREX_INLINE
Expand Down

0 comments on commit 0708ddc

Please sign in to comment.