Skip to content
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

Add heat transfer #108

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Add heat transfer #108

wants to merge 37 commits into from

Conversation

streeve
Copy link
Collaborator

@streeve streeve commented Jun 28, 2024

Adds new heat transfer capability; part of #110

New example copies existing thermal deformation example

  • replacing the body term with a boundary condition
  • adding heat transfer
  • new thermal critical timestep

@streeve streeve added the enhancement New feature or request label Jun 28, 2024
@streeve streeve self-assigned this Jun 28, 2024
src/CabanaPD_Types.hpp Outdated Show resolved Hide resolved
double thermal_coeff;
double kappa;
double cp;
bool constant_conductivity;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this refers to the "micro-conductivity"? Perhaps call it "constant_microconductivity"?


BaseDynamicTemperatureModel( const double _delta, const double _kappa,
const double _cp,
const bool _constant_conductivity = true )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we do if we want a different micro-conductivity than the constant one?

kappa = _kappa;
cp = _cp;
const double d3 = _delta * _delta * _delta;
thermal_coeff = 9.0 / 2.0 * _kappa / pi / d3;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be analogous to Line 52 in CabanaPD_ForceModels_PMB.hpp. I was wondering if we should use a more clear description. There, we used "c". However using "k" may not be good.

constant_conductivity = _constant_conductivity;
}

KOKKOS_INLINE_FUNCTION double conductivity_function( double r ) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the function be called "microconductivity_function"?

}

template <class ParticleType>
void stepEuler( const ParticleType& particles, const double dt )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note we are using "forward" Euler


const double coeff =
model.thermal_coeff * model.conductivity_function( xi );
conduction( i ) +=
Copy link
Collaborator

@pabloseleson pabloseleson Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is conduction(i) initialized? Is this in Line 111: Cabana::deep_copy( conduction, 0.0 ); ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct

@@ -672,8 +675,8 @@ class Particles<MemorySpace, PMB, TemperatureDependent, Dimension>

// These are split since weighted volume only needs to be communicated once
// and dilatation only needs to be communicated for LPS.
using scalar_type = typename base_type::scalar_type;
using aosoa_temp_type = Cabana::AoSoA<scalar_type, memory_space, 1>;
using temp_types = Cabana::MemberTypes<double, double>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to store the temperature diffusion separate from the current temperature

@@ -252,6 +252,135 @@ auto createForceModel( PMB, Fracture, ParticleType particles,
delta, K, G0, temp, alpha, temp0 );
}

template <typename TemperatureType>
struct ForceModel<PMB, Elastic, DynamicTemperature, TemperatureType>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got confused about this. The heat transfer does not introduce a new mechanics model. What is this part for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All model details are included in the same object - mechanical and thermal. And confirming your point, the code below mostly just combines the two existing models

@pabloseleson
Copy link
Collaborator

The difference between the critical time step of heat transfer and mechanics requires:
(1) A multi-rate time-stepping scheme, where heat transfer is solved every number of time steps. Otherwise, the mechanics time step would be too small for the heat transfer. Thus will allow to solve both the heat transfer and the mechanics.
(2) The mechanics time step may be too small for actual applications, so we may consider implicit time-stepping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants