Skip to content

Commit

Permalink
add 8th degree Landau free energy terms
Browse files Browse the repository at this point in the history
  • Loading branch information
prkkumar committed Apr 25, 2024
1 parent e4c9a62 commit fdd92d7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
54 changes: 30 additions & 24 deletions Source/FieldSolver/FerroE/Eff_Field_Landau.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,49 @@
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::Real FerroE::compute_ex_Landau(const amrex::Real Px, const amrex::Real Py, const amrex::Real Pz)
{
//amrex::Print() << "alpha_1 = " << alpha_1 << "\n";
//amrex::Print() << "alpha_11 = " << alpha_11 << "\n";
//amrex::Print() << "alpha_111 = " << alpha_111 << "\n";
return -2.*alpha_1*Px - 4.*alpha_11*std::pow(Px,3.) - 6.*alpha_111*std::pow(Px,5.)
- 2. * alpha_12 * Px * std::pow(Py,2.)
- 2. * alpha_12 * Px * std::pow(Pz,2.)
- 4. * alpha_112 * std::pow(Px,3.) * (std::pow(Py,2.) + std::pow(Pz,2.))
- 2. * alpha_112 * Px * std::pow(Py,4.)
- 2. * alpha_112 * Px * std::pow(Pz,4.)
- 2. * alpha_123 * Px * std::pow(Py,2.) * std::pow(Pz,2.);
return -2.*alpha_1 * Px
-4.*alpha_11 * std::pow(Px,3.) -2.*alpha_12 * Px * (std::pow(Py,2.) + std::pow(Pz,2.))
-6.*alpha_111 * std::pow(Px,5.)
-4.*alpha_112 * std::pow(Px,3.) * (std::pow(Py,2.) + std::pow(Pz,2.))
-2.*alpha_112 * Px * (std::pow(Py,4.) + std::pow(Pz,4.))
-2.*alpha_123 * Px * std::pow(Py,2.) * std::pow(Pz,2.)
-8.*alpha_1111 * std::pow(Px,7.)
-2.*alpha_1112 * Px * ( std::pow(Py,6.) + std::pow(Pz,6.) + 3.*std::pow(Px,4.)*(std::pow(Py,2) + std::pow(Pz,2)))
-4.*alpha_1122*std::pow(Px,3.)*(std::pow(Py,4.) + std::pow(Pz,4))
-2.*alpha_1123*Px*std::pow(Py,2.)*std::pow(Pz,2.)*(2.*std::pow(Px,2.) + std::pow(Py,2.) + std::pow(Pz,2));
}


//Compute y-component of electric field corresponding to the Landau free energy contribution
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::Real FerroE::compute_ey_Landau(const amrex::Real Px, const amrex::Real Py, const amrex::Real Pz)
{
return -2.*alpha_1*Py - 4.*alpha_11*std::pow(Py,3.) - 6.*alpha_111*std::pow(Py,5.)
- 2. * alpha_12 * Py * std::pow(Px,2.)
- 2. * alpha_12 * Py * std::pow(Pz,2.)
- 4. * alpha_112 * std::pow(Py,3.) * (std::pow(Px,2.) + std::pow(Pz,2.))
- 2. * alpha_112 * Py * std::pow(Px,4.)
- 2. * alpha_112 * Py * std::pow(Pz,4.)
- 2. * alpha_123 * Py * std::pow(Px,2.) * std::pow(Pz,2.);
return -2.*alpha_1 * Py
-4.*alpha_11 * std::pow(Py,3.) -2.*alpha_12 * Py * (std::pow(Pz,2.) + std::pow(Px,2.))
-6.*alpha_111 * std::pow(Py,5.)
-4.*alpha_112 * std::pow(Py,3.) * (std::pow(Pz,2.) + std::pow(Px,2.))
-2.*alpha_112 * Py * (std::pow(Pz,4.) + std::pow(Px,4.))
-2.*alpha_123 * Py * std::pow(Pz,2.) * std::pow(Px,2.)
-8.*alpha_1111 * std::pow(Py,7.)
-2.*alpha_1112 * Py * ( std::pow(Pz,6.) + std::pow(Px,6.) + 3.*std::pow(Py,4.)*(std::pow(Pz,2) + std::pow(Px,2)))
-4.*alpha_1122*std::pow(Py,3.)*(std::pow(Pz,4.) + std::pow(Px,4))
-2.*alpha_1123*Py*std::pow(Pz,2.)*std::pow(Px,2.)*(2.*std::pow(Py,2.) + std::pow(Pz,2.) + std::pow(Px,2));
}


//Compute z-component of electric field corresponding to the Landau free energy contribution
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::Real FerroE::compute_ez_Landau(const amrex::Real Px, const amrex::Real Py, const amrex::Real Pz)
{
return -2.*alpha_1*Pz - 4.*alpha_11*std::pow(Pz,3.) - 6.*alpha_111*std::pow(Pz,5.)
- 2. * alpha_12 * Pz * std::pow(Px,2.)
- 2. * alpha_12 * Pz * std::pow(Py,2.)
- 4. * alpha_112 * std::pow(Pz,3.) * (std::pow(Px,2.) + std::pow(Py,2.))
- 2. * alpha_112 * Pz * std::pow(Px,4.)
- 2. * alpha_112 * Pz * std::pow(Py,4.)
- 2. * alpha_123 * Pz * std::pow(Px,2.) * std::pow(Py,2.);
return -2.*alpha_1 * Pz
-4.*alpha_11 * std::pow(Pz,3.) -2.*alpha_12 * Pz * (std::pow(Px,2.) + std::pow(Py,2.))
-6.*alpha_111 * std::pow(Pz,5.)
-4.*alpha_112 * std::pow(Pz,3.) * (std::pow(Px,2.) + std::pow(Py,2.))
-2.*alpha_112 * Pz * (std::pow(Px,4.) + std::pow(Py,4.))
-2.*alpha_123 * Pz * std::pow(Px,2.) * std::pow(Py,2.)
-8.*alpha_1111 * std::pow(Pz,7.)
-2.*alpha_1112 * Pz * ( std::pow(Px,6.) + std::pow(Py,6.) + 3.*std::pow(Pz,4.)*(std::pow(Px,2) + std::pow(Py,2)))
-4.*alpha_1122*std::pow(Pz,3.)*(std::pow(Px,4.) + std::pow(Py,4))
-2.*alpha_1123*Pz*std::pow(Px,2.)*std::pow(Py,2.)*(2.*std::pow(Pz,2.) + std::pow(Px,2.) + std::pow(Py,2));
}

4 changes: 4 additions & 0 deletions Source/FieldSolver/FerroE/FerroE.H
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public:
const amrex::Real alpha_111 = 1.294e9;
const amrex::Real alpha_112 = -1.95e9;
const amrex::Real alpha_123 = -2.5e9;
const amrex::Real alpha_1111 = 3.863e10;
const amrex::Real alpha_1112 = 2.529e10;
const amrex::Real alpha_1122 = 1.637e10;
const amrex::Real alpha_1123 = 1.367e10;

};

Expand Down

0 comments on commit fdd92d7

Please sign in to comment.