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

Richards Component Transport #1929

Merged
merged 18 commits into from
Oct 17, 2017

Conversation

TomFischer
Copy link
Member

@TomFischer TomFischer commented Aug 28, 2017

Please do not review - this PR is to test the generation of the documentation.

Please review!

@TomFischer TomFischer force-pushed the RichardsComponentTransport branch 2 times, most recently from 5977bb8 to cc043fa Compare August 31, 2017 12:20
@TomFischer TomFischer force-pushed the RichardsComponentTransport branch from cc043fa to 3fc308b Compare September 8, 2017 09:48
@TomFischer TomFischer force-pushed the RichardsComponentTransport branch 3 times, most recently from 4d5c437 to ca5f624 Compare September 19, 2017 05:33
@TomFischer TomFischer force-pushed the RichardsComponentTransport branch 6 times, most recently from 23b6963 to 021992f Compare October 4, 2017 04:00
@chleh
Copy link
Collaborator

chleh commented Oct 4, 2017

There is a huge ParaView state file in this PR. Can it be removed, or moved to the data repo?

@hydromarc
Copy link

@chleh You are right, this state file should be in data... ( @TomFischer can you move this?)

@@ -0,0 +1,3 @@
Specific body forces applied to fluid.

It is usually used to apply gravitational forces. Given as a 2d or 3d vector.
Copy link
Member

Choose a reason for hiding this comment

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

Nit picking: it's probably copy-paste, but I'd think it also applies to 1d problems...

@@ -306,6 +306,8 @@ class LocalAssemblerData : public HTLocalAssemblerInterface
auto const& N = ip_data.N;
auto const& dNdx = ip_data.dNdx;

pos.setIntegrationPoint(ip);
Copy link
Member

Choose a reason for hiding this comment

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

This can be directly be pushed to the master. Has nothing to do with Richards...

@TomFischer TomFischer force-pushed the RichardsComponentTransport branch from 021992f to d28361c Compare October 10, 2017 09:56
cache.clear();
auto cache_vec = MathLib::createZeroedMatrix<
Eigen::Matrix<double, 1, Eigen::Dynamic>>(
cache, 1, n_integration_points);
Copy link
Member

@endJunction endJunction Oct 10, 2017

Choose a reason for hiding this comment

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

Not sure if the mapping is needed, because the cache is accessed only once by index (of integration point). But you might want to keep it if this style already became idiomatic (then the mapping could be to a VectorXd instead of a matrix).
The access below would be cache[ip] = Sw.

SpatialPosition pos;
pos.setElementID(_element_id);

auto const num_nodes = ShapeFunction::NPOINTS;
Copy link
Member

Choose a reason for hiding this comment

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

Just a comment about variable naming: shape function's number of points is not always equal to the number of nodes of an element. Maybe n_points? Feel free to ignore the suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

In some other multi variable processes, e.g. HM, there are class variables X_index and X_size for each variable X (pressure, displacement, temperature,...). Then the submatrix creation looks like:

auto KCC = local_K.template block<C_size, C_size>(C_index, C_index);
auto KCp = local_K.template block<C_size, p_size>(C_index, p_index);

@endJunction
Copy link
Member

endJunction commented Oct 10, 2017

I'd recommend to split the Process.h into declarations and an implementation parts, where the latter Process-impl.h is only included in the Process.cpp. This could save some compilation time.
See, for example HM process again with template instantiation declarations and the explicit instantiations in the HMProcess.cpp.

Never mind. This is not a template, as Tom mentions below... Silly me ;)

@TomFischer
Copy link
Member Author

TomFischer commented Oct 12, 2017

@endJunction
I don't understand your last comment concerning the splitting of the process into declarations and implementations. The RichardsComponentTransport process isn't a template. Maybe you want to suggest to split the FEM?

NumLib::shapeFunctionInterpolate(local_x, N, C_int_pt, p_int_pt);

double const pc_int_pt = -p_int_pt;
double const Sw = (pc_int_pt > 0)
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this ternary condition because (pc_int_pt > 0) is already checked inside

_process_data.porous_media_properties
                           .getCapillaryPressureSaturationModel(t, pos)
                                 .getSaturation(pc_int_pt)

as

double BrooksCoreyCapillaryPressureSaturation::getSaturation(
    const double capillary_pressure) const
{
    const double pc =
        (capillary_pressure < 0.0) ? _minor_offset : capillary_pressure;
     ...
    return MathLib::limitValueInInterval(S, _saturation_r + _minor_offset,
                                         _saturation_max - _minor_offset);

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the hint. Changed all locations.

.getSaturation(pc_int_pt)
: 1.0;

double const dSw_dpc =
Copy link
Member

Choose a reason for hiding this comment

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

The same reason to remove this ternary condition. With the change, the benchmark results will be changed slightly if the given maximum saturation is less than 1.


// saturation
double const pc_int_pt = -p_int_pt;
double const Sw = (pc_int_pt > 0)
Copy link
Member

Choose a reason for hiding this comment

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

The same here


// saturation
double const pc_int_pt = -p_int_pt;
double const Sw = (pc_int_pt > 0)
Copy link
Member

Choose a reason for hiding this comment

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

Here, the same.

@TomFischer TomFischer force-pushed the RichardsComponentTransport branch from 20a4868 to b5cddcf Compare October 16, 2017 06:01
Copy link
Member

@endJunction endJunction left a comment

Choose a reason for hiding this comment

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

TomFischer and others added 18 commits October 17, 2017 07:52
- Copied ComponentTransport folder
- Renamed ComponentTransport to RichardsComponentTransport
Change the assembly of the local matrix for the pressure Kpp.
Change the assembly of the local mass matrix for the pressure Mpp.
Change the assembly for the pressure related entries of the local right hand side.
Summarize several times used mathematical expression
into a variable.
Use variables for indices and size for accessing local matrices.
@TomFischer TomFischer force-pushed the RichardsComponentTransport branch from b5cddcf to 4d4ee32 Compare October 17, 2017 06:03
@TomFischer TomFischer merged commit a80a987 into ufz:master Oct 17, 2017
@TomFischer TomFischer deleted the RichardsComponentTransport branch October 17, 2017 12:30
@TomFischer TomFischer restored the RichardsComponentTransport branch November 8, 2017 09:48
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

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

Successfully merging this pull request may close these issues.

6 participants