**Abstract** : We present a general variational framework designed to consider constrained optimization and sensitivity analysis of spatially and temporally evolving flows defined as solutions of partial differential equations. We particularly focus on seminorm constraints which naturally arise for instance when the quantity which we wish to optimize can have contributions from several terms in the PDE through different physical mechanisms in a specific physical system. We show that this case implicitly requires that constraints be placed on the magnitude of complementary (with respect to the first constraining seminorm) seminorms of initial perturbations such that the sum of these complementary seminorms defines a total "true" norm of the state vector. A simple (true) norm constraint naturally satisfies this property. Therefore, the use of this framework requires the introduction of new parameters which describe the relative magnitude of the initial perturbation state vector calculated using the various constrained complementary seminorms to the magnitude calculated using the true norm, even for linear problems. We demonstrate that any required optimization has to be carried out by prescribing these new parameters as initial conditions on the admissible perturbations; the influence and significance of each seminorm component, partitioning the initial total norm of the perturbation, can then be considered quantitatively. To demonstrate the utility of this framework, we consider an idealized problem, the (linear) nonmodal stability analysis of a mean flow given by a "Reynolds averaging" of the one-dimensional stochastically forced Burgers equation. We close the mean flow equation by introducing a turbulent viscosity to model the turbulent mixing, which we allow to evolve subject to a new transport equation. Since we are interested in optimizing the relative amplification of the perturbation kinetic energy (i.e., the perturbation's "gain") this problem naturally requires the use of our new framework, as the kinetic energy is a seminorm of the full state velocity-viscosity vector, with a new adjustable parameter, describing the ratio of an appropriate viscosity seminorm to the sum of this viscosity seminorm and the kinetic energy seminorm. Using this framework, we demonstrate that the dynamics of the full system, allowing the turbulent viscosity to evolve subject to its transport equation, is qualitatively different from the behavior when the turbulent viscosity is "frozen" at a fixed, mean value, since a new mechanism of perturbation energy production appears, through the coupling of the evolving turbulent viscosity perturbation and the mean velocity field.