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

gasSphereFlanks: add inner radius #66

Merged
merged 1 commit into from
Sep 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
20 changes: 12 additions & 8 deletions src/picongpu/include/particles/gasProfiles/gasSphereFlanks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ namespace picongpu
if( pos.y() < VACUUM_Y ) return float_X(0.0);

const float_X r = math::abs( pos - float3_X(GAS_X, GAS_Y, GAS_Z) );

// "hard core"
if( r <= GAS_R )

/* "shell": inner radius */
if( r < GAS_RI )
return float_X(0.0);
/* "hard core" */
else if( r <= GAS_R )
return float_X(1.0);

// "soft exp. flanks"
// note: by definition (return, see above) the
// argument [ GAS_R - r ] will be element of (-inf, 0)
return math::exp( ( GAS_R - r ) * GAS_EXP );

/* "soft exp. flanks"
* note: by definition (return, see above) the
* argument [ GAS_R - r ] will be element of (-inf, 0) */
else
return math::exp( ( GAS_R - r ) * GAS_EXP );
}
}
}
3 changes: 3 additions & 0 deletions src/picongpu/include/simulation_defines/param/gasConfig.param
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ namespace picongpu
/** Radius of the constant sphere
* unit: meter */
const double GAS_R_SI = 1.0e3;
/** Inner radius if you want to build a shell/ring
* unit: meter */
const double GAS_RI_SI = 0.0;

/** Middle of the constant sphere
* unit: meter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace picongpu
namespace gasSphereFlanks
{
const float_X GAS_R = float_X( SI::GAS_R_SI / UNIT_LENGTH );
const float_X GAS_RI = float_X( SI::GAS_RI_SI / UNIT_LENGTH );
const float_X GAS_X = float_X( SI::GAS_X_SI / UNIT_LENGTH );
const float_X GAS_Y = float_X( SI::GAS_Y_SI / UNIT_LENGTH );
const float_X GAS_Z = float_X( SI::GAS_Z_SI / UNIT_LENGTH );
Expand Down